:root {
  --ink: #17212f;
  --ink-soft: #667085;
  --ink-muted: #98a2b3;
  --line: #e8ecf1;
  --canvas: #f7f8fa;
  --surface: #ffffff;
  --navy: #172133;
  --navy-2: #212d42;
  --blue: #3563e9;
  --blue-soft: #eaf0ff;
  --teal: #12a594;
  --teal-soft: #e3f7f3;
  --orange: #e98a32;
  --orange-soft: #fff3e5;
  --red: #d95d70;
  --red-soft: #fdecef;
  --purple: #8067db;
  --purple-soft: #f0edff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .03);
  --shadow-md: 0 16px 45px rgba(16, 24, 40, .14);
  --radius: 14px;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(53, 99, 233, .2); outline-offset: 1px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; background: var(--navy); color: #c6cfde; padding: 25px 16px 16px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 27px; }
.brand strong { display: block; color: #fff; font: 800 17px/1.1 var(--font-heading); letter-spacing: -.5px; }
.brand strong span { color: #7f9cff; }
.brand small { display: block; color: #7f8ba1; font-size: 10px; margin-top: 4px; letter-spacing: .2px; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 28px; height: 28px; padding: 3px; border-radius: 9px; background: linear-gradient(135deg, #6085ff, #2849ad); }
.brand-mark span { display: block; width: 5px; border-radius: 5px 5px 3px 3px; background: #fff; }
.brand-mark span:nth-child(1) { height: 10px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 16px; opacity: .82; }
.brand-mark span:nth-child(3) { height: 22px; }
.workspace-pill { display: flex; align-items: center; gap: 8px; padding: 10px 11px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.05); border-radius: 10px; color: #e7ecf5; font-size: 12px; margin-bottom: 24px; }
.workspace-dot { width: 7px; height: 7px; border-radius: 50%; background: #57d3b7; box-shadow: 0 0 0 3px rgba(87,211,183,.12); }
.workspace-pill .icon-button { margin-left: auto; color: #9aa8bd; }
.icon-button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; display: inline-grid; place-items: center; background: transparent; color: var(--ink-soft); font-size: 17px; transition: .2s; }
.icon-button:hover { background: var(--blue-soft); color: var(--blue); }
.icon-button.tiny { width: 20px; height: 20px; font-size: 15px; }
.nav-list { flex: 1; }
.nav-label { color: #718097; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; padding: 0 11px; margin: 0 0 8px; }
.nav-label:not(:first-child) { margin-top: 24px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; color: #9eabbd; background: transparent; border: 0; border-radius: 9px; text-align: left; padding: 10px 11px; margin-bottom: 3px; font-size: 13px; transition: .2s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: #304a9f; box-shadow: 0 5px 13px rgba(10, 26, 75, .22); }
.nav-icon { width: 19px; text-align: center; color: currentColor; font-size: 14px; opacity: .9; }
.nav-item.active .nav-icon { color: #bdcaff; }
.sidebar-footer { padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.secure-note { display: flex; gap: 8px; margin-top: 15px; padding: 12px 9px 4px; color: #7e8ba0; }
.secure-note strong, .secure-note small { display: block; }
.secure-note strong { color: #afb9c8; font-size: 11px; font-weight: 600; }
.secure-note small { font-size: 10px; margin-top: 2px; }
.secure-icon { display: grid; place-items: center; width: 21px; height: 21px; background: rgba(87,211,183,.12); color: #57d3b7; border-radius: 50%; font-size: 11px; }

.main-content { min-width: 0; flex: 1; }
.copyright-footer { color: #98a2b3; font-size: 10px; text-align: center; padding: 14px 34px 24px; }
.auth-locked #app-shell { visibility: hidden; pointer-events: none; }
.auth-gate { display: none; position: fixed; inset: 0; z-index: 200; background: radial-gradient(circle at 15% 10%, rgba(89, 120, 247, .18), transparent 33%), linear-gradient(135deg, #111b2f 0%, #1c2c4c 100%); color: white; }
.auth-locked .auth-gate { display: grid; place-items: center; padding: 22px; }
.auth-layout { width: min(980px, 100%); min-height: min(640px, calc(100vh - 44px)); display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden; background: rgba(255,255,255,.98); color: var(--ink); border-radius: 24px; box-shadow: 0 28px 80px rgba(5, 15, 35, .4); }
.auth-showcase { position: relative; padding: 42px 42px 36px; background: linear-gradient(145deg, #273d76, #1e2e51 70%); color: white; overflow: hidden; }
.auth-showcase::before, .auth-showcase::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
.auth-showcase::before { width: 500px; height: 500px; right: -210px; bottom: -170px; }
.auth-showcase::after { width: 260px; height: 260px; right: -85px; bottom: -50px; }
.auth-brand { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.auth-brand strong { font: 800 18px var(--font-heading); letter-spacing: -.5px; }
.auth-brand strong span { color: #9fb4ff; }
.auth-showcase h1 { position: relative; z-index: 1; max-width: 380px; margin: 92px 0 14px; font: 800 31px/1.12 var(--font-heading); letter-spacing: -1px; }
.auth-showcase > p { position: relative; z-index: 1; max-width: 350px; color: #b8c5df; font-size: 13px; }
.auth-feature-list { position: absolute; z-index: 1; left: 42px; right: 42px; bottom: 36px; display: grid; gap: 10px; }
.auth-feature { display: flex; align-items: center; gap: 9px; color: #d8e1f4; font-size: 11px; }
.auth-feature i { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; color: #9bb0ff; background: rgba(144, 169, 255, .16); font-style: normal; }
.auth-form-wrap { display: flex; align-items: center; padding: 42px; }
.auth-form { width: 100%; max-width: 360px; margin: auto; }
.auth-form h2 { margin: 0; font: 800 24px var(--font-heading); letter-spacing: -.7px; }
.auth-form .auth-subtitle { margin: 7px 0 28px; color: var(--ink-soft); font-size: 12px; }
.auth-field { margin-bottom: 15px; }
.auth-field label { display: block; color: #475467; font-size: 11px; font-weight: 700; margin-bottom: 7px; }
.auth-input-wrap { position: relative; }
.auth-input { width: 100%; height: 43px; border: 1px solid #dfe4eb; border-radius: 9px; color: var(--ink); background: white; padding: 0 12px; font-size: 13px; }
.auth-input.password { padding-right: 43px; }
.auth-input:focus { border-color: var(--blue); outline: 3px solid rgba(53,99,233,.13); }
.auth-password-toggle { position: absolute; top: 5px; right: 5px; width: 33px; height: 33px; border: 0; border-radius: 7px; background: transparent; color: #8995a6; }
.auth-password-toggle:hover { color: var(--blue); background: var(--blue-soft); }
.auth-error { display: none; color: #c23d53; background: var(--red-soft); border: 1px solid #f3ccd3; border-radius: 8px; padding: 9px 11px; font-size: 11px; margin-bottom: 13px; }
.auth-error.visible { display: block; }
.auth-submit { width: 100%; height: 43px; border: 0; border-radius: 9px; color: white; background: var(--blue); font-weight: 700; font-size: 13px; box-shadow: 0 7px 15px rgba(53,99,233,.22); }
.auth-submit:hover { background: #2852d0; }
.auth-submit:disabled { cursor: wait; opacity: .7; }
.auth-note { color: #98a2b3; font-size: 10px; text-align: center; margin: 22px 0 0; }
.auth-config { color: #9a5f17; background: var(--orange-soft); border: 1px solid #f6d9af; padding: 11px 12px; border-radius: 8px; font-size: 11px; line-height: 1.5; }
.auth-loading { display: flex; align-items: center; gap: 8px; justify-content: center; color: #667085; font-size: 12px; padding: 20px; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(53,99,233,.18); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.admin-mode .nav-list, .admin-mode .sidebar-footer { display: none; }
.admin-mode .sidebar { justify-content: flex-start; }
.admin-sidebar-menu { display: none; }
.admin-mode .admin-sidebar-menu { display: block; }
.admin-menu-label { color: #718097; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; padding: 0 11px; margin: 5px 0 8px; }
.admin-nav-item { width: 100%; display: flex; align-items: center; gap: 11px; color: #9eabbd; background: transparent; border: 0; border-radius: 9px; text-align: left; padding: 10px 11px; margin-bottom: 3px; font-size: 13px; }
.admin-nav-item:hover, .admin-nav-item.active { color: #fff; background: rgba(255,255,255,.09); }
.admin-nav-item.active { background: #304a9f; }
.admin-mode .brand small { color: #9aa8bd; }
.admin-header-badge { display: inline-flex; align-items: center; gap: 5px; color: #6f53c8; background: var(--purple-soft); border-radius: 20px; padding: 5px 9px; font-size: 10px; font-weight: 700; }
.admin-header-badge::before { content: "★"; font-size: 9px; }
.admin-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.admin-kpi { padding: 15px 16px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow-sm); }
.admin-kpi span { display: block; color: var(--ink-soft); font-size: 10px; }
.admin-kpi strong { display: block; color: var(--ink); font: 800 21px var(--font-heading); margin-top: 7px; }
.admin-kpi.blue { border-top: 3px solid var(--blue); }
.admin-kpi.green { border-top: 3px solid var(--teal); }
.admin-kpi.orange { border-top: 3px solid var(--orange); }
.admin-kpi.red { border-top: 3px solid var(--red); }
.admin-kpi.purple { border-top: 3px solid var(--purple); }
.admin-user-status { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.admin-user-status.active { color: #168b73; background: var(--teal-soft); }
.admin-user-status.near { color: #b9711b; background: var(--orange-soft); }
.admin-user-status.expired, .admin-user-status.blocked { color: #c9465b; background: var(--red-soft); }
.admin-user-status.suspended { color: #7b8798; background: #eef1f5; }
.admin-user-status.pending { color: #b9711b; background: var(--orange-soft); }
.admin-activity-dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 12px; }
.admin-view-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.admin-view-tab { height: 32px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink-soft); padding: 0 11px; font-size: 11px; font-weight: 600; }
.admin-view-tab.active { color: var(--blue); border-color: #cbd7ff; background: var(--blue-soft); }
.admin-modal-note { color: var(--ink-muted); font-size: 10px; margin-top: 5px; }
body.admin-mode .copyright-footer { padding-top: 17px; }

.topbar { height: 71px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: var(--ink-muted); font-size: 12px; }
.breadcrumb b { color: #c1c7d0; font-weight: 400; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.topbar-actions { display: flex; gap: 9px; align-items: center; }
.search-trigger { height: 35px; min-width: 186px; display: flex; align-items: center; gap: 8px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 8px; color: #a0a8b6; padding: 0 9px; font-size: 12px; }
.search-trigger span:first-child { font-size: 20px; line-height: 0; color: #7c899e; }
.search-trigger kbd { margin-left: auto; padding: 2px 5px; border: 1px solid #dde2ea; background: #fff; color: #9ba5b4; border-radius: 4px; font-size: 9px; }
.notification-button { position: relative; }
.notification-button i { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; background: var(--red); border-radius: 50%; border: 1px solid white; }
.profile-tools { display: flex; align-items: center; gap: 10px; }
.profile-chip { display: flex; align-items: center; gap: 8px; padding-left: 7px; border-left: 1px solid var(--line); margin-left: 5px; }
.avatar { width: 32px; height: 32px; background: #dbe4ff; color: #3d5fc7; display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-size: 11px; }
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy strong { color: var(--ink); font-size: 11px; font-weight: 700; }
.profile-copy small { color: var(--ink-muted); font-size: 10px; margin-top: 1px; }
.chevron { color: #9ba4b1; font-size: 16px; margin-left: 2px; }
.logout-button { height: 33px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #f0cfd5; border-radius: 8px; background: #fff7f8; color: #c13f53; padding: 0 10px; font-size: 11px; font-weight: 700; cursor: pointer; transition: .2s; }
.logout-button:hover { background: #ffedf0; border-color: #e9aeb8; }
.mobile-only { display: none; }

.view-container { max-width: 1500px; margin: 0 auto; padding: 31px 34px 56px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { font: 800 25px/1.15 var(--font-heading); margin: 0; color: #172236; letter-spacing: -.65px; }
.page-head p { margin: 8px 0 0; color: var(--ink-soft); font-size: 13px; }
.head-actions { display: flex; gap: 9px; align-items: center; }
.button { border: 1px solid transparent; border-radius: 8px; height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; font-weight: 600; font-size: 12px; transition: .2s; white-space: nowrap; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 3px 7px rgba(53,99,233,.2); }
.button-primary:hover { background: #2852d0; transform: translateY(-1px); }
.button-secondary { color: #475467; background: white; border-color: var(--line); }
.button-secondary:hover { background: #f9fafb; border-color: #cfd6e0; }
.button-quiet { color: var(--blue); background: var(--blue-soft); }
.button-danger { color: #c53e52; background: var(--red-soft); }
.button-small { height: 30px; padding: 0 10px; font-size: 11px; }
.text-button { background: none; border: 0; color: var(--blue); font-size: 12px; font-weight: 600; padding: 4px; }
.demo-banner { display: flex; align-items: center; gap: 10px; margin: -10px 34px 0; padding: 10px 14px; color: #6b5318; background: #fff9df; border: 1px solid #f8e7a4; border-radius: 10px; font-size: 12px; }
.demo-banner > span { color: #d99923; font-size: 18px; }
.demo-banner div { flex: 1; }
.demo-banner strong { display: block; font-weight: 700; }
.demo-banner div span { display: block; color: #917c43; margin-top: 1px; }
.demo-banner .text-button { color: #a47a18; }
.hidden { display: none !important; }

.cards-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 18px 15px; min-width: 0; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.stat-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.green { color: var(--teal); background: var(--teal-soft); }
.stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.stat-icon.purple { color: var(--purple); background: var(--purple-soft); }
.stat-value { font: 800 24px/1.1 var(--font-heading); color: #1c293c; letter-spacing: -.7px; margin-top: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-foot { display: flex; align-items: center; gap: 5px; margin-top: 11px; font-size: 10px; color: var(--ink-muted); }
.stat-foot .up { color: var(--teal); font-weight: 700; }
.stat-foot .down { color: var(--red); font-weight: 700; }

.grid-2-1 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 14px; margin-top: 14px; }
.grid-1-1 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px 20px 0; }
.panel-head h2 { margin: 0; font: 700 14px/1.2 var(--font-heading); color: #233047; }
.panel-head p { color: var(--ink-soft); font-size: 11px; margin: 5px 0 0; }
.panel-body { padding: 18px 20px 20px; }
.panel-select { border: 1px solid var(--line); border-radius: 7px; height: 29px; padding: 0 8px; color: var(--ink-soft); font-size: 11px; background: white; }
.chart-wrap { height: 225px; position: relative; padding: 16px 0 0 34px; }
.chart-grid { position: absolute; inset: 20px 0 25px 35px; display: flex; flex-direction: column; justify-content: space-between; }
.chart-grid span { border-top: 1px dashed #e6ebf1; width: 100%; position: relative; }
.chart-grid span em { position: absolute; left: -34px; top: -7px; color: #a6afbd; font-style: normal; font-size: 9px; }
.bar-chart { position: absolute; inset: 20px 11px 25px 42px; display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; }
.bar-group { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; flex: 1; position: relative; }
.bar { width: 10px; min-height: 3px; border-radius: 4px 4px 2px 2px; transition: .25s; }
.bar:hover { opacity: .75; transform: scaleY(1.02); transform-origin: bottom; }
.bar.blue { background: #8099f2; }
.bar.purple { background: #c2b5f6; }
.bar-label { position: absolute; bottom: -21px; color: #9ca6b4; font-size: 10px; }
.legend { display: flex; gap: 16px; margin-top: 4px; color: var(--ink-soft); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend i.blue { background: #8099f2; }
.legend i.purple { background: #c2b5f6; }
.progress-list { display: flex; flex-direction: column; gap: 17px; }
.progress-row .progress-meta { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 11px; margin-bottom: 7px; }
.progress-row strong { color: var(--ink); font-weight: 600; }
.progress-track { height: 8px; background: #f0f2f5; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; }
.progress-fill.blue { background: var(--blue); }
.progress-fill.orange { background: #f0a055; }
.progress-foot { display: flex; justify-content: space-between; color: var(--ink-muted); font-size: 10px; margin-top: 7px; }
.upcoming-list { display: flex; flex-direction: column; }
.upcoming-item { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid #f0f2f5; }
.upcoming-item:last-child { border-bottom: 0; padding-bottom: 0; }
.date-tile { flex: 0 0 37px; text-align: center; color: var(--blue); background: var(--blue-soft); border-radius: 8px; padding: 5px 3px; }
.date-tile strong { display: block; font: 800 15px/1 var(--font-heading); }
.date-tile small { display: block; text-transform: uppercase; font-size: 8px; font-weight: 700; margin-top: 4px; }
.upcoming-copy { min-width: 0; flex: 1; }
.upcoming-copy strong { display: block; color: var(--ink); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-copy small { display: block; color: var(--ink-muted); font-size: 10px; margin-top: 3px; }
.upcoming-value { text-align: right; }
.upcoming-value strong { display: block; color: var(--ink); font-size: 11px; }
.upcoming-value small { display: block; color: var(--orange); font-size: 9px; margin-top: 3px; }
.empty-state { padding: 28px 12px; text-align: center; color: var(--ink-muted); font-size: 12px; }
.empty-state strong { display: block; color: var(--ink-soft); margin-bottom: 5px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input-search { height: 35px; min-width: 220px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 0 11px 0 32px; color: var(--ink); font-size: 12px; }
.search-wrap { position: relative; }
.search-wrap > span { position: absolute; left: 11px; top: 7px; color: #9ca6b4; font-size: 18px; }
.filter-select { height: 35px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 0 10px; color: var(--ink-soft); font-size: 12px; min-width: 120px; }
.table-panel { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 670px; }
.data-table th { text-align: left; color: #8995a6; background: #fafbfc; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 14px 18px; color: #475467; font-size: 12px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.data-table tbody tr { transition: .15s; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.person-cell { display: flex; align-items: center; gap: 9px; min-width: 170px; }
.person-avatar { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; font-size: 10px; font-weight: 800; }
.person-avatar.a { background: #e6edff; color: #5270d8; }
.person-avatar.b { background: #e9f8f2; color: #23937c; }
.person-avatar.c { background: #fff0e4; color: #d0792e; }
.person-avatar.d { background: #f0edff; color: #775ad2; }
.person-copy strong { display: block; color: var(--ink); font-size: 12px; font-weight: 700; }
.person-copy small { display: block; color: var(--ink-muted); font-size: 10px; margin-top: 2px; }
.money { font-weight: 700; color: var(--ink) !important; white-space: nowrap; }
.money.positive { color: var(--teal) !important; }
.money.warning { color: var(--orange) !important; }
.money.danger { color: var(--red) !important; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.active, .badge.paid { color: #168b73; background: var(--teal-soft); }
.badge.inactive { color: #7b8798; background: #eef1f5; }
.badge.pending { color: #c87b22; background: var(--orange-soft); }
.badge.partial { color: #7659ca; background: var(--purple-soft); }
.badge.late { color: #c9465b; background: var(--red-soft); }
.badge.info { color: #4566d3; background: var(--blue-soft); }
.type-pill { display: inline-flex; border-radius: 5px; padding: 4px 7px; font-size: 10px; font-weight: 700; }
.type-pill.family { color: #735aca; background: var(--purple-soft); }
.type-pill.freelance { color: #3974c6; background: var(--blue-soft); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions .icon-button { width: 28px; height: 28px; font-size: 14px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 11px; }
.pagination { display: flex; gap: 4px; }
.pagination button { border: 1px solid var(--line); background: white; width: 27px; height: 27px; border-radius: 6px; color: var(--ink-soft); font-size: 11px; }
.pagination button.active { color: white; background: var(--blue); border-color: var(--blue); }

.finance-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 15px; }
.mini-stat { padding: 15px 17px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.mini-stat span { display: block; color: var(--ink-soft); font-size: 11px; }
.mini-stat strong { display: block; margin-top: 7px; color: var(--ink); font: 800 19px/1 var(--font-heading); }
.mini-stat.blue { border-top: 3px solid var(--blue); }
.mini-stat.green { border-top: 3px solid var(--teal); }
.mini-stat.orange { border-top: 3px solid var(--orange); }
.mini-stat.purple { border-top: 3px solid var(--purple); }
.section-note { color: var(--ink-muted); font-size: 11px; }
.link-button { border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 700; padding: 0; }

.report-card { padding: 20px; }
.report-filter-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr; gap: 10px; align-items: end; }
.field label { display: block; color: #667085; font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #dfe4eb; border-radius: 8px; background: white; color: var(--ink); height: 36px; padding: 0 10px; font-size: 12px; }
.field textarea { min-height: 78px; padding: 9px 10px; resize: vertical; }
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 17px 0; }
.report-total { padding: 12px 14px; background: #f8f9fb; border-radius: 9px; }
.report-total span { display: block; color: var(--ink-soft); font-size: 10px; }
.report-total strong { display: block; color: var(--ink); font: 800 17px/1.1 var(--font-heading); margin-top: 6px; }
.report-total strong.teal { color: var(--teal); }
.report-total strong.orange { color: var(--orange); }
.report-total strong.purple { color: var(--purple); }
.report-title { margin: 24px 0 10px; font: 700 14px var(--font-heading); color: var(--ink); }

.calendar-panel { padding: 20px; }
.calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-head h2 { margin: 0; font: 700 17px var(--font-heading); }
.calendar-nav { display: flex; align-items: center; gap: 7px; }
.calendar-nav button { width: 29px; height: 29px; border: 1px solid var(--line); background: white; border-radius: 7px; color: var(--ink-soft); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.calendar-weekday { padding: 9px 7px; background: #fafbfc; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #98a2b3; text-transform: uppercase; font-size: 9px; font-weight: 700; }
.calendar-day { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px; background: white; }
.calendar-day.muted { background: #fbfcfd; }
.calendar-day.today { background: #f6f8ff; }
.calendar-day-number { color: #667085; font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.calendar-day.today .calendar-day-number { width: 22px; height: 22px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 50%; margin-top: -3px; }
.calendar-event { display: block; width: 100%; border: 0; border-radius: 4px; padding: 4px 5px; margin-bottom: 4px; text-align: left; font-size: 9px; line-height: 1.25; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event.family { color: #735aca; background: var(--purple-soft); }
.calendar-event.freelance { color: #3974c6; background: var(--blue-soft); }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: min(690px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 15px; background: white; box-shadow: var(--shadow-md); }
.modal.wide { width: min(880px, 100%); }
.modal.small { width: min(430px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; color: var(--ink); font: 800 17px var(--font-heading); }
.modal-head p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 24px; border-top: 1px solid var(--line); background: #fcfdfe; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section-title { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; color: var(--ink); font: 700 12px var(--font-heading); margin-top: 4px; padding-bottom: 7px; border-bottom: 1px solid #f0f2f5; }
.form-section-title span { color: var(--blue); }
.radio-group { display: flex; gap: 8px; }
.radio-option { flex: 1; }
.radio-option input { display: none; }
.radio-option label { display: block; padding: 9px 10px; border: 1px solid #dfe4eb; border-radius: 8px; color: var(--ink-soft); text-align: center; cursor: pointer; font-size: 11px; }
.radio-option input:checked + label { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); font-weight: 700; }
.participant-builder { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.participant-head { display: grid; grid-template-columns: 1.5fr 1fr 35px; gap: 8px; padding: 8px 10px; background: #fafbfc; color: #8995a6; text-transform: uppercase; font-size: 9px; font-weight: 700; }
.participant-row { display: grid; grid-template-columns: 1.5fr 1fr 35px; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid #f0f2f5; }
.participant-row select, .participant-row input { width: 100%; height: 32px; border: 1px solid #dfe4eb; border-radius: 7px; padding: 0 8px; font-size: 11px; }
.remove-participant { width: 28px; height: 28px; border: 0; border-radius: 6px; color: var(--red); background: transparent; font-size: 17px; }
.remove-participant:hover { background: var(--red-soft); }
.add-participant { margin-top: 9px; }
.helper-text { color: var(--ink-muted); font-size: 10px; margin-top: 5px; }
.payment-confirm { background: #f8f9fb; padding: 13px 14px; border-radius: 9px; margin-bottom: 14px; }
.payment-confirm-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--ink-soft); font-size: 11px; }
.payment-confirm-row strong { color: var(--ink); }
.balance-callout { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-radius: 8px; background: var(--orange-soft); color: #b46b1d; font-size: 11px; }
.balance-callout strong { font: 800 15px var(--font-heading); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.settings-card { padding: 19px 20px; }
.settings-card h2 { margin: 0; font: 700 14px var(--font-heading); }
.settings-card p { color: var(--ink-soft); font-size: 11px; margin: 6px 0 16px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { border-color: #f2d5da; }
.danger-zone h2 { color: #c14358; }

.toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.toast { display: flex; align-items: flex-start; gap: 10px; max-width: 360px; background: #202c40; color: white; padding: 12px 14px; border-radius: 9px; box-shadow: var(--shadow-md); font-size: 12px; animation: toast-in .25s ease-out; }
.toast.success { border-left: 3px solid #55ceb1; }
.toast.error { border-left: 3px solid #ee7182; }
.toast.info { border-left: 3px solid #7e9cff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.search-modal-list { max-height: 330px; overflow: auto; margin-top: 12px; }
.search-result { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: white; border-bottom: 1px solid #f0f2f5; padding: 10px 3px; text-align: left; }
.search-result:hover { background: #fafcff; }
.search-result .result-type { color: var(--ink-muted); font-size: 10px; margin-left: auto; }

@media (max-width: 1150px) {
  .sidebar { width: 224px; flex-basis: 224px; }
  .view-container { padding-left: 24px; padding-right: 24px; }
  .topbar { padding: 0 24px; }
  .demo-banner { margin-left: 24px; margin-right: 24px; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 850px) {
  .sidebar { position: fixed; z-index: 40; left: -270px; top: 0; bottom: 0; width: 250px; transition: left .22s ease; box-shadow: var(--shadow-md); }
  .sidebar.open { left: 0; }
  .mobile-only { display: inline-grid; }
  .topbar { gap: 12px; padding: 0 17px; }
  .topbar-actions { margin-left: auto; }
  .profile-copy, .profile-chip .chevron, .search-trigger, .logout-label { display: none; }
  .profile-chip { border-left: 0; margin-left: 0; padding-left: 0; }
  .view-container { padding: 25px 17px 45px; }
  .demo-banner { margin-left: 17px; margin-right: 17px; }
  .grid-2-1, .grid-1-1, .settings-grid { grid-template-columns: 1fr; }
  .report-filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .calendar-day { min-height: 83px; }
  .auth-layout { grid-template-columns: 1fr; min-height: auto; }
  .auth-showcase { display: none; }
  .auth-form-wrap { padding: 38px 27px; min-height: 520px; }
  .admin-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cards-grid, .finance-summary, .report-summary { grid-template-columns: 1fr 1fr; }
  .page-head { display: block; }
  .head-actions { margin-top: 16px; }
  .head-actions .button { flex: 1; }
  .form-grid, .report-filter-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .calendar-day { min-height: 65px; padding: 4px; }
  .calendar-event { font-size: 8px; padding: 3px; }
  .calendar-weekday { padding: 7px 3px; font-size: 8px; }
  .toast-root { left: 14px; right: 14px; bottom: 14px; align-items: stretch; }
  .toast { max-width: none; }
  .admin-kpi-grid { grid-template-columns: 1fr 1fr; }
}
