/* PresenSync Light & Emerald-Navy Design System */
:root {
    --primary-dark: #0f172a;
    --primary-navy: #1e3a8a;
    --kinetic-yellow: #129b78;
    --accent-teal: #129b78;
    --accent-teal-dark: #0e7c60;
    --surface-bg: #f4f7fa;
    --surface-card: #ffffff;
    --text-primary: #172b4d;
    --text-muted: #64748b;
    --border-subtle: #e5ecf4;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--surface-bg);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

.display-font {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 268px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0.65rem 1.15rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.85rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary-dark);
}

.sidebar-brand .brand-accent {
    color: var(--accent-teal);
}

.sidebar-brand small {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    font-weight: 700;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.nav-heading {
    margin: 0.95rem 0.65rem 0.35rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #94a3b8;
}

.nav-item { width: 100%; }

.nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.62rem 0.8rem;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.nav-link i {
    width: 18px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--primary-dark);
}

.nav-link.active {
    background: linear-gradient(135deg, #0f766e, #129b78);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(18, 155, 120, 0.22);
}

.nav-link.active i { color: #ffffff; }

.sidebar-footer {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

.logout-link {
    color: #b91c1c;
}
.logout-link i { color: #ef4444; }
.logout-link:hover { background: #fef2f2; color: #991b1b; }

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-content > header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.95rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.breadcrumb-sep { opacity: 0.5; }

.header-left h1 {
    margin: 0;
    font-size: 1.32rem;
    color: var(--primary-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.78rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #065f46;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid #a7f3d0;
}

.status-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.user-meta { text-align: right; }
.user-name { font-size: 0.84rem; font-weight: 700; color: var(--primary-dark); }
.user-role { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }

.user-badge img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
}

.content {
    padding: 1.5rem 1.75rem 2.5rem;
}

/* Cards & Buttons */
.glass-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow-sm);
}

.btn-kinetic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.15rem;
    border-radius: 10px;
    background: var(--accent-teal);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(18, 155, 120, 0.2);
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn-kinetic:hover {
    background: var(--accent-teal-dark);
    transform: translateY(-1px);
    color: #ffffff;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.26rem 0.62rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-present { background: #E6F6EC; color: #1DB173; }
.status-late { background: #FFF4E6; color: #705D00; }
.status-absent { background: #FDECEC; color: #BA1A1A; }

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

.stat-tile {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow-sm);
}

.stat-tile-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.stat-tile-value {
    margin-top: 0.35rem;
    font-family: 'Manrope', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.data-table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.data-table th {
    text-align: left;
    padding: 0.72rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.data-table td {
    padding: 0.78rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: 0; }

.form-input, .form-select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d5e0ec;
    border-radius: 9px;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-family: inherit;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(18, 155, 120, 0.12);
}

.alert-banner {
    padding: 0.85rem 1rem;
    border-radius: 11px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* Pagination Styling */
.pagination-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}
.pagination-container svg { width: 1.25rem !important; height: 1.25rem !important; }
.pagination-container a,
.pagination-container span[aria-current="page"] > span,
.pagination-container span[aria-disabled="true"] > span {
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pagination-container a { color: var(--text-muted); background: #f1f3f5; }
.pagination-container span[aria-current="page"] > span { background: var(--accent-teal); color: #fff; }
.pagination-info { font-size: 0.84rem; color: var(--text-muted); }

.password-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-field-wrap .form-input,
.password-field-wrap .form-control {
    padding-right: 2.65rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--text-muted, #64748b);
    width: 2rem;
    height: 2rem;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.password-toggle-btn:hover {
    background: rgba(15, 118, 110, 0.1);
    color: var(--accent-teal, #0f766e);
}

.password-secret-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    padding: 0.22rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.password-secret-btn:hover {
    background: #e2e8f0;
}

@media (max-width: 960px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
}
