:root {
  color-scheme: light;
  --ink: #17252a;
  --muted: #6d7b7e;
  --line: #dfe8e7;
  --soft: #f4f8f7;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #dff5f1;
  --violet: #6d5bd0;
  --violet-soft: #eeebff;
  --sand: #f2eee5;
  --danger: #b42318;
  --danger-soft: #fff0ed;
  --shadow: 0 18px 50px rgba(30, 65, 62, 0.10);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Leave is isolated from calendar availability and payout styles. */
.leave-balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; margin-bottom: 22px; }
.settings-card.leave-balance-card { display: block; min-width: 0; padding: 22px; }
.leave-balance-card h2 { font-size: 17px; }
.leave-balance-card .section-heading { align-items: flex-start; gap: 8px; }
.leave-balance-card .secondary-button { padding: 8px 10px; min-height: 34px; font-size: 12px; }
.leave-balance-value { color: var(--accent); font-size: 38px; font-weight: 850; margin-bottom: 16px; }
.leave-balance-value small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.leave-negative { color: var(--danger); }
.leave-stats { display: flex; flex-wrap: wrap; gap: 20px; margin: 0 0 16px; }
.leave-stats dt { font-size: 12px; color: var(--muted); }
.leave-stats dd { margin: 6px 0 0; font-size: 18px; font-weight: 750; }
.leave-small { font-size: 12px; line-height: 1.5; margin-top: 14px; }
.settings-card.leave-section { display: block; margin-bottom: 22px; padding: 24px; }
.leave-section summary { cursor: pointer; font-weight: 750; margin-bottom: 14px; }
.leave-calendar { border-collapse: separate; border-spacing: 2px; width: 100%; min-width: 950px; text-align: center; font-size: 12px; }
.leave-calendar caption { text-align: left; margin: 0 0 10px; color: var(--muted); }
.leave-calendar th, .leave-calendar td { padding: 10px 3px; min-width: 23px; height: 42px; border-radius: 4px; }
.leave-calendar th:first-child { text-align: left; min-width: 150px; position: sticky; left: 0; background: white; }
.leave-calendar td { background: var(--soft); color: #afc7c3; }
.leave-calendar .leave-weekend { background: #eaf0ef; }
.leave-calendar .leave-holiday { background: #fff1db; color: #8c591f; }
.leave-calendar .leave-approved-day { background: #10756c; color: #b7f4e9; }
.leave-calendar .leave-approved-day.leave-holiday { background: #daf0d5; color: #44683b; }
.leave-request-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.leave-request-row:last-child { border-bottom: 0; }
.leave-request-row p { margin: 6px 0 0; overflow-wrap: anywhere; max-width: 720px; }
.leave-request-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.leave-status { border-radius: 20px; padding: 7px 10px; background: #edf2f1; font-size: 12px; font-weight: 700; }
.leave-status-pending { background: #fff0cd; color: #845b05; }
.leave-status-approved { background: #dff5e7; color: #157249; }
.leave-status-rejected { background: #ffe8e3; color: #a82d18; }
.leave-status-cancelled { color: #677672; }
.leave-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: 28px; color: var(--ink); box-shadow: var(--shadow); }
.leave-dialog::backdrop { background: #0c282a88; }
.leave-dialog .section-heading h2 { margin: 0; }
.leave-date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.leave-check { display: flex !important; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 10px; background: #fff1db; }
.leave-check input { width: auto; margin-top: 4px; }
.leave-unconfigured { font-size: 20px; font-weight: 700; color: #9c6a26; }
.leave-badge { margin-left: auto; padding: 2px 7px; border-radius: 20px; background: #edbf59; color: #273c39; }
@media(max-width: 650px) { .leave-date-fields { grid-template-columns: 1fr; } .leave-balances { grid-template-columns: 1fr; } .leave-section { padding: 16px; } .leave-dialog { padding: 20px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: #f7faf9; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.035em; }
h2 { margin-bottom: 8px; font-size: 21px; letter-spacing: -.02em; }
.muted { color: var(--muted); line-height: 1.5; }
.eyebrow { margin-bottom: 7px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px 18px; background: #112d2b; color: #fff; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 0 8px 26px; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: #9bc5c0; margin-top: 3px; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; color: #103c38; background: #83e1d3; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.nav-list { display: grid; gap: 6px; }
.nav-item { border: 0; border-radius: 11px; padding: 11px 12px; background: transparent; color: #bad2cf; text-align: left; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.nav-item:hover, .nav-item.is-active { background: rgba(131, 225, 211, .13); color: #fff; }
.nav-item span { width: 20px; text-align: center; color: #83e1d3; font-size: 18px; }
.future-modules { margin: 30px 8px 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 12px; }
.future-modules p { margin: 0 0 2px; color: #6f9d98; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.future-modules span { color: #8eaaa7; font-size: 13px; display: flex; justify-content: space-between; }
.future-modules small { padding: 2px 6px; border-radius: 12px; background: rgba(255,255,255,.08); font-size: 10px; }
.sidebar-user { margin-top: auto; display: grid; grid-template-columns: 36px 1fr 32px; gap: 10px; align-items: center; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user small { color: #8eb2ae; margin-top: 3px; font-size: 11px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #2a4e4a; display: grid; place-items: center; font-weight: 900; color: #a8ece2; }
.sidebar .icon-button { color: #bdd5d2; }

.main-content { min-width: 0; padding: 38px 42px 60px; }
.view-panel { max-width: 1520px; margin: 0 auto; }
.generator-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(270px, .7fr); gap: 22px; align-items: start; }
.generator-card { padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.generator-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 24px 0; }
.generator-fields label { display: grid; gap: 7px; color: #38524f; font-size: 14px; font-weight: 750; }
.generator-fields label small { font-size: 12px; font-weight: 500; line-height: 1.35; }
.generator-fields label small.is-error { color: var(--danger); }
.generator-destination { display: grid; gap: 10px; margin: 0 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.generator-destination legend { padding: 0 6px; color: #38524f; font-size: 14px; font-weight: 750; }
.generator-destination label { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.generator-destination input { accent-color: var(--accent); }
.generator-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.generator-actions #generator-both { grid-column: 1 / -1; min-height: 48px; }
.generator-status { min-height: 22px; margin: 18px 0 0; color: var(--accent-strong); font-size: 14px; }
.generator-status.is-error { color: var(--danger); }
.generator-summary dl { margin: 22px 0; }
.generator-summary dl div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.generator-summary dt { color: var(--muted); }
.generator-summary dd { margin: 0; text-align: right; font-weight: 750; }
@media (max-width: 950px) { .generator-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .generator-fields { grid-template-columns: 1fr; } .generator-card { padding: 20px; } }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header p:last-child { margin-bottom: 0; }
.header-controls { display: flex; align-items: flex-end; gap: 10px; }
.direction-switcher { display: flex; gap: 4px; padding: 4px; border: 1px solid #d7e1e0; border-radius: 12px; background: #fff; }
.direction-switcher button { min-height: 34px; border: 0; border-radius: 8px; padding: 7px 13px; color: #526a67; background: transparent; font-size: 12px; font-weight: 800; }
.direction-switcher button:hover { background: var(--soft); }
.direction-switcher button.is-active { color: #fff; background: var(--accent); box-shadow: 0 4px 12px rgba(15,118,110,.16); }
.manager-picker { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
select, input, textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid #cfdcda; border-radius: 10px; padding: 10px 12px; outline: none; }
select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.manager-picker select { min-width: 200px; }
.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 10px; padding: 10px 16px; min-height: 40px; font-weight: 800; }
.primary-button { color: #fff; background: var(--accent); box-shadow: 0 5px 14px rgba(15,118,110,.18); }
.primary-button:hover { background: var(--accent-strong); }
.secondary-button { color: #31504d; background: #fff; border: 1px solid #d7e1e0; }
.secondary-button:hover { background: var(--soft); }
.danger-button { color: var(--danger); background: var(--danger-soft); }
.full-width { width: 100%; }
.segmented { display: flex; border: 1px solid #d7e1e0; border-radius: 10px; overflow: hidden; background: #fff; }
.segmented button { width: 40px; height: 40px; border: 0; background: #fff; color: #405b58; font-size: 19px; }
.segmented button + button { border-left: 1px solid #d7e1e0; }
.segmented button:hover { background: var(--soft); }
.icon-button { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 20px; }
.icon-button:hover { background: rgba(255,255,255,.1); }

.calendar-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 12px; }
.sync-warning { margin-bottom: 16px; padding: 15px 18px; border: 1px solid #f2c9a5; border-radius: 12px; background: #fff7ed; color: #824516; display: grid; gap: 5px; font-size: 13px; }
.sync-warning span { color: #9a5b27; }
.sync-warning ul { margin: 5px 0 0; padding-left: 19px; }
.sync-warning a { color: #824516; font-weight: 800; }
.calendar-summary > strong { font-size: 15px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; color: #526662; font-size: .875rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.free { background: #42baa9; }
.dot.booked { background: var(--violet); }
.dot.blocked { background: #9c927d; }
.dot.confirmed { background: #2563eb; }
.dot.rescheduled { background: #d97706; }
.dot.not-held { background: #dc2626; }
.dot.held { background: #16a34a; }
.loading-card { min-height: 360px; border: 1px solid var(--line); border-radius: 16px; background: #fff; display: grid; place-items: center; color: var(--muted); }
.calendar-grid { display: grid; grid-template-columns: 72px repeat(7, minmax(138px, 1fr)); min-width: 1050px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--line); gap: 1px; box-shadow: var(--shadow); }
.calendar-grid-wrap { overflow-x: auto; padding: 0 0 18px; }
.calendar-corner, .day-heading, .time-cell, .slot-cell { background: #fff; }
.calendar-corner { min-height: 86px; }
.day-heading { min-height: 86px; padding: 13px 10px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; }
.day-heading.is-today { background: #edfaf7; }
.day-heading strong { font-size: 14px; }
.day-heading span { color: var(--muted); margin-top: 4px; font-size: 12px; }
.day-heading .day-action { margin-top: 7px; border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 800; padding: 2px 5px; }
.day-heading .day-action:hover { text-decoration: underline; }
.time-cell { min-height: 68px; padding: 14px 9px; color: #607472; text-align: right; font-size: 12px; font-weight: 800; }
.slot-cell { min-height: 68px; padding: 6px; }
.slot-button { width: 100%; min-height: 55px; border: 1px solid transparent; border-radius: 10px; padding: 7px 8px; text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 3px; transition: transform .12s ease, border-color .12s ease; }
.slot-button strong, .slot-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.slot-button strong { font-size: 12px; }
.slot-button small { font-size: 10px; opacity: .76; }
.slot-button.free { color: #176d64; background: #effaf7; border-color: #d4f0eb; }
.slot-button.free:hover { border-color: #56bcae; transform: translateY(-1px); }
.slot-button.booked { color: #5140ad; background: var(--violet-soft); border-color: #ddd7ff; }
.slot-button.booked:hover { border-color: #9486e8; }
.slot-button.booked strong { font-size: .875rem; }
.slot-button .slot-status { font-size: .875rem; font-weight: 700; line-height: 1.3; }
.slot-button.booked small { font-size: .75rem; }
.slot-button.booked.meeting-confirmed { color: #1e40af; background: #dbeafe; border-color: #93c5fd; }
.slot-button.booked.meeting-rescheduled { color: #78350f; background: #fef08a; border-color: #eab308; }
.slot-button.booked.meeting-not_held { color: #991b1b; background: #fecaca; border-color: #f87171; }
.slot-button.booked.meeting-held { color: #064e24; background: #4ade80; border-color: #16a34a; }
.slot-button.booked:hover { filter: brightness(.97); }
.slot-button:focus-visible { outline: 3px solid #17252a; outline-offset: 2px; }
.meeting-status-help { margin: 0; font-size: .875rem; }
.dialog-actions { flex-wrap: wrap; }
.slot-button.blocked { color: #716957; background: var(--sand); border-color: #e4dece; }
.slot-button.blocked:hover { border-color: #bfb399; }
.slot-button.unavailable { color: #a0acaa; background: #f7f9f8; border: 0; cursor: default; align-items: center; }

.dashboard-header { align-items: center; }
.dashboard-header-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.dashboard-product-home { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dashboard-product-card { position: relative; min-height: 210px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #fff, #f4fbf9); box-shadow: 0 14px 35px rgba(30,65,62,.07); color: #173d39; text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; cursor: pointer; }
.dashboard-product-card:nth-child(2) { background: linear-gradient(145deg, #fff, #f4f7ff); }
.dashboard-product-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.dashboard-product-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.dashboard-product-card strong { font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.dashboard-product-card > span:not(.eyebrow):not(.dashboard-product-arrow) { color: var(--muted); font-size: 14px; }
.dashboard-product-arrow { position: absolute; right: 26px; top: 26px; color: var(--accent); font-size: 24px; }
.zp-commission-chart { margin: 20px 0; }
.zp-commission-breakdown { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: #173d39; font-size: 13px; font-weight: 700; cursor: pointer; }
.zp-commission-breakdown input { width: 18px; height: 18px; accent-color: var(--accent); }
.zp-commission-chart-scroll { overflow-x: auto; padding: 6px 2px 12px; }
.zp-commission-columns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(126px, 1fr); gap: 12px; min-width: 100%; }
.zp-commission-column { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.zp-commission-column-value { display: flex; align-items: flex-end; justify-content: center; min-height: 42px; font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.zp-commission-column-plot { display: flex; flex-direction: column; width: 100%; height: 190px; border-bottom: 2px solid #b5c9c4; background: linear-gradient(#f7fbfa, #eef7f4); border-radius: 10px 10px 0 0; }
.zp-commission-column-positive, .zp-commission-column-negative { display: flex; justify-content: center; width: 100%; min-height: 0; }
.zp-commission-column-positive { flex: 1; align-items: flex-end; }
.zp-commission-column-plot.is-bipolar .zp-commission-column-positive { flex: 1; }
.zp-commission-column-negative { flex: 1; align-items: flex-start; border-top: 2px solid #b5c9c4; }
.zp-commission-column-plot.is-bipolar { border-bottom: 0; }
.zp-commission-column-plot i { display: block; width: min(58px, 62%); background: #108c80; border-radius: 7px 7px 0 0; }
.zp-commission-column-negative i { background: #e46d69; border-radius: 0 0 7px 7px; }
.zp-commission-column-month { margin-top: 9px; min-height: 34px; font-size: 12px; font-weight: 700; }
.zp-commission-trend { border-radius: 10px; padding: 6px; font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 700; overflow-wrap: anywhere; }
.zp-commission-trend.is-up { color: #087348; background: #e3f7eb; }
.zp-commission-trend.is-down { color: #b13939; background: #fdeaea; }
.zp-commission-trend.is-flat, .zp-commission-trend.is-unknown { color: var(--muted); background: #f1f4f3; }
.zp-commission-filter-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 12px; }
.zp-commission-filter-modes button { min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #365b55; font-weight: 700; cursor: pointer; }
.zp-commission-filter-modes button.is-active { border-color: var(--accent); color: var(--accent-strong); background: #e8f6f2; }
.zp-commission-selected-clients { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.zp-commission-selected-clients button { border: 1px solid #b9d9d0; border-radius: 999px; padding: 5px 10px; color: #205c51; background: #eef8f5; cursor: pointer; }
.zp-commission-client-toolbar .dashboard-date { min-width: min(100%, 320px); }
.zp-commission-client-link { border: 0; padding: 0; color: var(--accent); background: transparent; text-align: left; font: inherit; font-weight: 700; cursor: pointer; }
.zp-commission-client-link:hover, .zp-commission-client-link.is-active { text-decoration: underline; }
.zp-section-switcher { display: inline-flex; margin: 0 0 18px; }
.zp-dynamics-table { min-width: 950px; }
.zp-dynamics-table td { font-variant-numeric: tabular-nums; }
.zp-dynamics-table tr.is-selected { background: #e8f6f2; }
.zp-positive { color: #087348; font-weight: 700; }
.zp-negative { color: #b13939; font-weight: 700; }
#zp-dynamics-detail { margin-top: 24px; }
.dashboard-toolbar { margin-bottom: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 10px 30px rgba(30,65,62,.06); display: flex; align-items: flex-end; gap: 12px; }
.period-switcher { display: flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--soft); }
.period-switcher button { min-height: 36px; border: 0; border-radius: 8px; padding: 7px 15px; color: #58706d; background: transparent; font-size: 12px; font-weight: 800; }
.period-switcher button:hover { color: var(--accent); }
.period-switcher button.is-active { color: var(--accent-strong); background: #fff; box-shadow: 0 3px 12px rgba(30,65,62,.10); }
.dashboard-date { min-width: 160px; display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.dashboard-date input { min-height: 44px; }
.dashboard-updated { margin-left: auto; align-self: center; max-width: 250px; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: right; }
.dashboard-updated a { color: var(--accent); font-weight: 800; text-decoration: none; }
.dashboard-updated a:hover { text-decoration: underline; }
.dashboard-period-label { min-height: 35px; padding: 2px 3px 10px; color: #46625f; font-size: 13px; }
.dashboard-section + .dashboard-section { margin-top: 34px; }
.section-heading { margin-bottom: 13px; display: flex; align-items: flex-end; justify-content: space-between; }
.section-heading h2 { margin-bottom: 0; font-size: 22px; }
.metric-grid { display: grid; gap: 14px; }
.metric-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid-renewals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card { min-height: 156px; padding: 21px 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, #fff, #f9fcfb); box-shadow: 0 14px 35px rgba(30,65,62,.07); display: flex; flex-direction: column; }
.metric-card > span { color: #4f6865; font-size: 12px; font-weight: 800; }
.metric-card > strong { margin: 18px 0 13px; color: #173d39; font-size: clamp(32px, 4vw, 48px); line-height: .95; letter-spacing: -.045em; }
.metric-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(23,61,57,.32); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.metric-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.metric-link[aria-disabled="true"] { pointer-events: none; text-decoration: none; }
.metric-card > small { margin-top: auto; color: var(--muted); font-size: 11px; line-height: 1.4; }
.metric-card.metric-money { border-color: #cfe7e2; background: linear-gradient(145deg, #f0fbf8, #fff); }
.metric-card.metric-money > strong { color: var(--accent); font-size: clamp(27px, 3.2vw, 42px); }
.metric-card.metric-rate { border-color: #bfdbfe; background: linear-gradient(145deg, #eff6ff, #fff); }
.metric-card.metric-rate > strong { color: #1d4ed8; }
.history-toolbar { align-items: flex-end; }
.history-scope-note { margin: -2px 2px 16px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.history-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.history-chart-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 14px 35px rgba(30,65,62,.07); }
.history-chart-card h2 { margin-bottom: 4px; }
.history-chart-card > p { margin-bottom: 14px; font-size: .875rem; }
.history-chart { width: 100%; height: auto; display: block; overflow: visible; }
.history-chart text { fill: #647875; font-family: inherit; font-size: 11px; }
.chart-grid { stroke: #e6eeed; stroke-width: 1; }
.chart-axis { stroke: #b9cac7; stroke-width: 1; }
.chart-empty { min-height: 250px; display: grid; place-items: center; color: var(--muted); text-align: center; font-size: .875rem; }
.chart-legend { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: #526662; font-size: .875rem; }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-violet { background: #6d5bd0; }
.chart-teal { background: #0f766e; }
.chart-amber { background: #f59e0b; }
.chart-blue { background: #2563eb; }
.chart-purple { background: #7c3aed; }
.chart-aqua { background: #14b8a6; }
.chart-slate { background: #334155; }

.settings-card, .info-card { border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.settings-card { padding: 24px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.settings-card p { margin-bottom: 0; }
.settings-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 26px; font-weight: 900; }
.info-card { margin-top: 18px; padding: 24px 26px; color: #455e5b; }
.info-card ol { margin-bottom: 0; padding-left: 21px; line-height: 1.8; }
.amo-status { margin: 12px 0 0 !important; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--accent); }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.team-grid .settings-card { display: flex; flex-direction: column; align-items: stretch; }
.stack-form { display: grid; gap: 15px; }
.stack-form label { display: grid; gap: 6px; color: #38524f; font-size: 12px; font-weight: 800; }
.direction-access { margin: 0; padding: 0; border: 0; }
.direction-access legend { margin-bottom: 8px; color: #38524f; font-size: 12px; font-weight: 800; }
.direction-access > div { display: flex; flex-wrap: wrap; gap: 8px; }
.direction-check { display: inline-flex !important; grid-template-columns: 16px auto; align-items: center; gap: 7px !important; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.direction-check input { width: 16px; height: 16px; margin: 0; }

dialog { width: min(520px, calc(100vw - 30px)); border: 0; border-radius: 18px; padding: 0; color: var(--ink); box-shadow: 0 30px 90px rgba(19,47,44,.28); }
dialog::backdrop { background: rgba(11,35,33,.52); backdrop-filter: blur(3px); }
.dialog-card { padding: 25px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.dialog-heading .icon-button { flex: 0 0 auto; color: var(--muted); background: var(--soft); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.reschedule-fields { margin: 0; padding: 16px; border: 1px solid #eab308; border-radius: 12px; background: #fffbeb; min-width: 0; }
.reschedule-fields legend { padding: 0 5px; font-size: 1rem; font-weight: 700; color: #78350f; }
.reschedule-fields label { margin-bottom: 12px; font-size: .875rem; }
.reschedule-fields p, .reschedule-info p { margin: 8px 0 0; font-size: .875rem; line-height: 1.5; }
.reschedule-info { padding: 14px; border: 1px solid #eab308; border-radius: 12px; background: #fef9c3; color: #78350f; }
.reason-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.reason-option { position: relative; }
.reason-option input { position: absolute; opacity: 0; pointer-events: none; }
.reason-option span { min-height: 62px; border: 1px solid var(--line); border-radius: 11px; padding: 11px; display: flex; align-items: center; justify-content: center; text-align: center; color: #536865; font-size: 12px; font-weight: 800; }
.reason-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: 0 0 0 2px rgba(15,118,110,.08); }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; font-weight: 700; }
.toast { position: fixed; right: 26px; bottom: 26px; z-index: 50; max-width: 380px; padding: 13px 16px; color: #fff; background: #143d39; border-radius: 11px; box-shadow: var(--shadow); font-size: 13px; font-weight: 700; }

.login-page { background: #eaf3f1; display: grid; place-items: center; padding: 28px; }
.login-shell { width: min(960px, 100%); min-height: 590px; display: grid; grid-template-columns: 1.15fr .85fr; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 100px rgba(25,64,60,.18); }
.login-aside { padding: 45px; background: #123d39; color: #fff; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-aside::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; right: -160px; bottom: -160px; border: 70px solid rgba(131,225,211,.09); }
.login-aside .brand-mark { margin-bottom: 56px; }
.login-aside h1 { font-size: 46px; max-width: 430px; }
.login-aside p:not(.eyebrow) { color: #b7d4d0; line-height: 1.65; max-width: 430px; }
.login-slot-preview { position: relative; z-index: 1; width: 320px; display: grid; grid-template-columns: 60px 1fr; gap: 7px 12px; align-items: center; }
.login-slot-preview span { color: #88aaa6; font-size: 12px; font-weight: 800; }
.login-slot-preview strong { color: #174b45; background: #b2eee5; padding: 9px 11px; border-radius: 9px; font-size: 12px; }
.login-slot-preview .preview-booked { color: #5140ad; background: #ded8ff; }
.login-slot-preview .preview-blocked { color: #645d4d; background: #e9e2d2; }
.login-card { padding: 54px 48px; background: #fff; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { font-size: 30px; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand > span:last-child, .nav-item:not(.is-active) ~ span, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item span { font-size: 20px; }
  .future-modules, .sidebar-user > div:nth-child(2) { display: none; }
  .sidebar-user { grid-template-columns: 36px; justify-content: center; }
  .sidebar-user .icon-button { display: none; }
  .main-content { padding-inline: 25px; }
  .page-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 40; left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 70px; padding: 8px 14px; flex-direction: row; align-items: center; box-shadow: 0 -10px 35px rgba(17,45,43,.18); }
  .brand, .future-modules, .sidebar-user { display: none; }
  .nav-list { width: 100%; display: flex; justify-content: space-around; }
  .nav-item { font-size: 11px; flex-direction: column; gap: 2px; padding: 4px 10px; }
  .nav-item span { font-size: 18px; }
  .main-content { padding: 25px 16px 100px; }
  .header-controls { width: 100%; flex-wrap: wrap; }
  .direction-switcher { flex: 1 0 100%; }
  .direction-switcher button { flex: 1; }
  .manager-picker { flex: 1 0 100%; }
  .manager-picker select { min-width: 0; }
  .calendar-summary { align-items: flex-start; flex-direction: column; }
  .legend { flex-wrap: wrap; }
  .dashboard-toolbar { align-items: stretch; flex-direction: column; }
  .dashboard-header-controls { width: 100%; justify-content: flex-start; }
  .dashboard-product-home { grid-template-columns: 1fr; }
  .zp-commission-column-plot { height: 155px; }
  .period-switcher { width: 100%; }
  .period-switcher button { flex: 1; padding-inline: 8px; }
  .dashboard-date { width: 100%; }
  .dashboard-updated { margin-left: 0; align-self: flex-start; text-align: left; }
  .metric-grid-two, .metric-grid-three, .metric-grid-four, .metric-grid-renewals { grid-template-columns: 1fr; }
  .history-charts { grid-template-columns: 1fr; }
  .metric-card { min-height: 138px; }
  .team-grid { grid-template-columns: 1fr; }
  .settings-card { grid-template-columns: auto 1fr; }
  .settings-card > button { grid-column: 1 / -1; }
  .login-page { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
  .login-aside { min-height: 280px; padding: 32px; }
  .login-aside .brand-mark, .login-slot-preview { display: none; }
  .login-aside h1 { font-size: 36px; }
  .login-card { padding: 38px 30px; }
}
/* Payouts extend the existing workspace palette and table layout. */
.payout-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.payout-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.payout-components { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.payout-components > div { display: grid; gap: 8px; padding: 16px; background: #f6f8fc; border-radius: 12px; }
.payout-components strong { font-size: 1.25rem; }
.payout-kpi-form { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin: 24px 0; }
.payout-kpi-form label { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.payout-kpi-form input[type="checkbox"] { width: 20px; height: 20px; }
.table-scroll { overflow-x: auto; }
.payout-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.payout-table th, .payout-table td { text-align: left; padding: 14px 12px; border-bottom: 1px solid #e4e8f1; vertical-align: top; }
.payout-table th { background: #f3f5fa; font-weight: 600; white-space: nowrap; }
.payout-table td:nth-child(n+4) { font-variant-numeric: tabular-nums; }
.payout-table small { display: block; color: #68738a; margin-top: 6px; }
.payout-table a { overflow-wrap: anywhere; }
.payout-empty-row { color: #68738a; }
.payout-issue-row { background: #fff6dc; }
.payout-undated-links { display: grid; gap: 12px; }
@media (max-width: 1100px) { .payout-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .payout-metrics, .payout-components { grid-template-columns: 1fr; } .payout-table { min-width: 720px; } }
.team-list-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.team-table { min-width: 900px; }
.team-table td { vertical-align: middle; }
.team-direction { display: inline-block; padding: 5px 9px; margin: 3px 0; border-radius: 8px; color: var(--accent-strong); background: var(--accent-soft); }
.team-email { overflow-wrap: anywhere; }
.team-access-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.license-breakdowns { display: flex; gap: 24px; flex-wrap: wrap; }
.license-chart-scroll { overflow-x: auto; margin: 20px 0; }
.license-history-chart { width: auto; min-width: 760px; max-width: none; }
#licenses-panel .metric-grid { margin-top: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); }
#licenses-panel .metric-card > strong { font-size: clamp(25px, 2.5vw, 36px); overflow-wrap: anywhere; }
.license-forecast { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.license-forecast[hidden] { display: none; }
.license-forecast > span, .license-forecast > small { display: block; font-size: 11px; line-height: 1.4; }
.license-forecast > strong { display: block; margin: 5px 0; color: #6d8581; font-size: clamp(18px, 1.8vw, 24px); font-weight: 650; line-height: 1.1; overflow-wrap: anywhere; }
#licenses-mode { margin-bottom: 14px; }
#licenses-panel .history-toolbar { flex-wrap: wrap; }
#licenses-panel .history-toolbar a { white-space: nowrap; font-size: .875rem; }
.credential-field { display: flex; gap: 6px; align-items: center; }
.credential-field input { width: 200px; max-width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.text-button { background: none; border: 0; color: var(--danger); font-size: .875rem; }
#employee-dialog { width: min(700px, calc(100vw - 30px)); }
.employee-dialog-card { max-height: 85vh; overflow: auto; }
.employee-role-field { display: grid; gap: 8px; margin-bottom: 18px; }
.employee-role-field select { padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.employee-dialog-card .settings-card { box-shadow: none; }
.employee-dialog-card .settings-card, #document-upload-form { display: flex; flex-direction: column; align-items: stretch; }
.employee-dialog-card .stack-form label, #document-upload-form label, .employee-dialog-card legend { font-size: .875rem; }
.payout-kpi-readonly { display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0; }
.kpi-status-card { display: grid; gap: 10px; min-width: 210px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.kpi-done { color: var(--accent-strong); }
.kpi-pending { color: var(--muted); }
.document-toolbar, .document-form-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin: 16px 0; }
.document-toolbar label { display: grid; gap: 8px; }
.document-toolbar select, .document-toolbar input { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.document-archive { margin: 20px 0; }
.document-archive h3 { margin-top: 0; }
#document-upload-form { max-width: 650px; }
