/* =========================================================
   SMATHR - Brand & UI stylesheet
   Tokens:
   --ink      #14213D  deep navy   (headings, dark text)
   --primary  #1F7A5C  emerald     (brand/primary actions)
   --primary-dark #145C43
   --accent   #E8A33D  warm gold   (highlights/CTA accents)
   --bg       #FAFAF8  off white   (page background)
   --muted    #6B7280  slate grey  (secondary text)
   ========================================================= */

:root {
    --ink: #14213D;
    --primary: #1F7A5C;
    --primary-dark: #145C43;
    --accent: #E8A33D;
    --bg: #FAFAF8;
    --muted: #6B7280;
    --border: #E6E4DD;
    --sidebar-w: 260px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--ink);
}

h1, h2, h3, h4, h5, .brand-font {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

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

.btn-brand, .btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-brand:hover, .btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}
.btn-outline-brand {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-brand:hover {
    background-color: var(--primary);
    color: #fff;
}
.text-accent { color: var(--accent) !important; }
.bg-brand { background-color: var(--primary) !important; }
.text-brand { color: var(--primary) !important; }
.link-brand { color: var(--primary); }

/* ---------- Auth pages ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #14213D 0%, #1F7A5C 100%);
    padding: 2rem 1rem;
}
.auth-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(20,33,61,0.25);
    max-width: 480px;
    width: 100%;
    padding: 2.25rem;
}
.auth-card-wide { max-width: 640px; }

/* ---------- App shell (admin & employee) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--ink);
    color: #fff;
    flex-shrink: 0;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
    z-index: 1030;
    transition: transform .25s ease;
}
.sidebar .brand-mark {
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    font-size: 1.35rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar .brand-mark span { color: var(--accent); }
.sidebar-nav { padding: .75rem 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem 1.5rem;
    color: rgba(255,255,255,0.75);
    font-size: .93rem;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 600;
}
.sidebar-nav .nav-section-label {
    padding: 1rem 1.5rem .35rem;
    font-size: .72rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: .04em;
}

.main-content {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-body { padding: 1.75rem; flex: 1; }

.sidebar-toggle-btn { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .sidebar-toggle-btn { display: inline-flex; }
    .sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1025; display: none;
    }
    .sidebar-backdrop.show { display: block; }
}

/* ---------- Cards & tables ---------- */
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.stat-card .stat-label { color: var(--muted); font-size: .85rem; }

.card { border: 1px solid var(--border); border-radius: 10px; }
.card.border-brand {
    border-color: rgba(31, 122, 92, 0.35) !important;
    box-shadow: 0 0 0 1px rgba(31, 122, 92, 0.06);
}
.card.border-brand > .card-header {
    background: #F3FAF7;
    border-bottom-color: rgba(31, 122, 92, 0.2);
}
.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    border-bottom-width: 1px;
    background: #FBFAF7;
}
.badge-status-active { background: #E6F4EE; color: #146C43; }
.badge-status-inactive { background: #F1F1F1; color: #6B7280; }
.badge-status-terminated { background: #FBE8E8; color: #B02A2A; }
.badge-status-pending { background: #FDF1DA; color: #97640B; }
.badge-status-approved { background: #E6F4EE; color: #146C43; }
.badge-status-rejected { background: #FBE8E8; color: #B02A2A; }

/* ---------- Pagination (brand-coloured to match buttons/links) ---------- */
.pagination .page-link {
    color: var(--primary);
    border-color: var(--border);
}
.pagination .page-link:hover {
    color: var(--primary-dark);
    background-color: #F3FAF7;
    border-color: var(--border);
}
.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    color: #B9BDC6;
}

/* ---------- Payslip ---------- */
.payslip {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
}
.payslip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}
.payslip table td, .payslip table th { padding: .5rem .25rem; }
.payslip .net-pay-box {
    background: var(--ink);
    color: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

@media print {
    .no-print { display: none !important; }
    .main-content { margin-left: 0; width: 100%; }
    body { background: #fff; }
}
