:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-input: #252830;
    --border: #2d3040;
    --text: #e4e4e7;
    --text-muted: #8b8d97;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Loading bar (top progress bar) ────────────────────── */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary), 0 0 5px var(--primary);
    z-index: 10000;
    transition: width 0.3s ease-out;
    opacity: 0;
    pointer-events: none;
}
.loading-bar.loading {
    opacity: 1;
}

/* ── Page loader overlay ───────────────────────────────── */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 23, 0.7);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}
.page-loader.visible {
    opacity: 1;
    pointer-events: all;
}

.page-loader-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.page-loader-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.page-loader-card span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    gap: 2rem;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

.nav-icon { font-size: 1.3rem; }

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text);
    background: var(--bg-input);
}

.nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.user-badge.admin { background: var(--primary); color: white; }
.user-badge.viewer { background: var(--bg-input); color: var(--text-muted); }

.btn-logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-logout:hover { color: var(--danger); }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.info .stat-value { color: var(--info); }

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Sync bar */
.sync-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Forms & inputs */
input[type="text"], input[type="date"], input[type="password"], select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover { background: var(--primary-hover); }

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-warning { background: var(--warning); }
.btn-warning:hover { background: #d97706; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }

.btn-full { width: 100%; }

.btn-primary { background: var(--primary); }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.data-table td {
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table tr:hover td {
    background: rgba(59, 130, 246, 0.05);
}

/* Badges */
.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.entry { background: rgba(34,197,94,0.15); color: var(--success); }
.badge.exit { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge.admin { background: rgba(59,130,246,0.15); color: var(--primary); }
.badge.viewer { background: rgba(139,141,151,0.15); color: var(--text-muted); }
.badge.active { background: rgba(34,197,94,0.15); color: var(--success); }
.badge.inactive { background: rgba(239,68,68,0.15); color: var(--danger); }

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
}

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

.login-icon { font-size: 3rem; }

.login-header h1 {
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-group input {
    padding: 0.75rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: var(--danger);
}

/* QR */
.qr-container {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
}

.qr-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
}

.qr-user {
    color: var(--text-muted);
    margin: 0.5rem 0 1rem;
}

.qr-image {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    display: inline-block;
    margin: 1rem 0;
}

.qr-image img { width: 200px; height: 200px; }

.qr-secret {
    margin: 1rem 0;
}

.qr-secret code {
    display: block;
    background: var(--bg-input);
    padding: 0.5rem;
    border-radius: var(--radius);
    margin-top: 0.25rem;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    user-select: all;
}

/* Report cards */
.report-employee {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.report-employee-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    font-weight: 600;
}

.report-total {
    color: var(--primary);
    font-size: 0.9rem;
}

/* Input with domain suffix */
.input-with-domain {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.input-with-domain input {
    border: none;
    background: transparent;
    flex: 1;
    border-radius: 0;
}

.input-with-domain input:focus {
    border: none;
    outline: none;
}

.domain-suffix {
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    border-left: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
}

.alert-success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: var(--success);
}

/* Add user form */
.add-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Employee link */
.emp-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.emp-link:hover { text-decoration: underline; }

.btn-edit {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
    margin-left: 4px;
}
.btn-edit:hover { color: var(--primary); }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 320px;
}

/* Employee detail */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}
.back-link:hover { color: var(--primary); }

.detail-id {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.detail-summary {
    display: flex;
    gap: 1.5rem;
}

.summary-item {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hours-short { color: var(--danger); font-weight: 600; }
.hours-ok { color: var(--success); font-weight: 600; }

.row-weekend td { opacity: 0.6; }
.row-short td { background: rgba(239,68,68,0.05); }

.stat-card.danger .stat-value { color: var(--danger); }

.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.text-late { color: var(--warning); }
.text-early { color: var(--warning); }

.late-badge, .early-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 600;
}
.late-badge { background: rgba(245,158,11,0.15); color: var(--warning); }
.early-badge { background: rgba(245,158,11,0.15); color: var(--warning); }

.obs-late, .obs-early, .obs-extra, .obs-debe {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
    font-weight: 600;
}
.obs-late { background: rgba(245,158,11,0.15); color: var(--warning); }
.obs-early { background: rgba(245,158,11,0.15); color: var(--warning); }
.obs-extra { background: rgba(34,197,94,0.15); color: var(--success); }
.obs-debe { background: rgba(239,68,68,0.15); color: var(--danger); }

.form-row {
    display: flex;
    gap: 1rem;
}
.form-row .form-group { flex: 1; }

/* Sortable columns */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 18px !important;
}

.sortable:hover { color: var(--text); }

.sortable::after {
    content: '⇅';
    position: absolute;
    right: 4px;
    font-size: 0.7rem;
    opacity: 0.3;
}

.sortable.sort-asc::after { content: '▲'; opacity: 0.8; }
.sortable.sort-desc::after { content: '▼'; opacity: 0.8; }

.actions-cell {
    display: flex;
    gap: 4px;
}

/* Week calendar */
.week-calendars {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.week-calendar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    min-width: 280px;
    flex: 1;
}

.week-cal-header {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 0.75rem;
}

.week-cal-days {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: flex-end;
    height: 120px;
}

.week-cal-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.week-cal-day.weekend { opacity: 0.5; }

.day-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.day-bar-container {
    width: 100%;
    height: 80px;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.day-bar-expected {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(59,130,246,0.1);
    border: 1px dashed rgba(59,130,246,0.3);
    border-radius: 3px;
}

.day-bar-worked {
    width: 100%;
    border-radius: 3px;
    position: relative;
    z-index: 1;
    min-height: 2px;
    transition: height 0.3s;
}

.bar-ok { background: var(--success); }
.bar-over { background: var(--success); }
.bar-under { background: var(--warning); }

.day-hours {
    font-size: 0.7rem;
    margin-top: 4px;
    color: var(--text-muted);
}

.day-flag {
    font-size: 0.6rem;
    font-weight: 700;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.day-flag.late { background: rgba(245,158,11,0.2); color: var(--warning); }

.week-cal-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

/* Sections */
.section { margin-bottom: 1.5rem; }

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.present-title { color: var(--success); }
.left-title { color: var(--text-muted); }
.absent-title { color: var(--danger); }
.late-title { color: var(--warning); }

/* People grid */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
}

.person-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s;
    border-left: 3px solid var(--success);
}

.person-card:hover { border-color: var(--primary); }

.person-late { border-left-color: var(--warning); }
.person-left { border-left-color: var(--text-muted); opacity: 0.7; }
.person-absent { border-left-color: var(--danger); opacity: 0.5; }

.person-initial {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    flex-shrink: 0;
}

.person-info { min-width: 0; }

.person-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-dept {
    font-size: 0.7rem;
    color: var(--primary);
    opacity: 0.7;
}

.person-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
}

.badge.warning-badge {
    background: rgba(245,158,11,0.15);
    color: var(--warning);
}

/* Terminal */
.terminal {
    background: #0d1117;
    border-radius: 12px;
    border: 1px solid #21262d;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.terminal-header {
    background: #161b22;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #21262d;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
    color: #8b949e;
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-left: 8px;
}

.terminal-body {
    padding: 16px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    max-height: 70vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.term-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.term-line.system { color: #8b949e; }
.term-line.entry { color: #e4e4e7; }
.term-line.exit { color: #8b949e; }
.term-line.error { color: #ff7b72; }

.term-ts { color: #6e7681; }

.term-icon {
    font-weight: 700;
}

.term-line.entry .term-icon { color: #3fb950; }
.term-line.exit .term-icon { color: #f0883e; }

.term-action {
    font-weight: 600;
    min-width: 60px;
    display: inline-block;
}

.term-line.entry .term-action { color: #3fb950; }
.term-line.exit .term-action { color: #f0883e; }

.term-name { color: #e4e4e7; font-weight: 500; }

.live-dot {
    width: 8px;
    height: 8px;
    background: #3fb950;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Shifts grid */
.shifts-grid {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.sg-header {
    display: grid;
    grid-template-columns: 120px repeat(7, 1fr);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
}

.sg-corner { padding: 10px; }

.sg-day-header {
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-left: 1px solid var(--border);
}

.sg-row {
    display: grid;
    grid-template-columns: 120px repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
}

.sg-row:last-child { border-bottom: none; }

.sg-shift-label {
    padding: 12px 10px;
    background: var(--bg-input);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sg-shift-name { font-weight: 600; font-size: 0.85rem; }
.sg-shift-time { font-size: 0.7rem; color: var(--text-muted); }

.sg-cell {
    min-height: 70px;
    padding: 6px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.15s;
}

.sg-cell-hover { background: rgba(59,130,246,0.1); }

.sg-employee {
    padding: 4px 8px;
    background: var(--bg-input);
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.15s, transform 0.15s;
}

.sg-employee:hover { background: var(--border); }
.sg-employee.dragging { opacity: 0.4; transform: scale(0.95); }

.sg-unassigned {
    border-left: 3px solid var(--text-muted);
    display: inline-block;
    margin: 0 4px 4px 0;
}

.sg-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 2px;
    line-height: 1;
}
.sg-remove:hover { color: var(--danger); }

/* Unassigned zone */
.unassigned-zone {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 1rem;
}

.unassigned-zone h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.unassigned-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Shift config */
.shift-config-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.shift-config-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

/* Device page */
.device-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.device-info-card h3 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 140px;
}

.device-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Page transitions & animations ────────────────────── */

/* Fade-in-up for page content on load */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Page container entrance */
.container {
    animation: fadeInUp 0.35s ease-out;
}

/* Stat cards stagger */
.stat-card {
    animation: fadeInUp 0.4s ease-out backwards;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }

/* Person cards stagger */
.person-card {
    animation: fadeInUp 0.3s ease-out backwards;
}
.people-grid .person-card:nth-child(1) { animation-delay: 0.03s; }
.people-grid .person-card:nth-child(2) { animation-delay: 0.06s; }
.people-grid .person-card:nth-child(3) { animation-delay: 0.09s; }
.people-grid .person-card:nth-child(4) { animation-delay: 0.12s; }
.people-grid .person-card:nth-child(5) { animation-delay: 0.15s; }
.people-grid .person-card:nth-child(6) { animation-delay: 0.18s; }
.people-grid .person-card:nth-child(7) { animation-delay: 0.21s; }
.people-grid .person-card:nth-child(8) { animation-delay: 0.24s; }
.people-grid .person-card:nth-child(n+9) { animation-delay: 0.27s; }

/* Table rows entrance */
.data-table tbody tr {
    animation: fadeIn 0.3s ease-out backwards;
}
.data-table tbody tr:nth-child(1) { animation-delay: 0.02s; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.04s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.08s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.1s; }
.data-table tbody tr:nth-child(n+6) { animation-delay: 0.12s; }

/* Section titles slide in */
.section-title {
    animation: slideInLeft 0.4s ease-out;
}

/* Sync bar slide in */
.sync-bar {
    animation: slideInRight 0.4s ease-out;
}

/* Modal entrance */
.modal {
    animation: fadeIn 0.2s ease-out;
}
.modal-content {
    animation: scaleIn 0.25s ease-out;
}

/* Login card */
.login-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Terminal entrance */
.terminal {
    animation: fadeInUp 0.4s ease-out;
}

/* Terminal lines appear */
.term-line {
    animation: fadeIn 0.15s ease-out;
}

/* Week calendar cards */
.week-calendar {
    animation: fadeInUp 0.4s ease-out backwards;
}
.week-calendars .week-calendar:nth-child(1) { animation-delay: 0.05s; }
.week-calendars .week-calendar:nth-child(2) { animation-delay: 0.1s; }
.week-calendars .week-calendar:nth-child(3) { animation-delay: 0.15s; }
.week-calendars .week-calendar:nth-child(n+4) { animation-delay: 0.2s; }

/* Shifts grid */
.shifts-grid {
    animation: fadeInUp 0.4s ease-out;
}

/* Smooth hover transitions on interactive elements */
.person-card {
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.person-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.stat-card {
    transition: transform 0.15s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* Nav link active indicator with transition */
.nav-links a {
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s, left 0.2s;
    border-radius: 1px;
}
.nav-links a:hover::after, .nav-links a.active::after {
    width: 70%;
    left: 15%;
}

/* Badge pulse on new items */
@keyframes subtlePulse {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50% { box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
}

.badge.entry { animation: subtlePulse 2s ease-in-out 1; }

/* Device info card */
.device-info-card {
    animation: fadeInUp 0.4s ease-out backwards;
}

/* Alert banner slide */
.alert {
    animation: slideInRight 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    .nav-links { order: 3; width: 100%; }
    .nav-links a { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filters { flex-direction: column; }
    .filter-group { width: 100%; }
    .filter-group input, .filter-group select { width: 100%; }
}
