/* CSS Design System for TI Asistencia */
:root {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-active: #3b82f6;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #ffffff;
    --border-color: #e2e8f0;
    
    /* Harmonious State Colors */
    --color-present: #10b981;
    --color-present-bg: #ecfdf5;
    
    --color-home: #3b82f6;
    --color-home-bg: #eff6ff;
    
    --color-guard: #8b5cf6;
    --color-guard-bg: #f5f3ff;
    
    --color-vacation: #f59e0b;
    --color-vacation-bg: #fffbeb;
    
    --color-rest: #64748b;
    --color-rest-bg: #f1f5f9;
    
    --color-absence: #ef4444;
    --color-absence-bg: #fef2f2;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* --- App Layout Structure --- */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 24px;
    background-color: var(--bg-primary);
    min-height: 100vh;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Sidebar Toggle System --- */
.sidebar-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background-color: var(--bg-card);
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background-color: #f1f5f9;
}

/* Collapsed Desktop State */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}

/* --- Sidebar --- */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 24px 12px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 24px;
}

.logo svg {
    color: var(--sidebar-active);
    width: 32px;
    height: 32px;
}

.logo-text h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-text p {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-links li a:hover {
    background-color: #1e293b;
    color: var(--text-light);
}

.nav-links li.active a {
    background-color: var(--sidebar-active);
    color: var(--text-light);
}

.nav-links li a svg {
    width: 20px;
    height: 20px;
}

/* Sidebar Rocket Promotion Box */
.sidebar-promo {
    margin-top: auto;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    border: 1px solid #2563eb;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sidebar-promo img, .sidebar-promo svg.promo-rocket {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 6px rgba(59, 130, 246, 0.5));
}

.sidebar-promo h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.sidebar-promo p {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

/* --- Top Header --- */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.header-title p {
    font-size: 12px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-switch {
    display: flex;
    background-color: #e2e8f0;
    padding: 4px;
    border-radius: 9999px;
    gap: 4px;
}

.theme-btn {
    border: none;
    background: none;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.theme-btn.active {
    background-color: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-btn svg {
    width: 16px;
    height: 16px;
}

.icon-badge {
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-muted);
}

.icon-badge svg {
    width: 24px;
    height: 24px;
}

.icon-badge .badge-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--color-absence);
    color: var(--text-light);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.user-profile-widget img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.user-info-text {
    text-align: left;
}

.user-info-text .user-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.user-info-text .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Stat Cards --- */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-info .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-info .stat-subtext {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.stat-info .stat-subtext:hover {
    text-decoration: underline;
}

/* Stat colors */
.stat-total .stat-icon { background-color: #eff6ff; color: #3b82f6; }
.stat-present .stat-icon { background-color: #ecfdf5; color: #10b981; }
.stat-home .stat-icon { background-color: #fef3c7; color: #f59e0b; }
.stat-guard .stat-icon { background-color: #f5f3ff; color: #8b5cf6; }
.stat-absence .stat-icon { background-color: #fef2f2; color: #ef4444; }

/* --- Main Panels (Cards) --- */
.card-panel {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
}

.card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title-bar h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

/* --- Calendar Component --- */
.calendar-view {
    width: 100%;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cal-nav-buttons {
    display: flex;
    gap: 8px;
}

.cal-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background-color: #fff;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 4px;
}

.cal-btn:hover {
    background-color: #f8fafc;
}

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
}

.calendar-grid th {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 0;
    text-transform: uppercase;
}

.calendar-grid td {
    width: 14.28%;
    height: 54px;
    border: 1px solid var(--border-color);
    text-align: right;
    vertical-align: top;
    padding: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    position: relative;
}

.calendar-grid td.empty {
    background-color: #f8fafc;
}

.calendar-grid td.is-today {
    background-color: #eff6ff;
    border: 2px solid var(--sidebar-active);
}

/* Mini dots and state indicators in calendar */
.calendar-grid td::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: none;
}

.calendar-grid td.status-present::after { display: block; background-color: var(--color-present); }
.calendar-grid td.status-home-office::after { display: block; background-color: var(--color-home); }
.calendar-grid td.status-guard::after { display: block; background-color: var(--color-guard); }
.calendar-grid td.status-vacation::after { display: block; background-color: var(--color-vacation); }
.calendar-grid td.status-rest::after { display: block; background-color: var(--color-rest); }
.calendar-grid td.status-absence::after { display: block; background-color: var(--color-absence); }

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Legend items colors */
.color-presencial { background-color: var(--color-present); }
.color-home-office { background-color: var(--color-home); }
.color-guardia { background-color: var(--color-guard); }
.color-vacaciones { background-color: var(--color-vacation); }
.color-descanso { background-color: var(--color-rest); }
.color-falta { background-color: var(--color-absence); }

/* --- Estatus de Hoy (Right Column Widget) --- */
.status-today-card {
    text-align: center;
}

.today-time-display {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 20px 0;
}

.circular-status-bar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
}

/* Success status bar circle */
.circular-status-bar.green-circle {
    background: radial-gradient(white 55%, transparent 56%),
                conic-gradient(var(--color-present) 100%, #e2e8f0 0);
    border: 1px solid var(--border-color);
}

.circular-status-bar.orange-circle {
    background: radial-gradient(white 55%, transparent 56%),
                conic-gradient(#e2e8f0 100%, #e2e8f0 0);
    border: 1px solid var(--border-color);
}

.circle-icon-center {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-present-bg);
    color: var(--color-present);
}

.circle-icon-center.pending {
    background-color: #f1f5f9;
    color: var(--text-muted);
}

.circle-icon-center svg {
    width: 40px;
    height: 40px;
}

.status-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.status-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.clock-logs-mini {
    width: 100%;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clock-log-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
}

.clock-log-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #334155;
}

.clock-log-label svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.clock-log-val {
    font-weight: 700;
    color: var(--color-present);
    background-color: var(--color-present-bg);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.clock-log-val.empty {
    color: var(--text-muted);
    background-color: #f1f5f9;
    font-weight: 500;
}

.btn-primary {
    display: block;
    width: 100%;
    background-color: var(--sidebar-active);
    color: var(--text-light);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-primary-outline {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid var(--sidebar-active);
    color: var(--sidebar-active);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary-outline:hover {
    background-color: var(--color-home-bg);
}

/* --- Acciones Rapidas Widget --- */
.quick-actions-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    color: #334155;
    transition: all 0.2s;
    width: 100%;
}

.quick-action-btn:hover {
    transform: translateX(4px);
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.quick-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-btn svg {
    width: 20px;
    height: 20px;
}

.qa-clock .quick-action-icon { background-color: #ecfdf5; color: #10b981; }
.qa-home .quick-action-icon { background-color: #eff6ff; color: #3b82f6; }
.qa-vacation .quick-action-icon { background-color: #fffbeb; color: #f59e0b; }
.qa-absence .quick-action-icon { background-color: #fef2f2; color: #ef4444; }
.qa-calendar .quick-action-icon { background-color: #f5f3ff; color: #8b5cf6; }

/* --- Team Status Component (Table Layout) --- */
.team-table {
    width: 100%;
    border-collapse: collapse;
}

.team-table th {
    text-align: left;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.team-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12.5px;
}

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

.employee-row-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.employee-row-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.emp-name-title {
    font-weight: 600;
    color: #0f172a;
}

.emp-position-title {
    font-size: 11px;
    color: var(--text-muted);
}

/* Status & Location badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-presente { background-color: var(--color-present-bg); color: var(--color-present); }
.badge-presente::before { background-color: var(--color-present); }

.badge-home-office { background-color: var(--color-home-bg); color: var(--color-home); }
.badge-home-office::before { background-color: var(--color-home); }

.badge-guardia { background-color: var(--color-guard-bg); color: var(--color-guard); }
.badge-guardia::before { background-color: var(--color-guard); }

.badge-vacaciones { background-color: var(--color-vacation-bg); color: var(--color-vacation); }
.badge-vacaciones::before { background-color: var(--color-vacation); }

.badge-descanso { background-color: var(--color-rest-bg); color: var(--color-rest); }
.badge-descanso::before { background-color: var(--color-rest); }

.badge-falta { background-color: var(--color-absence-bg); color: var(--color-absence); }
.badge-falta::before { background-color: var(--color-absence); }

.badge-remoto { background-color: #f1f5f9; color: #475569; }
.badge-remoto::before { background-color: #94a3b8; }

.badge-oficina { background-color: #f0fdf4; color: #166534; }
.badge-oficina::before { background-color: #22c55e; }

.badge-api { background-color: #faf5ff; color: #6b21a8; }
.badge-api::before { background-color: #a855f7; }

.badge-sitio { background-color: #fff7ed; color: #c2410c; }
.badge-sitio::before { background-color: #ea580c; }

/* --- Monthly Summary Donut Chart Widget --- */
.summary-widget {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: space-around;
}

.summary-chart-container {
    width: 140px;
    height: 140px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-center-text {
    position: absolute;
    text-align: center;
}

.chart-center-text .chart-month {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.chart-center-text .chart-year {
    font-size: 11px;
    color: var(--text-muted);
}

.chart-legend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}

.chart-legend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 160px;
}

.chart-legend-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.chart-legend-percent {
    font-weight: 700;
    color: #0f172a;
}

/* --- Common Forms & Views --- */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #334155;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-danger {
    background-color: var(--color-absence);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Alert Boxes */
.alert-box {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background-color: var(--color-present-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: var(--color-absence-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Data Tables */
.data-table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.data-table th {
    background-color: #f1f5f9;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

/* --- APK Integration Document & Simulator UI --- */
.api-spec-card {
    background-color: #fafafa;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-x: auto;
}

.sim-output-panel {
    background-color: #0f172a;
    color: #38bdf8;
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    padding: 16px;
    border-radius: 8px;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #334155;
    margin-top: 12px;
}

/* --- Login Page specific styles --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0f172a;
    min-height: 100vh;
    width: 100vw;
}

.login-card {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header svg {
    color: var(--sidebar-active);
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Grid Filter System */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) 120px;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 24px;
}

/* --- Responsive CSS --- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    body.sidebar-active .sidebar {
        transform: translateX(0);
    }
    
    .top-header {
        flex-wrap: wrap;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* --- Live Tracking Panel --- */
.live-tracking-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.live-tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.live-tracking-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-indicator-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    animation: live-blink 1.2s infinite;
}

@keyframes live-blink {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.live-tracking-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.live-tracking-empty svg {
    color: var(--color-present);
    width: 40px;
    height: 40px;
    opacity: 0.8;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.live-item-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.live-item-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.live-user-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.live-user-name {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
}

.live-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.live-status-text {
    font-size: 12px;
    color: #334155;
    background-color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Road/Transit Animation */
.transit-animation-container {
    height: 32px;
    position: relative;
    background-color: #f1f5f9;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.transit-line {
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(to right, #94a3b8 0, #94a3b8 4px, transparent 4px, transparent 8px);
    position: relative;
}

.transit-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-home);
    animation: move-transit-icon 8s infinite linear;
}

@keyframes move-transit-icon {
    0% { left: 0%; }
    100% { left: 85%; }
}

.transit-destination-pin {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-absence);
    animation: pin-bounce 1s infinite alternate;
}

@keyframes pin-bounce {
    0% { transform: translateY(-50%) translateY(-2px); }
    100% { transform: translateY(-50%) translateY(2px); }
}

/* Radar Working Animation */
.working-animation-container {
    height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 0 10px;
}

.radar-signal {
    position: relative;
    width: 12px;
    height: 12px;
    background-color: var(--color-present);
    border-radius: 50%;
}

.radar-signal::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--color-present);
    animation: radar-wave 1.5s infinite linear;
    opacity: 0;
}

@keyframes radar-wave {
    0% { transform: scale(0.2); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 0; }
}

.working-badge-text {
    font-size: 11px;
    font-weight: 600;
    color: #065f46;
}

/* --- Employee Dashboard layout --- */
.employee-dashboard-container {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

/* --- Unified User Avatar Icon --- */
.user-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0284c7;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-avatar-placeholder svg {
    width: 55%;
    height: 55%;
    stroke: currentColor;
}

/* Sizing overrides */
.user-profile-widget .user-avatar-placeholder {
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.live-user-avatar.user-avatar-placeholder {
    width: 36px;
    height: 36px;
}

.employee-row-info .user-avatar-placeholder {
    width: 36px;
    height: 36px;
}

