:root {
    --figtree-900: #1d4e23;
    --figtree-800: #285f2b;
    --figtree-600: #397633;
    --figtree-500: #5d9155;
    --figtree-300: #a8c59d;
    --figtree-100: #edf5e9;
    --accent: #7dab6f;
    --ink: #202a20;
    --muted: #6d786d;
    --canvas: #f5f8f3;
    --card-shadow: 0 8px 24px rgba(36, 83, 38, .07);
    --brand-serif: Georgia, "Times New Roman", serif;
}

html, body { min-height: 100%; }
body { background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--figtree-100) 80%, #fff) 0, transparent 26rem), var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
a { color: var(--figtree-600); }
.app-shell { min-height: 100vh; }
.sidebar { width: 268px; background: linear-gradient(180deg, #fbfdf9, #edf5e9); color: var(--ink); border-right: 1px solid #dce8d7; position: fixed; inset: 0 auto 0 0; z-index: 1030; overflow-y: auto; }
.brand { display: block; padding: .55rem; margin: .8rem .7rem .35rem; color: var(--figtree-900); text-decoration: none; background: rgba(255,255,255,.82); border: 1px solid #dbe8d6; border-radius: 14px; box-shadow: 0 7px 18px rgba(42,91,43,.06); }
.brand-logo { display: block; width: 100%; height: 60px; object-fit: contain; }
.brand-name { display: none; font-weight: 800; font-size: .75rem; text-align: center; margin-top: .25rem; }
.login-logo { display: block; width: min(100%, 260px); max-height: 82px; object-fit: contain; height: auto; }
.invoice-logo { display: block; width: min(250px, 100%); height: auto; }
.sidebar-group { width: calc(100% - 1.4rem); border: 0; background: transparent; color: #80917f; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; margin: .7rem .7rem .2rem; padding: .45rem .55rem; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; }
.sidebar-group:hover { background: rgba(255,255,255,.6); color: var(--figtree-900); }
.sidebar-group .caret { transition: transform .18s ease; }
.sidebar-group[aria-expanded="false"] .caret { transform: rotate(-90deg); }
.sidebar .nav-link { color: #526151; border-radius: 11px; margin: .12rem .7rem; padding: .72rem .85rem; display: flex; align-items: center; gap: .75rem; font-weight: 650; font-size: .9rem; }
.sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { color: var(--figtree-900); background: #dfeeda; }
.sidebar .nav-link.active { box-shadow: inset 3px 0 var(--figtree-600); }
.main-area { margin-left: 268px; min-height: 100vh; }
.topbar { min-height: 58px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid #dfe8dc; position: sticky; top: 0; z-index: 1020; }
.page-wrap { width: 100%; padding: .85rem clamp(.9rem, 2vw, 2rem) 1.2rem; min-height: calc(100vh - 58px); }
.page-title { color: var(--figtree-900); font-family: var(--brand-serif); font-weight: 700; letter-spacing: -.025em; margin: 0; }
.page-kicker { color: var(--muted); font-size: .86rem; margin: .25rem 0 0; }
.avatar { width: 39px; height: 39px; border-radius: 13px; display: grid; place-items: center; background: var(--figtree-100); color: var(--figtree-800); font-weight: 800; }
.card { border: 1px solid #dfe8dc; border-radius: 16px; box-shadow: var(--card-shadow); }
.card-header { background: transparent; border-bottom-color: #e8efe5; padding: .72rem .9rem; }
.metric-card { overflow: hidden; height: 100%; }
.metric-card .card-body { padding: .85rem; }
.metric-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.2rem; }
.metric-label { font-size: .76rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.metric-value { font-weight: 800; letter-spacing: -.035em; font-size: 1.55rem; line-height: 1.2; }
.btn { border-radius: 10px; font-weight: 700; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-sm { min-height: 34px; border-radius: 9px; }
.btn-primary { --bs-btn-bg: var(--figtree-600); --bs-btn-border-color: var(--figtree-600); --bs-btn-hover-bg: var(--figtree-800); --bs-btn-hover-border-color: var(--figtree-800); --bs-btn-active-bg: var(--figtree-900); }
.btn-outline-primary { --bs-btn-color: var(--figtree-600); --bs-btn-border-color: var(--figtree-600); --bs-btn-hover-bg: var(--figtree-600); --bs-btn-hover-border-color: var(--figtree-600); }
.form-control, .form-select { border-radius: 9px; border-color: #dce4df; min-height: 38px; }
.form-control:focus, .form-select:focus { border-color: var(--figtree-500); box-shadow: 0 0 0 .22rem rgba(47,125,87,.13); }
.form-label { font-size: .82rem; font-weight: 750; color: #44504b; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table th { color: var(--muted); font-size: .69rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; border-bottom-color: #edf1ef; padding-top: .48rem; padding-bottom: .48rem; font-size: .86rem; }
.status { display: inline-flex; align-items: center; gap: .35rem; border-radius: 99px; padding: .34rem .58rem; font-weight: 750; font-size: .7rem; line-height: 1; text-transform: capitalize; }
.status-success { color: #17613f; background: #dff4e8; }
.status-warning { color: #7a5510; background: #fff1cc; }
.status-danger { color: #9e3131; background: #fce3e3; }
.status-info { color: #245d7a; background: #e1f1f9; }
.status-muted { color: #5f6964; background: #eef1ef; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.section-title { color: var(--figtree-900); font-family: var(--brand-serif); font-weight: 700; letter-spacing: -.01em; font-size: 1.04rem; margin: 0; }
.icon-tile { width: 2.6rem; height: 2.6rem; flex: 0 0 2.6rem; border-radius: .8rem; display: grid; place-items: center; color: var(--figtree-600); background: var(--figtree-100); font-size: 1.1rem; }
.empty-state { text-align: center; padding: 2.6rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2rem; color: #aab5af; display: block; margin-bottom: .6rem; }
.quick-action { text-decoration: none; color: var(--ink); border: 1px solid #e5ebe7; background: #fff; border-radius: 14px; padding: .9rem; display: flex; gap: .75rem; align-items: center; transition: .15s ease; }
.quick-action:hover { transform: translateY(-2px); border-color: #bad6c6; color: var(--figtree-800); }
.quick-action i { font-size: 1.2rem; color: var(--figtree-600); }
.mobile-bottom-nav { display: none; }
.offcanvas.sidebar-mobile { background: #f6faf3; color: var(--ink); width: 285px; }
.offcanvas.sidebar-mobile .sidebar { display: block; position: static; width: auto; height: 100%; }
.login-shell { min-height: 100svh; display: grid; grid-template-columns: minmax(340px, .78fr) 1.22fr; background: #fff; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: clamp(1rem, 3vh, 2rem); overflow-y: auto; }
.login-form { width: 100%; max-width: 420px; }
.login-brand { margin-bottom: clamp(1rem, 3vh, 2rem); }
.login-form h1 { color: var(--figtree-900); font-family: var(--brand-serif); font-weight: 700 !important; }
.login-visual { background-image: linear-gradient(145deg, color-mix(in srgb, var(--figtree-900) 58%, transparent), color-mix(in srgb, var(--figtree-900) 30%, transparent)), var(--login-image); background-position: center; background-size: cover; color: #fff; display: flex; align-items: flex-end; padding: clamp(2rem, 5vw, 5rem); position: relative; overflow: hidden; }
.login-visual::before { content: ""; position: absolute; width: 560px; height: 560px; top: -125px; right: -125px; background: url('/images/figtree-mark.png') center/contain no-repeat; opacity: .08; }
.login-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; width: 360px; height: 360px; top: -90px; right: -80px; }
.login-copy { position: relative; max-width: 610px; }
.login-copy h1 { font-family: var(--brand-serif); font-size: clamp(2.1rem, 4.5vw, 4.3rem); font-weight: 700; letter-spacing: -.04em; line-height: 1; text-wrap: balance; }
.brand-pill { display: inline-flex; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: .42rem .7rem; font-size: .76rem; font-weight: 800; }
.auth-simple { min-height:100vh; display:grid; place-items:center; padding:1.25rem; background:radial-gradient(circle at 100% 0,var(--figtree-100),transparent 30rem),var(--canvas); }.auth-card { width:min(100%,440px); background:#fff; border:1px solid #dfe8dc; border-radius:16px; padding:clamp(1.25rem,4vw,2rem); box-shadow:var(--card-shadow); }

.sidebar, .main-area { transition: width .2s ease, margin-left .2s ease; }
.sidebar-collapsed .sidebar-desktop { width: 76px; }
.sidebar-collapsed .main-area { margin-left: 76px; }
.sidebar-collapsed .sidebar-desktop .brand { padding: .3rem; margin: .65rem .4rem; }
.sidebar-collapsed .sidebar-desktop .brand-logo { height: 48px; }
.sidebar-collapsed .sidebar-desktop .nav-link { justify-content: center; padding: .7rem; margin-inline: .45rem; }
.sidebar-collapsed .sidebar-desktop .nav-link span, .sidebar-collapsed .sidebar-desktop .sidebar-group span, .sidebar-collapsed .sidebar-desktop .sidebar-group .caret { display: none; }
.sidebar-collapsed .sidebar-desktop .sidebar-group { justify-content: center; width: calc(100% - .8rem); margin-inline: .4rem; }
.sidebar-collapsed .sidebar-desktop .sidebar-group::after { content: "•••"; letter-spacing: .05em; }
.select2-container--bootstrap-5 .select2-selection { min-height: 38px; border-color: #dce4df; border-radius: 9px; }
.dt-container .dt-search input, .dt-container .dt-length select { min-height: 34px; border-radius: 8px; }
.dt-container .row { align-items: center; }
.dt-container { width: 100%; padding: .55rem .8rem; overflow: hidden; }
.dt-container .dt-layout-row { margin: 0 0 .5rem; gap: .5rem; }
.dt-container .dt-layout-row { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; }
.dt-container .dt-layout-cell { min-width: 0; }
.dt-container .dt-layout-table { overflow-x: auto; }
.modal .select2-container { width: 100% !important; }
.select2-container--open { z-index: 1080; }
.modal { --bs-modal-zindex: 1060; }
.table-responsive { min-height: 110px; }
.content-scroll { max-height: calc(100vh - 210px); overflow: auto; }
.compact-card .card-body { padding: .85rem; }
.report-tabs { overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; }
.payroll-employee-table { min-width: 700px; width: 100% !important; table-layout: auto; }
.payroll-employee-table th:first-child { min-width: 180px; }
.payroll-employee-table th:last-child { width: 1%; }
.pay-breakdown { display: grid; grid-template-columns: repeat(3, minmax(78px, 1fr)); gap: .35rem; min-width: 270px; }
.pay-breakdown.deductions { grid-template-columns: repeat(2, minmax(95px, 1fr)); min-width: 205px; }
.pay-breakdown > div { background: #f7faf6; border: 1px solid #e7eee4; border-radius: 9px; padding: .38rem .48rem; }
.pay-breakdown span { display: block; color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; margin-bottom: .12rem; }
.pay-breakdown strong { display: block; font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.number-series-locked { background: linear-gradient(180deg,#fff,#f8faf8); }
.module-link-card { border-color:#dbe8df; transition:border-color .18s ease,transform .18s ease,box-shadow .18s ease; color:var(--bs-body-color); }
.module-link-card:hover { border-color:var(--figtree-500); transform:translateY(-1px); box-shadow:0 8px 24px rgba(27,78,35,.08); }
.module-link-card > .card-body > i { font-size:1.25rem; color:var(--figtree-600); }
.card-footer .pagination { margin-bottom:0; }
.table thead a { color:inherit; text-decoration:none; white-space:nowrap; }
.table thead a:hover { color:var(--figtree-600); }
.number-preview { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.65rem .75rem; border:1px dashed #cbdac5; border-radius:10px; background:var(--figtree-100); }
.number-preview span { color:var(--muted); font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.setup-tour-slide { min-height:280px; display:flex; align-items:center; gap:1.25rem; padding:clamp(1.25rem,4vw,3rem); }
.setup-step-number { width:70px; height:70px; flex:0 0 70px; display:grid; place-items:center; border-radius:22px; background:var(--figtree-100); color:var(--figtree-800); font-family:var(--brand-serif); font-size:2rem; font-weight:800; }
.carousel-indicators [data-bs-target] { background-color:var(--figtree-600); width:24px; height:4px; border:0; }

@media (min-width: 992px) and (max-height: 850px) {
    .page-wrap { padding-top: .7rem; }
    .page-heading { margin-bottom: .65rem !important; }
    .metric-value { font-size: 1.3rem; }
    .card { border-radius: 12px; }
    .login-panel { align-items:flex-start; }
    .login-form { padding-block:.35rem; }
    .login-brand { margin-bottom:.75rem; }
    .login-form .mb-4 { margin-bottom:.75rem !important; }
    .login-form .mb-3 { margin-bottom:.65rem !important; }
}

@media (max-width: 991.98px) {
    .sidebar-desktop { display: none; }
    .main-area { margin-left: 0; }
    .page-wrap { padding: 1.1rem .85rem 6.2rem; }
    .topbar { min-height: 58px; }
    .mobile-bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 1040; inset: auto 0 0; background: rgba(255,255,255,.97); border-top: 1px solid #dfe7e2; padding: .45rem max(.25rem, env(safe-area-inset-right)) calc(.45rem + env(safe-area-inset-bottom)) max(.25rem, env(safe-area-inset-left)); box-shadow: 0 -8px 24px rgba(18,56,42,.08); }
    .mobile-bottom-nav a { color: #68756f; text-decoration: none; text-align: center; font-size: .64rem; font-weight: 750; display: flex; flex-direction: column; gap: .12rem; align-items: center; }
    .mobile-bottom-nav a i { font-size: 1.15rem; }
    .mobile-bottom-nav a.active { color: var(--figtree-600); }
    .table-responsive.mobile-cards { overflow: visible; }
    .mobile-cards table, .mobile-cards thead, .mobile-cards tbody, .mobile-cards th, .mobile-cards td, .mobile-cards tr { display: block; }
    .mobile-cards thead { display: none; }
    .mobile-cards tbody { display: grid; gap: .75rem; }
    .mobile-cards tr { border: 1px solid #e5ebe7; border-radius: 13px; padding: .8rem; background: #fff; }
    .mobile-cards td { border: 0; padding: .28rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; }
    .mobile-cards td::before { content: attr(data-label); color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; text-align: left; }
    .mobile-cards td[data-label=""]::before { display: none; }
    .login-shell { min-height:100svh; display:grid; grid-template-columns:1fr; grid-template-rows:minmax(0,1fr) 150px; background:var(--canvas); }
    .login-panel { min-height:0; padding:1rem; align-items:center; }
    .login-visual { display:flex; min-height:150px; padding:1rem 1.25rem; background-position:center 55%; }
    .login-copy .brand-pill, .login-copy p { display:none; }
    .login-copy h1 { font-size:1.45rem; margin:0; }
}

@media (max-width: 767.98px) {
    .setup-tour-slide { min-height:330px; align-items:flex-start; flex-direction:column; }
    .setup-step-number { width:52px; height:52px; flex-basis:52px; border-radius:16px; font-size:1.45rem; }
}

@media (max-width: 575.98px) and (max-height: 760px) {
    .login-shell { display:block; }
    .login-visual { display:none; }
    .login-panel { min-height:100svh; align-items:flex-start; }
    .login-brand { margin-bottom:.65rem; }
}
