@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   DESIGN TOKENS — Professional White Theme
   ============================================================ */
:root {
    --primary:          #4f46e5;
    --primary-hover:    #4338ca;
    --primary-light:    #ede9fe;
    --primary-text:     #4f46e5;

    --bg:               #f5f6fa;
    --sidebar-bg:       #ffffff;
    --card-bg:          #ffffff;

    --border:           #e5e7eb;
    --border-light:     #f3f4f6;

    --text:             #111827;
    --text-secondary:   #374151;
    --text-muted:       #6b7280;
    --text-faint:       #9ca3af;

    --success:          #059669;
    --success-bg:       #ecfdf5;
    --success-border:   #a7f3d0;

    --error:            #dc2626;
    --error-bg:         #fef2f2;
    --error-border:     #fecaca;

    --warning:          #d97706;
    --warning-bg:       #fffbeb;
    --warning-border:   #fde68a;

    --amber:            #f59e0b;
    --amber-bg:         rgba(245,158,11,0.08);
    --amber-border:     rgba(245,158,11,0.25);

    --shadow-sm:        0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:        0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:        0 10px 30px rgba(0,0,0,0.09), 0 4px 8px rgba(0,0,0,0.05);

    --radius-sm:        8px;
    --radius-md:        12px;
    --radius-lg:        16px;
    --radius-xl:        20px;

    --sidebar-width:    260px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 0.15rem;
    letter-spacing: 0.01em;
}

.status-indicator.offline {
    color: var(--text-muted);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(5,150,105,0.5);
    animation: pulse 2s infinite;
}

.status-indicator.offline .pulse-dot {
    background: var(--text-faint);
    box-shadow: none;
    animation: none;
}

@keyframes pulse {
    0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5,150,105,0.5); }
    70%  { transform: scale(1);    box-shadow: 0 0 0 6px rgba(5,150,105,0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5,150,105,0); }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 1.25rem 0 0.4rem 0.6rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
}

.nav-item:hover {
    background: var(--border-light);
    color: var(--text-secondary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-item i {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem 2.5rem;
    max-width: calc(100vw - var(--sidebar-width));
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.main-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.main-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

.sync-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #c4b5fd;
    padding: 0.45rem 0.9rem;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.sync-badge i {
    width: 14px;
    height: 14px;
}

/* ============================================================
   PANELS
   ============================================================ */
.content-panel {
    display: none;
    animation: fadeUp 0.25s ease forwards;
}

.content-panel.active {
    display: block;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 800px;
}

.card.full-width {
    max-width: 100%;
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.01em;
}

.card h2 i {
    color: var(--primary);
    width: 1.1rem;
    height: 1.1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.employee-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    padding: 1.25rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: 3px solid transparent;
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.75rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    position: relative;
    user-select: none;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card:active {
    transform: translateY(0);
}

/* Active / selected state */
.stat-card.active-blue  { border-top-color: var(--primary); background: #fafaff; }
.stat-card.active-red   { border-top-color: var(--error);   background: #fff5f5; }
.stat-card.active-amber { border-top-color: var(--warning);  background: #fffdf0; }

/* Small hint label in bottom-right corner */
.stat-card::after {
    content: 'Click to filter';
    position: absolute;
    bottom: 0.5rem;
    right: 0.85rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-faint);
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-transform: uppercase;
}

.stat-card:hover::after   { opacity: 1; }
.stat-card.active-blue::after  { content: 'Showing all'; opacity: 1; color: var(--primary); }
.stat-card.active-red::after   { content: 'Filtered';    opacity: 1; color: var(--error); }
.stat-card.active-amber::after { content: 'Filtered';    opacity: 1; color: var(--warning); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    width: 1.4rem;
    height: 1.4rem;
}

.stat-icon.blue   { background: #ede9fe; color: var(--primary); }
.stat-icon.green  { background: var(--success-bg); color: var(--success); }
.stat-icon.amber  { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red    { background: var(--error-bg);   color: var(--error); }

/* ============================================================
   FILTER INDICATOR PILL
   ============================================================ */
.filter-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #c4b5fd;
    margin-bottom: 0.75rem;
    animation: rowIn 0.2s ease;
}

.filter-active-pill button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.filter-active-pill button:hover { opacity: 1; }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.3rem;
    line-height: 1.3;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-bar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.filter-bar-label i {
    color: var(--primary);
    width: 1rem;
    height: 1rem;
}

.filter-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    flex-wrap: wrap;
}

.filter-sep {
    font-size: 0.8rem;
    color: var(--text-faint);
}

/* ============================================================
   INPUTS & BUTTONS
   ============================================================ */
input[type="date"],
input[type="text"],
input[type="number"],
select {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="date"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
    background: #fff;
}

button {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    font-size: 0.875rem;
    border: none;
    font-family: inherit;
    white-space: nowrap;
}

button i {
    width: 14px;
    height: 14px;
}

/* Primary action button */
.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 0.55rem 1.1rem;
    box-shadow: 0 1px 3px rgba(79,70,229,0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 3px 8px rgba(79,70,229,0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary / ghost button */
.secondary {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.55rem 1rem;
}

.secondary:hover {
    background: var(--border-light);
}

/* ============================================================
   TABLE
   ============================================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

th {
    text-align: left;
    padding: 0.9rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    vertical-align: middle;
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr.analytics-main-row:hover td {
    background: #fafafa;
}

.table-loading {
    text-align: center;
    padding: 4rem !important;
    color: var(--text-muted);
    line-height: 2.2;
    font-size: 0.9rem;
}

.table-loading i {
    display: block;
    margin: 0 auto 0.5rem;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--primary);
}

/* ============================================================
   BADGES
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

/* In-hours — green */
.badge-in {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

/* Off-hours — red */
.badge-out {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error-border);
}

/* Early departure — amber */
.badge-early {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

/* Late arrival — rose/red */
.badge-late {
    background: #fff5f5;
    color: #e11d48;
    border: 1px solid #fecdd3;
}

/* Method — neutral */
.badge-method {
    background: #f3f4f6;
    color: var(--text-muted);
    border: 1px solid var(--border);
    text-transform: uppercase;
}

/* Login scan — purple */
.badge-login {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #c4b5fd;
}

/* Plain scan */
.badge-scan {
    background: #f3f4f6;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ============================================================
   DRILL-DOWN ROW
   ============================================================ */
.analytics-detail-row td {
    background: #f9fafb;
    padding: 0 !important;
    border-bottom: 1px solid var(--border);
}

.drill-down-inner {
    padding: 1rem 1.5rem 1.25rem 3.25rem;
}

.drill-down-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.scan-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--border);
    margin-bottom: 0.4rem;
    transition: background 0.15s;
}

.scan-item:last-child { margin-bottom: 0; }
.scan-item:hover { background: #f5f5ff; }

.scan-num {
    font-size: 0.7rem;
    color: var(--text-faint);
    width: 20px;
    text-align: right;
    font-weight: 600;
    flex-shrink: 0;
}

.scan-time {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
    min-width: 90px;
    flex-shrink: 0;
}

.scan-method {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

.scan-note {
    font-size: 0.78rem;
    color: var(--warning);
    font-style: italic;
}

/* ============================================================
   CHEVRON TOGGLE
   ============================================================ */
.row-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-faint);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.row-chevron.open {
    transform: rotate(90deg);
    color: var(--primary);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    animation: toastIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
    min-width: 280px;
    max-width: 400px;
    font-size: 0.875rem;
    font-weight: 500;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-success i { color: var(--success); }
.toast.toast-error   { border-left-color: var(--error); }
.toast.toast-error   i { color: var(--error); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-warning i { color: var(--warning); }

.toast i { width: 18px; height: 18px; flex-shrink: 0; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(110%) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.toast-fadeOut {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(40%) scale(0.95); }
}

/* ============================================================
   SPIN ANIMATION
   ============================================================ */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   FADE-IN ROW ANIMATION
   ============================================================ */
@keyframes rowIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: rowIn 0.3s ease forwards;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    width: 2.5rem;
    height: 2.5rem;
    display: block;
    margin: 0 auto 0.75rem;
    color: var(--text-faint);
}

.empty-state p {
    font-size: 0.9rem;
}

/* ============================================================
   MOBILE RESPONSIVENESS (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        position: sticky;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        z-index: 1000;
        box-shadow: var(--shadow-sm);
    }

    .sidebar-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .sidebar-nav {
        display: none; /* Hide navigation buttons on mobile as it's a single page app now */
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 1rem;
    }

    .main-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .sync-badge {
        width: 100%;
        justify-content: center;
    }

    .stat-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .employee-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem 0;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }

    .filter-bar-label {
        width: 100%;
    }

    .filter-inputs {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .filter-inputs input[type="date"] {
        width: 100%;
    }

    .filter-sep {
        text-align: center;
        margin: 0.25rem 0;
    }

    .filter-bar button {
        width: 100%;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .card-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
    }

    .card-actions button {
        width: 100%;
    }

    .table-container table {
        min-width: 750px;
    }
}

/* ============================================================
   PORTAL LOGIN SCREEN
   ============================================================ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    background: radial-gradient(circle at 10% 20%, rgb(242, 235, 243) 0%, rgb(228, 228, 255) 90%);
    padding: 1.5rem;
    box-sizing: border-box;
}

.login-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);
    border-radius: 1.25rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    box-sizing: border-box;
    animation: fadeIn 0.4s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand-icon {
    width: 3.5rem;
    height: 3.5rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.8rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.login-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.025em;
}

.login-header p {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding: 0.75rem 2.75rem 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

.password-wrapper input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.15);
}

.toggle-password-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.toggle-password-btn:hover {
    color: var(--text);
}

.toggle-password-btn i {
    width: 1.2rem;
    height: 1.2rem;
}

.login-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(111, 66, 193, 0.2);
}

.login-submit-btn:hover {
    background: #5b32a1;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(111, 66, 193, 0.3);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.login-error-msg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff5f5;
    border: 1px solid rgba(225, 29, 72, 0.15);
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    color: var(--error);
    font-size: 0.825rem;
    font-weight: 600;
    line-height: 1.3;
}

.login-error-msg i {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shake {
    animation: shake 0.35s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.logout-btn:hover {
    background: var(--error-bg) !important;
    color: var(--error) !important;
}