/* ============================================================
   NovaSuite ERP — Global Stylesheet
   ============================================================ */

:root {
    --erp-bg: #f0f4f8;
    --erp-surface: rgba(255, 255, 255, 0.9);
    --erp-surface-strong: #ffffff;
    --erp-border: rgba(14, 165, 233, 0.14);
    --erp-text: #0f172a;
    --erp-muted: #64748b;
    --erp-primary: #0ea5e9;
    --erp-primary-dark: #0284c7;
    --erp-accent: #06b6d4;
    --erp-sidebar: #0f172a;
    --erp-shadow: 0 4px 24px rgba(15, 23, 42, 0.09);
    --erp-shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.13);
    --erp-radius: 18px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'IBM Plex Sans', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.07), transparent 28%),
        radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.05), transparent 32%),
        var(--erp-bg);
    color: var(--erp-text);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.erp-brand-wordmark, .erp-page-title, .auth-hero-title,
.metric-value, .info-box-number, .small-box .inner h4,
.module-title, .auth-card-brand-name, .auth-hero-card strong {
    font-family: 'Manrope', sans-serif;
}

a { color: var(--erp-primary); }
a:hover { color: var(--erp-primary-dark); text-decoration: none; }

/* ── Shell Layout ─────────────────────────────────────────── */
.erp-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.erp-sidebar {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent 24%),
        linear-gradient(180deg, #0f172a 0%, #060c1a 100%);
    color: #f7efe8;
    padding: 20px 14px 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.erp-sidebar::-webkit-scrollbar { width: 4px; }
.erp-sidebar::-webkit-scrollbar-track { background: transparent; }
.erp-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.erp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 12px;
}
.erp-brand-logo { height: 42px; width: auto; border-radius: 8px; flex-shrink: 0; background: #fff; padding: 3px; }
.erp-brand-wordmark { font-size: 0.95rem; font-weight: 800; letter-spacing: 0.02em; }
.erp-brand-subtitle { color: rgba(247,239,232,0.65); font-size: 0.76rem; }

/* Sidebar nav groups */
.erp-nav-group { margin-top: 6px; }

.erp-nav-section {
    margin: 16px 0 6px;
    padding: 0 8px;
    color: rgba(247,239,232,0.48);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.erp-nav-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: color 0.16s ease;
}
.erp-nav-section-toggle:hover { color: rgba(247,239,232,0.9); }

.erp-nav-caret {
    font-size: 0.68rem;
    opacity: 0.7;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.erp-nav {
    display: grid;
    gap: 2px;
    padding: 0;
    margin: 0;
    list-style: none;
    max-height: 1400px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.22s ease, opacity 0.18s ease;
}

.erp-sidebar.is-initializing .erp-nav,
.erp-sidebar.is-initializing .erp-nav-caret { transition: none !important; }

.erp-nav-group.is-collapsed .erp-nav { max-height: 0; opacity: 0; pointer-events: none; }
.erp-nav-group.is-collapsed .erp-nav-caret { transform: rotate(-90deg); opacity: 0.9; }

.erp-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 11px;
    color: rgba(247,239,232,0.74);
    font-size: 0.86rem;
    transition: all 0.14s ease;
}
.erp-nav-link i { width: 16px; text-align: center; flex-shrink: 0; font-size: 0.8rem; opacity: 0.85; }
.erp-nav-link:hover, .erp-nav-link.active {
    background: linear-gradient(90deg, rgba(14,165,233,0.26), rgba(14,165,233,0.08));
    color: #e0f2fe;
}
.erp-nav-link.active { font-weight: 600; }

/* Module-colored active states in sidebar */
.erp-nav-group[data-nav-group="hr-payroll"] .erp-nav-link.active {
    background: linear-gradient(90deg, rgba(234,88,12,0.26), rgba(234,88,12,0.08));
}
.erp-nav-group[data-nav-group="finance"] .erp-nav-link.active {
    background: linear-gradient(90deg, rgba(22,163,74,0.26), rgba(22,163,74,0.08));
}
.erp-nav-group[data-nav-group="academics"] .erp-nav-link.active {
    background: linear-gradient(90deg, rgba(124,58,237,0.26), rgba(124,58,237,0.08));
}
.erp-nav-group[data-nav-group="reporting"] .erp-nav-link.active {
    background: linear-gradient(90deg, rgba(8,145,178,0.26), rgba(8,145,178,0.08));
}

/* ── Main Area ────────────────────────────────────────────── */
.erp-main { min-width: 0; display: flex; flex-direction: column; }

/* ── Sticky Topbar ────────────────────────────────────────── */
.erp-topbar-wrapper {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(240,244,248,0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(14,165,233,0.1);
    padding: 10px 24px;
}
.erp-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.erp-topbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }

.erp-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 35;
}

.erp-sidebar-toggle {
    display: none;
    border: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--erp-surface-strong);
    box-shadow: 0 2px 8px rgba(15,23,42,0.08);
    color: var(--erp-text);
    cursor: pointer;
}
.erp-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
    border: 1px solid var(--erp-border);
    color: var(--erp-muted);
    font-size: 0.82rem;
}
.erp-userbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px 5px 14px;
    border-radius: 999px;
    background: var(--erp-surface-strong);
    box-shadow: 0 2px 12px rgba(15,23,42,0.08);
}
.erp-topbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: 1px solid var(--erp-border);
    color: var(--erp-text);
    background: rgba(248,250,252,0.9);
    text-decoration: none;
}
.erp-topbar-bell:hover { color: var(--erp-primary-dark); background: rgba(14,165,233,0.08); }
.erp-topbar-badge {
    position: absolute;
    top: -4px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--erp-primary);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
}
.erp-topbar-dropdown {
    min-width: 300px;
    max-width: 340px;
    padding: 0;
    border: 1px solid var(--erp-border);
    border-radius: 16px;
    box-shadow: var(--erp-shadow-lg);
    overflow: hidden;
}
.erp-topbar-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(248,250,252,0.95);
    border-bottom: 1px solid var(--erp-border);
    font-size: 0.9rem;
}
.erp-topbar-dropdown-list { max-height: 300px; overflow-y: auto; }
.erp-topbar-item { display: block; padding: 10px 16px; border-bottom: 1px solid rgba(100,116,139,0.1); color: var(--erp-text); }
.erp-topbar-item:last-child { border-bottom: 0; }
.erp-topbar-item:hover { background: rgba(14,165,233,0.05); color: var(--erp-primary-dark); }
.erp-topbar-item-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; margin-bottom: 2px; font-size: 0.88rem; }
.erp-topbar-item-copy { font-size: 0.83rem; color: var(--erp-muted); line-height: 1.35; }
.erp-topbar-item-time { font-size: 0.72rem; color: var(--erp-muted); margin-top: 3px; }

.erp-userbar-meta { line-height: 1.15; text-align: right; }
.erp-userbar-name { font-weight: 700; font-size: 0.88rem; }
.erp-userbar-role { color: var(--erp-muted); font-size: 0.76rem; text-transform: capitalize; }

/* ── Content Area ─────────────────────────────────────────── */
.erp-content { flex: 1; min-width: 0; padding: 22px 24px; }

.erp-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.erp-page-title { font-size: clamp(1.45rem, 2vw, 1.9rem); font-weight: 800; margin: 0; }
.erp-page-subtitle { margin-top: 4px; color: var(--erp-muted); max-width: 600px; font-size: 0.88rem; }

/* ── Module Sub-Navigation ────────────────────────────────── */
.module-subnav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 10px;
    margin-bottom: 20px;
    background: var(--erp-surface-strong);
    border: 1px solid var(--erp-border);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(15,23,42,0.055);
    overflow-x: auto;
    scrollbar-width: none;
}
.module-subnav::-webkit-scrollbar { display: none; }

.module-subnav-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px 5px 9px;
    border-radius: 9px;
    color: #fff;
    font-weight: 800;
    font-size: 0.7rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    flex-shrink: 0;
    margin-right: 6px;
}
.module-subnav-label i { font-size: 0.75rem; }

.module-subnav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--erp-muted);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.13s ease;
    border: 1px solid transparent;
    text-decoration: none;
    flex-shrink: 0;
}
.module-subnav-item i { font-size: 0.72rem; flex-shrink: 0; }
.module-subnav-item:hover {
    background: rgba(14,165,233,0.07);
    color: var(--erp-primary-dark);
    border-color: rgba(14,165,233,0.18);
    text-decoration: none;
}

/* HR & Payroll module colors */
.module-subnav--hr .module-subnav-label { background: linear-gradient(135deg, #fb923c, #ea580c); }
.module-subnav--hr .module-subnav-item.is-active {
    background: rgba(234,88,12,0.1);
    color: #c2410c;
    border-color: rgba(234,88,12,0.22);
    font-weight: 700;
}
.module-subnav--hr .module-subnav-item:hover { background: rgba(234,88,12,0.07); color: #c2410c; border-color: rgba(234,88,12,0.18); }

/* Finance module colors */
.module-subnav--finance .module-subnav-label { background: linear-gradient(135deg, #4ade80, #16a34a); }
.module-subnav--finance .module-subnav-item.is-active {
    background: rgba(22,163,74,0.1);
    color: #15803d;
    border-color: rgba(22,163,74,0.22);
    font-weight: 700;
}
.module-subnav--finance .module-subnav-item:hover { background: rgba(22,163,74,0.07); color: #15803d; border-color: rgba(22,163,74,0.18); }

/* Academics module colors */
.module-subnav--academics .module-subnav-label { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.module-subnav--academics .module-subnav-item.is-active {
    background: rgba(124,58,237,0.1);
    color: #6d28d9;
    border-color: rgba(124,58,237,0.22);
    font-weight: 700;
}
.module-subnav--academics .module-subnav-item:hover { background: rgba(124,58,237,0.07); color: #6d28d9; border-color: rgba(124,58,237,0.18); }

/* Reports module colors */
.module-subnav--reports .module-subnav-label { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.module-subnav--reports .module-subnav-item.is-active {
    background: rgba(8,145,178,0.1);
    color: #0e7490;
    border-color: rgba(8,145,178,0.22);
    font-weight: 700;
}
.module-subnav--reports .module-subnav-item:hover { background: rgba(8,145,178,0.07); color: #0e7490; border-color: rgba(8,145,178,0.18); }

/* ── Cards ────────────────────────────────────────────────── */
.erp-surface, .card, .info-box, .small-box {
    background: var(--erp-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    box-shadow: var(--erp-shadow);
}
.card { overflow: hidden; margin-bottom: 22px; }
.card-header, .card-footer {
    background: rgba(248,250,252,0.55);
    border-color: rgba(100,116,139,0.1);
    padding: 13px 20px;
}
.card-body { padding: 20px; }
.card-title { font-weight: 700; margin: 0; font-size: 0.92rem; }
.card-tools { display: flex; align-items: center; gap: 8px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
    border: 0;
    border-radius: 13px;
    box-shadow: 0 3px 14px rgba(15,23,42,0.07);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.alert::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.92rem;
    flex-shrink: 0;
}
.alert-success {
    background: linear-gradient(135deg, rgba(6,182,212,0.12), rgba(14,165,233,0.07));
    border-left: 4px solid var(--erp-accent) !important;
    color: #0e7490;
}
.alert-success::before { content: '\f058'; color: var(--erp-accent); }
.alert-danger {
    background: linear-gradient(135deg, rgba(220,38,38,0.08), rgba(239,68,68,0.05));
    border-left: 4px solid #ef4444 !important;
    color: #991b1b;
}
.alert-danger::before { content: '\f071'; color: #ef4444; }
.alert .close {
    margin-left: auto;
    padding: 0 0 0 12px;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.alert .close:hover { opacity: 1; }

/* ── Tables ───────────────────────────────────────────────── */
.table { margin-bottom: 0; color: var(--erp-text); width: 100%; }
.table thead th {
    border-top: 0;
    border-bottom: 1px solid rgba(100,116,139,0.14);
    color: var(--erp-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(248,250,252,0.45);
}
.table td, .table th { vertical-align: middle; padding: 0.875rem 1rem; border-color: rgba(100,116,139,0.08); }
.table-hover tbody tr:hover { background: rgba(14,165,233,0.035); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Forms ────────────────────────────────────────────────── */
.form-control,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"] {
    border-radius: 12px;
    min-height: 44px;
    border: 1px solid rgba(100,116,139,0.2);
    background: rgba(255,255,255,0.96);
    box-shadow: none;
}
.form-control:focus,
select:focus,
input:focus {
    border-color: rgba(14,165,233,0.6);
    box-shadow: 0 0 0 0.18rem rgba(14,165,233,0.14);
}
label { font-weight: 600; color: #334155; margin-bottom: 6px; font-size: 0.87rem; }
.text-muted, .muted { color: var(--erp-muted) !important; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    border-radius: 10px;
    font-weight: 700;
    padding: 0.58rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    vertical-align: middle;
    gap: 0.4rem;
    font-size: 0.875rem;
}
.btn-sm { padding: 0.36rem 0.78rem; font-size: 0.82rem; }
.btn i { line-height: 1; }
.btn-primary { background: linear-gradient(135deg, #38bdf8 0%, var(--erp-primary) 100%); border-color: transparent; }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #0ea5e9 0%, var(--erp-primary-dark) 100%); }
.btn-outline-primary { color: var(--erp-primary); border-color: rgba(14,165,233,0.4); }
.btn-outline-primary:hover { background: rgba(14,165,233,0.07); color: var(--erp-primary-dark); border-color: rgba(14,165,233,0.5); }
.btn-outline-secondary, .btn-default { border-color: rgba(100,116,139,0.22); color: #334155; background: rgba(255,255,255,0.75); }
.btn-outline-danger { border-color: rgba(154,54,58,0.28); }

/* ── Badges ───────────────────────────────────────────────── */
.badge { border-radius: 999px; padding: 0.36em 0.65em; font-weight: 700; font-size: 0.73rem; }
.badge-info { background: rgba(6,182,212,0.12); color: #0e7490; }
.badge-success { background: rgba(56,142,105,0.12); color: #20724f; }
.badge-warning { background: rgba(204,132,17,0.14); color: #925c08; }
.badge-secondary { background: rgba(100,116,139,0.12); color: #475569; }
.badge-danger { background: rgba(154,54,58,0.13); color: #7d2c30; }
.badge-dark { background: rgba(15,23,42,0.1); color: #1e293b; }
.badge-light { background: rgba(241,245,249,0.9); color: #475569; border: 1px solid rgba(100,116,139,0.2); }

/* ── DataTables Overrides ─────────────────────────────────── */
.dataTables_wrapper { font-size: 0.89rem; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { padding: 12px 18px 0; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
    padding: 4px 10px !important;
    font-size: 0.84rem;
    border: 1px solid rgba(100,116,139,0.2);
    background: rgba(255,255,255,0.9);
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { padding: 10px 18px 14px; }
.dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 7px !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, #38bdf8 0%, var(--erp-primary) 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(14,165,233,0.09) !important;
    border-color: transparent !important;
    color: var(--erp-primary-dark) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover { color: var(--erp-muted) !important; }
.dataTables_wrapper .dataTables_info { color: var(--erp-muted); }
table.dataTable thead th, table.dataTable thead td { border-bottom: 1px solid rgba(100,116,139,0.13); }
table.dataTable.no-footer { border-bottom: 0; }

/* ── Date Filter Bar ──────────────────────────────────────── */
.date-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    margin-bottom: 18px;
    flex-wrap: wrap;
    box-shadow: var(--erp-shadow);
}
.date-filter-bar form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.date-filter-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--erp-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.date-filter-sep { color: var(--erp-muted); font-size: 0.84rem; }
.date-filter-input {
    min-height: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
    padding: 4px 10px !important;
    font-size: 0.84rem;
    width: 140px;
    border: 1px solid rgba(100,116,139,0.2);
    background: rgba(255,255,255,0.96);
}
.date-filter-range { margin-left: auto; font-size: 0.78rem; color: var(--erp-muted); white-space: nowrap; }

.actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ── Metric Cards ─────────────────────────────────────────── */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.metric-card {
    position: relative;
    overflow: hidden;
    padding: 20px 22px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,0.97), rgba(255,255,255,0.8));
    border: 1px solid rgba(14,165,233,0.1);
    box-shadow: 0 2px 14px rgba(15,23,42,0.065);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(15,23,42,0.1); }
.metric-card::after {
    content: '';
    position: absolute;
    inset: auto -34px -34px auto;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(14,165,233,0.07);
}
.metric-label { color: var(--erp-muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.metric-value { font-size: 1.7rem; font-weight: 800; margin: 7px 0 5px; }
.metric-note { color: var(--erp-muted); margin: 0; font-size: 0.8rem; }

/* ── Module Tiles (Dashboard) ─────────────────────────────── */
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.module-tile {
    display: block;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,0.97), rgba(255,255,255,0.84));
    border: 1px solid rgba(14,165,233,0.1);
    box-shadow: 0 2px 14px rgba(15,23,42,0.065);
    color: var(--erp-text);
    min-height: 178px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.module-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(15,23,42,0.1); color: var(--erp-text); }

.module-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: #fff; margin-bottom: 15px; font-size: 1.05rem; }
.module-icon.donations { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.module-icon.payables { background: linear-gradient(135deg, #34d399, #059669); }
.module-icon.coa { background: linear-gradient(135deg, #818cf8, #4f46e5); }

.module-title { font-size: 0.98rem; font-weight: 800; margin-bottom: 7px; }
.module-copy { color: var(--erp-muted); margin-bottom: 13px; font-size: 0.855rem; line-height: 1.45; }
.module-link { font-weight: 700; color: var(--erp-primary); font-size: 0.855rem; }

/* ── Info / Small Boxes ───────────────────────────────────── */
.info-box, .small-box {
    display: flex;
    align-items: center;
    min-height: 118px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.info-box-icon, .small-box .icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.2rem;
    margin-right: 14px;
}
.bg-info, .bg-success, .bg-warning { background: transparent !important; }
.bg-info.info-box-icon,    .small-box.bg-info .icon    { background: linear-gradient(135deg, #0ea5e9, #0284c7) !important; }
.bg-success.info-box-icon, .small-box.bg-success .icon { background: linear-gradient(135deg, #2e9d73, #1f6e53) !important; }
.bg-warning.info-box-icon, .small-box.bg-warning .icon { background: linear-gradient(135deg, #d28a1e, #9d6210) !important; }
.info-box-content, .small-box .inner { flex: 1; }
.info-box-number, .small-box .inner h4 { font-size: 1.45rem; font-weight: 800; margin: 4px 0; }
.small-box-footer { font-weight: 700; }

/* ── Chart of Accounts Tree ───────────────────────────────── */
.coa-tree ul { list-style: none; padding-left: 1rem; margin: 0; }
.coa-tree li { margin: 0.28rem 0; }
.coa-node { display: inline-block; padding: 0.36rem 0.62rem; border-radius: 999px; }
.coa-node-root { background: rgba(14,165,233,0.1); color: #0369a1; font-weight: 800; }
.coa-node-group { background: rgba(6,182,212,0.12); color: #0e7490; font-weight: 700; }
.coa-node-account { background: rgba(100,116,139,0.08); color: #475569; }

/* ── Footer ───────────────────────────────────────────────── */
.erp-footer { margin-top: 22px; padding: 12px 4px 6px; color: var(--erp-muted); font-size: 0.86rem; }

/* ── Auth Screens ─────────────────────────────────────────── */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: linear-gradient(135deg, #020817 0%, #0b1535 100%); }
.auth-scene {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: rgba(255,255,255,0.98);
    border: 0;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(2,8,23,0.55);
    backdrop-filter: blur(24px);
}
.auth-hero {
    position: relative;
    padding: 42px;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.08), transparent 30%),
        radial-gradient(ellipse at bottom right, rgba(14,165,233,0.35), transparent 55%),
        linear-gradient(145deg, #020817 0%, #0c1535 45%, #1e3a8a 100%);
    color: #e0f2fe;
}
.auth-hero::after {
    content: '';
    position: absolute;
    right: -80px;
    bottom: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; }
.auth-brand-logo { height: 50px; width: auto; flex-shrink: 0; }
.auth-brand-name { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.01em; color: #fff; line-height: 1.05; }
.auth-brand-tagline { font-size: 0.76rem; color: rgba(186,230,253,0.75); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px; }

.auth-card-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid rgba(14,165,233,0.12); }
.auth-card-brand-logo { height: 62px; width: auto; }
.auth-card-brand-name { font-size: 1.4rem; font-weight: 800; color: var(--erp-text); letter-spacing: 0.01em; }
.auth-card-brand-sub { font-size: 0.76rem; color: var(--erp-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: -4px; }

.auth-hero-title { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.04; margin: 0 0 14px; font-weight: 800; }
.auth-hero-copy { color: rgba(224,242,254,0.88); max-width: 38ch; font-size: 1rem; }
.auth-hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 28px; }
.auth-hero-card { padding: 15px; border-radius: 16px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.08); }
.auth-hero-card strong { display: block; font-size: 1.15rem; }

.auth-panel { padding: 36px; display: flex; align-items: center; background: #ffffff; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; background: transparent; border: 0; box-shadow: none; }
.auth-card-header h3 { margin: 0; font-size: 1.8rem; font-weight: 800; }
.auth-card-copy { color: var(--erp-muted); margin: 9px 0 20px; }
.auth-card .form-group { margin-bottom: 15px; }
.auth-card .btn-primary { width: 100%; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-links { margin-top: 16px; color: var(--erp-muted); text-align: center; }
.form-check-input { margin-top: 0.25rem; }
.font-weight-semibold { font-weight: 700; }

/* ── Attendance page specific ─────────────────────────────── */
.attendance-filter-bar { gap: 10px; }
.attendance-toolbar-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.attendance-toolbar-main .date-filter-label { margin-bottom: 0; }
.attendance-toolbar-main .date-filter-input { width: auto; }
.attendance-employee-select { min-width: 200px; }
.attendance-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}
#attEmpPickerBtn { width: 18em; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1199px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
    .erp-shell { grid-template-columns: 1fr; }
    .erp-sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 40;
    }
    .erp-shell.sidebar-open .erp-sidebar { transform: translateX(0); }
    .erp-shell.sidebar-open .erp-sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .erp-content { padding: 16px 18px; }
    .erp-topbar-wrapper { padding: 10px 18px; }
    .erp-sidebar-toggle { display: inline-grid; place-items: center; }
    .erp-pill { max-width: 100%; }
    .erp-page-head { align-items: stretch; }
    .auth-scene { grid-template-columns: 1fr; }
    .auth-hero { order: 2; }
    .auth-panel { order: 1; }
    .attendance-actions { margin-left: 0; width: 100%; }
}

@media (max-width: 767px) {
    .grid-2 { grid-template-columns: 1fr; }
    .erp-page-head, .erp-topbar, .auth-row { flex-direction: column; align-items: stretch; }
    .metric-grid { grid-template-columns: 1fr !important; }
    .module-grid { grid-template-columns: 1fr !important; }
    .card-header, .card-footer, .card-body { padding-left: 14px; padding-right: 14px; }
    .date-filter-bar { padding: 12px; align-items: stretch; }
    .date-filter-bar form { flex-direction: column; align-items: stretch; }
    .date-filter-input { width: 100% !important; }
    .date-filter-range { margin-left: 0; white-space: normal; }
    .erp-content { padding: 12px 14px; }
    .erp-page-title { font-size: 1.3rem; }
    .erp-page-subtitle { font-size: 0.86rem; }
    .erp-pill { width: 100%; justify-content: center; }
    .erp-userbar { border-radius: 18px; flex-direction: column; align-items: stretch; padding: 10px 12px; }
    .erp-userbar-meta { text-align: left; }
    .erp-userbar .btn { width: 100%; }
    .actions { flex-direction: column; align-items: stretch; }
    .actions .btn,
    .actions form,
    .actions form .btn,
    .btn-group,
    .btn-group .btn { width: 100%; }
    .auth-body { padding: 12px; }
    .auth-scene { border-radius: 22px; }
    .auth-panel, .auth-hero { padding: 20px; }
    .auth-hero-grid { grid-template-columns: 1fr; }
    .auth-hero-title { font-size: 1.75rem; }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate { padding-left: 12px; padding-right: 12px; }
    .dataTables_wrapper .dataTables_filter input { width: 100% !important; margin-left: 0 !important; }
    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label { width: 100%; }
    .dataTables_wrapper .dataTables_paginate { white-space: normal; }
    .module-subnav { padding: 6px 8px; }
}

@media (max-width: 575px) {
    .erp-sidebar { width: min(84vw, 300px); }
    .erp-brand { padding-left: 4px; padding-right: 4px; }
    .erp-nav-link { padding: 9px 10px; }
    .table td, .table th { padding: 0.7rem 0.65rem; }
}

/* ── CRM Pipeline ─────────────────────────────────────────── */
.crm-pipeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.crm-column {
    border: 1px solid rgba(94,76,64,0.12);
    border-radius: 18px;
    background: rgba(255,255,255,0.78);
    min-height: 220px;
    overflow: hidden;
}
.crm-column-head {
    padding: 13px 16px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.crm-column-body { padding: 13px; display: grid; gap: 11px; }
.crm-card {
    border-radius: 15px;
    background: #fff;
    border: 1px solid rgba(94,76,64,0.1);
    padding: 13px;
    box-shadow: 0 10px 26px rgba(55,35,24,0.06);
}
.crm-card-title { font-weight: 800; margin-bottom: 5px; }
.crm-card-meta { color: var(--erp-muted); font-size: 0.84rem; }
.crm-chip-row { display: flex; gap: 7px; flex-wrap: wrap; margin: 9px 0; }
.crm-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(79,108,140,0.08);
    font-size: 0.77rem;
    font-weight: 700;
}
/* Pipeline-specific additions */
.crm-column-body { padding: 13px; display: grid; gap: 11px; min-height: 150px; }
.crm-card { cursor: grab; }
.crm-drop-placeholder {
    border: 2px dashed rgba(164,75,47,0.35);
    border-radius: 13px;
    background: rgba(164,75,47,0.05);
    min-height: 64px;
}
@media (max-width: 991.98px) {
    .crm-pipeline { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
    .crm-column { min-width: 84vw; flex: 0 0 84vw; scroll-snap-align: start; }
}

/* ── Planner Board ────────────────────────────────────────── */
.planner-shell { display: grid; gap: 16px; }
.planner-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.planner-board {
    display: grid;
    gap: 13px;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    align-items: start;
}
.planner-column {
    border: 1px solid var(--erp-border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(253,252,250,0.9) 100%);
    box-shadow: 0 6px 22px rgba(35,24,18,0.06);
    min-height: 300px;
    overflow: hidden;
}
.planner-column-head {
    padding: 11px 13px;
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(244,241,235,0.7);
}
.planner-column-title {
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--erp-primary-dark);
}
.planner-column-body { padding: 10px; display: grid; gap: 9px; min-height: 250px; }
.planner-task {
    border: 1px solid rgba(94,76,64,0.18);
    border-radius: 11px;
    background: #fff;
    padding: 10px;
    cursor: grab;
    box-shadow: 0 6px 16px rgba(46,33,25,0.06);
}
.planner-task:active { cursor: grabbing; }
.planner-task-title { font-weight: 700; margin-bottom: 5px; line-height: 1.3; }
.planner-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--erp-muted); font-size: 0.77rem; }
.planner-task-notes { margin-top: 7px; color: #4f433d; font-size: 0.82rem; line-height: 1.36; }
.planner-empty {
    border: 1px dashed var(--erp-border);
    color: var(--erp-muted);
    border-radius: 9px;
    padding: 12px;
    text-align: center;
    font-size: 0.83rem;
    background: rgba(255,255,255,0.65);
}
.planner-timeline { border-top: 1px solid var(--erp-border); margin-top: 13px; padding-top: 13px; }
.timeline-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border-radius: 9px;
    padding: 9px 10px;
}
.timeline-row + .timeline-row { border-top: 1px dashed rgba(94,76,64,0.18); }
.timeline-time { font-size: 0.82rem; font-weight: 800; color: var(--erp-primary-dark); }
.timeline-title { font-weight: 700; }
.timeline-status { font-size: 0.74rem; color: var(--erp-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.sortable-ghost { opacity: 0.35; }
.sortable-chosen { transform: scale(1.01); }
.planner-add-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

@media (max-width: 1100px) {
    .planner-board { grid-template-columns: 1fr; }
    .timeline-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── Attendance Mapping ───────────────────────────────────── */
.mapping-select { min-width: 230px; }
.mapping-shift-select { min-width: 170px; }
.mapping-date-input { min-width: 145px; }
.badge-unmapped { background: #ffc107; color: #333; }
.badge-mapped { background: #28a745; color: #fff; }
.excel-name { font-style: italic; color: #555; }
tr.row-mapped { background: rgba(40,167,69,0.05); }
tr.row-unmapped { background: rgba(255,193,7,0.05); }
.mapping-toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    color: #495057;
    background: rgba(248,249,250,0.9);
    border: 1px solid rgba(100,116,139,0.2);
    border-radius: 8px;
    padding: 4px 8px;
}

/* ── Employee Locations Map ───────────────────────────────── */
#map-wrap { display: flex; gap: 16px; align-items: flex-start; }
#map { flex: 1; height: 560px; border-radius: 12px; border: 1px solid var(--erp-border); z-index: 1; }
#map + div, #sidebar { width: 280px; flex-shrink: 0; }
.loc-card {
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: 10px;
    margin-bottom: 7px;
    padding: 10px 12px;
    cursor: pointer;
    transition: box-shadow 0.14s;
}
.loc-card:hover { box-shadow: 0 3px 10px rgba(15,23,42,0.1); }
.loc-card .name { font-weight: 600; font-size: 0.88rem; }
.loc-card .meta { font-size: 0.76rem; color: var(--erp-muted); }
.badge-campus { background: #28a745; color: #fff; font-size: 0.7rem; padding: 2px 7px; border-radius: 20px; }
.badge-offcampus { background: #dc3545; color: #fff; font-size: 0.7rem; padding: 2px 7px; border-radius: 20px; }
.badge-stale { background: #ffc107; color: #212529; font-size: 0.7rem; padding: 2px 7px; border-radius: 20px; }
#refresh-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
#last-refresh { font-size: 0.78rem; color: var(--erp-muted); }
#total-strip { font-size: 0.84rem; }
.zone-panel { background: #fff; border: 1px solid var(--erp-border); border-radius: 10px; padding: 14px; margin-top: 16px; }
