:root {
    /* Tailwind Slate Palette */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    /* Theme Colors (Linear/Vercel aesthetic) */
    --primary-color: var(--slate-900);
    --primary-hover: var(--slate-800);
    --secondary-color: #2563eb;
    --secondary-hover: #1d4ed8;

    --bg-color: #f8fafc;
    --text-main: var(--slate-800);
    --text-muted: var(--slate-500);
    --card-bg: #ffffff;
    --sidebar-bg: #0f172a;
    --border-color: #e2e8f0;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Modern SaaS Shadows (Multi-layered, soft) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.02);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.01);

    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 30px -5px rgba(0, 0, 0, 0.08);

    --glass-border: rgba(255, 255, 255, 0.4);

    /* Layout Constants */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--slate-900);
}

.auth-bg {
    background: linear-gradient(135deg, #e0e7ff 0%, #fbcfe8 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border-radius: 16px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-xl);
    transition: var(--transition);
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.auth-header p {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--slate-400);
    box-shadow: 0 0 0 3px rgba(226, 232, 240, 0.8), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-control.is-invalid {
    border-color: var(--danger);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--danger);
    font-weight: 500;
}

.is-invalid + .error-feedback {
    display: block;
}

/* Shake Animation for invalid fields */
@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.shake-error {
    animation: fieldShake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    border-color: var(--danger) !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    font-family: inherit;
    letter-spacing: -0.01em;
    text-decoration: none !important;
}

.btn:hover,
.btn:focus,
.btn:active {
    text-decoration: none !important;
    outline: none;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--slate-800), var(--slate-900));
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--slate-700), var(--slate-800));
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.9rem;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Admin layout styles */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    /* dark sidebar */
    color: #f8fafc;
    padding: 1.5rem 0;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #a2a3b7;
    text-decoration: none;
    transition: 0.3s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid #38bdf8;
    transform: translateX(4px);
}

.sidebar-nav li a i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 1.1rem;
    color: inherit;
}

.main-content {
    flex-grow: 1;
    padding: 0 2rem 2rem 2rem;
    overflow-y: auto;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
}

/* Card Utilities */
.card,
.glass-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.6);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.shadow-soft {
    box-shadow: var(--shadow-soft) !important;
}

/* Responsive Grid Utilities */
.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-gap-4 {
    gap: 1rem;
}

@media (max-width: 992px) {
    .grid-2-col {
        grid-template-columns: 1fr;
    }
}

/* Modern Table Styles */
.table-wrapper {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.table th,
.table td {
    padding: 0.6rem 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.table th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--border-color);
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Action Button Groups */
.action-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    align-items: center;
    width: max-content;
}

.action-section {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    padding: 0.2rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.6rem;
    gap: 0.3rem;
    border-radius: 6px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-action.success {
    background-color: #dcfce7;
    color: #166534;
}

.btn-action.success:hover {
    background-color: #bbf7d0;
    transform: translateY(-1px);
}

.btn-action.primary {
    background-color: #dbeafe;
    color: #1e40af;
}

.btn-action.primary:hover {
    background-color: #bfdbfe;
    transform: translateY(-1px);
}

.btn-action.info {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-action.info:hover {
    background-color: #e2e8f0;
    transform: translateY(-1px);
}

.btn-action.danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.btn-action.danger:hover {
    background-color: #fecaca;
    transform: translateY(-1px);
}

.btn-action:hover {
    transform: scale(1.05);
    color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-action.success:hover {
    color: var(--success);
}

.btn-action.danger:hover {
    color: var(--danger);
}

.btn-action.warning:hover {
    color: var(--warning);
}

.btn-action.info:hover {
    color: #0ea5e9;
}

.btn-action.primary:hover {
    color: var(--primary-color);
}

/* Logo Pulse Animation */
@keyframes softPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(15, 23, 42, 0.15);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(15, 23, 42, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(15, 23, 42, 0);
    }
}

.logo-pulse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.05);
    animation: softPulse 2s infinite;
    margin-bottom: 0.5rem;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 9999px;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Search Input Styles */
.search-wrapper {
    position: relative;
    max-width: 300px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    /* full rounded */
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background-color: var(--card-bg);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* User Profile Header */
.top-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin: 0 -2rem 2rem -2rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

@keyframes profileRingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.profile-btn-anim {
    border-radius: 50%;
    animation: profileRingPulse 2.5s infinite ease-in-out;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.profile-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 180px;
    display: none;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: var(--bg-color);
}

/* Admin Footer */
.admin-footer {
    padding: 1.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.footer-divider {
    color: var(--border-color);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
        padding-right: 15px;
    }

    .top-header-bar {
        justify-content: flex-start;
    }

    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 260px;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        height: 100vh;
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-header {
        padding: 1.5rem 1.5rem 1rem;
        display: block;
        text-align: center;
    }

    .sidebar-nav ul {
        display: block;
        padding: 0;
    }

    .sidebar-nav li {
        display: block;
    }

    .sidebar-nav li a {
        padding: 0.75rem 1.5rem;
        text-align: left;
        border-bottom: none;
        border-radius: 0;
        font-size: 1rem;
    }

    .sidebar-nav li a.active,
    .sidebar-nav li a:hover {
        border-bottom: none;
        border-left: 3px solid var(--primary-color);
        background: rgba(255, 255, 255, 0.1);
    }

    .main-content {
        padding: 0 1rem 1rem 1rem;
    }

    .top-header-bar {
        justify-content: flex-start;
        margin: 0 -1rem 1.5rem -1rem;
        padding: 1rem;
    }

    /* General Grids to single column */
    .form-group[style*="column"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Global Paddings & Layouts */
    .auth-container {
        padding: 1.5rem;
        margin: 1rem;
    }

    .glass-card {
        padding: 1.5rem !important;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .registration-layout {
        padding: 0 0.5rem !important;
        margin: 1rem auto !important;
    }

    .registration-layout h1 {
        font-size: 1.5rem;
    }

    /* Tables scrolling */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }

    table {
        min-width: 100%;
        white-space: nowrap;
    }

    /* Admin Footer Stacking */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .footer-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    .dashboard-stats .value {
        font-size: 2rem !important;
    }

    .form-group[style*="gap"] {
        flex-direction: column;
        gap: 0.5rem !important;
    }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--slate-300);
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

/* Hero Logo Styles */
.hero-logo-container {
    background: white;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: inline-block;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

@keyframes logo-outside-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.45);
        opacity: 0;
    }
}

/* Homepage Mobile Responsiveness */
@media (max-width: 600px) {
    .registration-layout {
        margin: 1.5rem auto !important;
        padding: 0 1rem !important;
    }

    .hero-section {
        grid-template-columns: 1fr !important;
        text-align: center !important;
        padding: 3rem 1.75rem !important;
        gap: 2.5rem !important;
    }

    .hero-logo {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
        margin-bottom: 1.25rem !important;
    }

    .hero-logo-container {
        margin: 0 auto !important;
        border-radius: var(--radius-lg) !important;
        width: 115px !important;
        height: 115px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        background: white !important;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2) !important;
    }

    /* Simple Outer Glow (Square Shape) */
    .hero-logo-container::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.35);
        border-radius: var(--radius-lg);
        z-index: -1;
        animation: logo-outside-pulse 2.2s infinite cubic-bezier(0.25, 1, 0.5, 1);
    }

    .hero-logo-container img {
        max-height: 85px !important;
        max-width: 85px !important;
        border-radius: 0 !important;
    }

    .hero-content h1 {
        font-size: 1.95rem !important;
        margin-bottom: 0.85rem !important;
    }

    .hero-content p {
        font-size: 1.05rem !important;
        opacity: 0.9 !important;
    }

    .responsive-form-row {
        flex-direction: column !important;
        gap: 1.25rem !important;
    }

    .responsive-form-row>div {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Footer Responsive Fix */
    .footer-credits {
        flex-direction: column !important;
        gap: 0.35rem !important;
    }

    .footer-credits .separator {
        display: none !important;
    }
}

.footer-credits {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.separator {
    color: #cbd5e1;
}

/* Sidebar Logo Subtle Pulse Animation */
.logo-subtle-pulse {
    animation: sidebarLogoSoftPulse 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes sidebarLogoSoftPulse {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); 
        transform: scale(1.03);
    }
}