/* OT Platform — brand UI. Palette: Forest Green #209362 (primary), Lime #70c64d (hover),
   Warm Orange #e5a665 (accent / pending), Cyan #55d9e7 (highlights), Bright Green #1aff69 (success), Black #000. */

:root {
  --green: #209362;
  --green-dark: #187a51;
  --lime: #70c64d;
  --bright: #1aff69;
  --cyan: #55d9e7;
  --orange: #e5a665;
  --black: #000000;
  --ink: #0f1a14;
  --text: #1b2620;
  --muted: #66756c;
  --line: #e3ebe6;
  --bg: #f5f8f6;
  --card: #ffffff;
  --danger: #c8463d;
  --green-50: #e9f6ef;
  --orange-50: #fcf2e7;
  --cyan-50: #e7fafc;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 26, 20, .04), 0 4px 16px rgba(15, 26, 20, .05);
  --sidebar: 248px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; font-weight: 400; -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }
h1, h2, h3 { font-weight: 600; color: var(--ink); margin: 0; }
p { margin: 0 0 .75em; }
code, .mono, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.lead { font-size: 15px; margin-bottom: 18px; }
.error { color: var(--danger); }
.nowrap { white-space: nowrap; }
.opt { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar); background: #0d1f16; color: #cfe3d8;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: #fff; font-weight: 600; font-size: 16px; }
.brand:hover { color: #fff; text-decoration: none; }
.brand { flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-logo { display: block; width: 150px; height: auto; }
.brand-app { font-size: 13px; font-weight: 500; color: #9fc2b0; letter-spacing: .02em; padding-left: 2px; }
.sidebar nav { padding: 6px 12px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 2px 0; border-radius: 10px;
  color: #cfe3d8; font-weight: 500; transition: background .15s, color .15s;
}
.nav-link svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--green); color: #fff; box-shadow: inset 3px 0 0 var(--bright); }
.nav-count { margin-left: auto; background: var(--orange); color: #2b1b07; border-radius: 999px; font-size: 11px; font-weight: 600; padding: 1px 8px; }
.nav-section { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: #7fa08e; padding: 16px 12px 4px; font-weight: 500; }
.sidebar-foot { padding: 14px 20px; font-size: 11px; color: #7fa08e; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.page-title { font-size: 19px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; display: block; }
.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; cursor: pointer; font: inherit; color: inherit; }
.user-chip:hover { border-color: var(--green); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--lime)); color: #fff; display: grid; place-items: center; font-weight: 600; }
.user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-meta strong { font-weight: 500; font-size: 13px; }
.user-meta small { color: var(--muted); font-size: 11px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; display: none; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--green-50); text-decoration: none; }

/* ---------- cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 640px; }
.pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head.pad { margin-bottom: 0; border-bottom: 1px solid var(--line); }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3-1 { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 20px; }
.grid-2 > .card, .grid-3-1 > .card, .grid-3-1 > form, .grid-3-1 > aside { margin-bottom: 0; }
.grid-2, .grid-3-1 { margin-bottom: 20px; }
.stack > * + * { margin-top: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; color: inherit;
}
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--green); }
.kpi-green::before { background: var(--bright); }
.kpi-orange::before { background: var(--orange); }
.kpi-cyan::before { background: var(--cyan); }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-value { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.2; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-link:hover { text-decoration: none; border-color: var(--green); }
.kpi-link.on { border-color: var(--green); background: var(--green-50); }

.meter { height: 7px; background: #edf2ef; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--lime)); border-radius: 99px; transition: width .4s; }
.meter.lg { height: 11px; }
.fill { display: flex; flex-direction: column; min-width: 150px; }
.fill.compact { min-width: 130px; }
.big-fill { display: flex; align-items: baseline; gap: 6px; }
.big-fill strong { font-size: 38px; font-weight: 700; color: var(--ink); }
.big-fill span { color: var(--muted); }

.chart-box { position: relative; height: 280px; }
.chart-box.chart-sm { height: 240px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 500; font-size: 13.5px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; background: #eef3f0; color: var(--ink);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap; line-height: 1.3;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(85, 217, 231, .55); outline-offset: 1px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--lime); color: #0d1f16; }
.btn-outline { background: #fff; border-color: #cfded5; color: var(--green-dark); }
.btn-outline:hover { border-color: var(--green); background: var(--green-50); color: var(--green-dark); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: #eef3f0; color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a9382f; color: #fff; }
.btn.danger { color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row form { margin: 0; }
.btn-ms { gap: 10px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-weight: 500; font-size: 13px; color: var(--ink); }
.field small { color: var(--muted); font-size: 12px; }
.field small.error { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=search], input[type=file], select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: #fff; border: 1px solid #d3e0d8; border-radius: var(--radius-sm);
  padding: 9px 12px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(32, 147, 98, .12); outline: none; }
textarea { resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; flex: 0 0 16px; }
.check span small { display: block; color: var(--muted); font-size: 12px; }
.radio-row { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 12px; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.fieldset > * + * { margin-top: 10px; }
.fieldset legend { font-weight: 500; padding: 0 6px; }
.form-grid .card { margin-bottom: 18px; }
.form-grid .card > * + * { margin-top: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.form-actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 18px 0 8px; }
.actions { display: flex; gap: 10px; }
.team-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 7px 14px; border: 1px solid #d3e0d8; border-radius: 999px; font-weight: 500; font-size: 13px; transition: all .15s; }
.chip-check input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.chip-check input:focus-visible + span { outline: 3px solid rgba(85,217,231,.55); }
.chip { border: 1px solid #d3e0d8; background: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace; }
.chip:hover { border-color: var(--cyan); background: var(--cyan-50); }
.ph-list { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-form .card > * + * { margin-top: 16px; }
.setting-row strong { font-weight: 500; }
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit input[name=name] { max-width: 220px; font-weight: 500; }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar p { margin: 0; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-group input, .toolbar-group select { width: auto; padding: 7px 10px; font-size: 13px; }
.segmented { display: inline-flex; background: #e9efeb; border-radius: 11px; padding: 3px; flex-wrap: wrap; }
.segmented a { padding: 6px 13px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 13px; }
.segmented a:hover { color: var(--ink); text-decoration: none; }
.segmented a.on { background: #fff; color: var(--green-dark); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.filters .field > span { font-size: 12px; }
.filters input, .filters select { padding: 7px 10px; font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--green-dark); border-bottom-color: var(--green); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 11px 16px; background: #fafcfb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid #eef3f0; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafdfb; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 600; background: var(--green-50); border-top: 2px solid var(--green); }
.table tr.dim td { opacity: .55; }
.row-link { cursor: pointer; }
.actions-cell { text-align: right; white-space: nowrap; }
.actions-cell form { display: inline; }
.check-col, .bulk-col { width: 36px; }
.check-col input, .bulk-col input { accent-color: var(--green); width: 16px; height: 16px; }
.internal { color: #8a5a1e; background: var(--orange-50); padding: 1px 6px; border-radius: 4px; display: inline-block; margin-top: 2px; }
.bulk-bar { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafcfb; flex-wrap: wrap; }
.bulk-bar input { flex: 1; min-width: 200px; padding: 7px 10px; font-size: 13px; }
.audit-table td.mono div { word-break: break-all; }
.report-table td { white-space: nowrap; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; letter-spacing: .01em; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.st-draft { background: #eef1ef; color: #5a6760; }
.st-published, .st-open { background: var(--cyan-50); color: #137a87; }
.st-scheduled { background: #eef7ff; color: #2c6ba3; }
.st-pending, .st-queued, .st-sending { background: var(--orange-50); color: #8a5a1e; }
.st-approved, .st-sent { background: var(--green-50); color: var(--green-dark); }
.st-approved::before, .st-sent::before { background: var(--bright); box-shadow: 0 0 0 2px rgba(26,255,105,.25); }
.st-waitlisted { background: #f1fbe9; color: #4a8a2c; }
.st-rejected, .st-failed { background: #fdeceb; color: var(--danger); }
.st-canceled, .st-expired, .st-skipped { background: #f0f2f1; color: #6f7a74; }
.st-completed { background: #111; color: #fff; }
.st-completed::before { background: var(--bright); }
.st-full { background: #fff3e3; color: #8a5a1e; }
.role-tag { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: #eef3f0; }
.role-admin { background: #111; color: #fff; }
.role-wfm { background: var(--green-50); color: var(--green-dark); }
.role-auditor { background: var(--cyan-50); color: #137a87; }

/* ---------- alerts ---------- */
.alert { padding: 12px 16px; border-radius: 11px; margin-bottom: 16px; border: 1px solid; position: relative; padding-right: 40px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-success { background: var(--green-50); border-color: #bfe5d0; color: #145c3e; }
.alert-error { background: #fdeceb; border-color: #f4c7c3; color: #8c2a23; }
.alert-info { background: var(--cyan-50); border-color: #b9eef4; color: #0f5f69; }
.alert-warning { background: var(--orange-50); border-color: #f2d6b5; color: #7a4d14; }
.alert-close { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 20px; cursor: pointer; color: inherit; opacity: .6; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #eef3f0; }
.list li:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; }
.list-main:hover { text-decoration: none; }
.list-main:hover strong { color: var(--green); }
.list-main strong { font-weight: 500; }
.date-tile { width: 46px; flex: 0 0 46px; text-align: center; border-radius: 10px; background: var(--green-50); padding: 4px 0; line-height: 1.1; }
.date-tile span { font-size: 10.5px; text-transform: uppercase; color: var(--green-dark); font-weight: 600; }
.date-tile strong { display: block; font-size: 18px; color: var(--ink); }
.stat-list { list-style: none; padding: 0; margin: 16px 0 10px; }
.stat-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 12px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }

/* ---------- opportunity board ---------- */
.opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.opp-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden;
}
.opp-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--green), var(--lime), var(--cyan)); }
.opp-card.focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(85,217,231,.35), var(--shadow); }
.opp-card header { display: flex; gap: 6px; flex-wrap: wrap; }
.opp-card h3 { font-size: 17px; }
.opp-card footer { margin-top: auto; }
.opp-card details summary { cursor: pointer; color: var(--green-dark); font-weight: 500; }
.opp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.opp-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.opp-facts dd { margin: 0; font-weight: 500; }

/* ---------- opportunity detail ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.back { font-size: 13px; font-weight: 500; display: inline-block; margin-bottom: 6px; }
.head-badges { display: flex; gap: 10px; align-items: center; }
.opp-title { font-size: 22px; margin-bottom: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 20px; margin: 0 0 16px; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
h3.sub { font-size: 13px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 4px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bright); display: inline-block; box-shadow: 0 0 0 0 rgba(26,255,105,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(26,255,105,.55); } 70% { box-shadow: 0 0 0 8px rgba(26,255,105,0); } 100% { box-shadow: 0 0 0 0 rgba(26,255,105,0); } }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { display: flex; gap: 14px; padding: 8px 0; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 22px; bottom: -8px; width: 2px; background: #edf2ef; }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: #c7d5cc; flex: 0 0 10px; margin-top: 6px; position: relative; z-index: 1; }
.tl-approved, .tl-completed, .tl-published { background: var(--green); }
.tl-rejected, .tl-canceled, .tl-canceled_by_wfm, .tl-canceled_by_agent, .tl-canceled_with_ot { background: var(--danger); }
.tl-submitted, .tl-promoted { background: var(--orange); }
.tl-waitlisted, .tl-notified { background: var(--cyan); }
.changes { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }

/* ---------- reports ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.report-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); color: inherit; transition: border-color .15s, transform .15s; }
.report-card strong { font-weight: 600; color: var(--ink); }
.report-card:hover { border-color: var(--green); text-decoration: none; transform: translateY(-1px); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.pager div { display: flex; gap: 8px; }
pre.code { background: #0d1f16; color: #d4f5e2; padding: 12px 14px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state h2 { margin-bottom: 6px; }

/* ---------- modal ---------- */
.modal { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(13, 31, 22, .45); }
.modal form { padding: 24px; }
.modal form > * + * { margin-top: 14px; }
.modal h2 { font-size: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- auth ---------- */
.auth-body { background: #fff; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 480px) 1fr; }
.auth-panel { padding: 56px 56px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-panel > * + * { margin-top: 14px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand strong { display: block; font-size: 18px; color: var(--ink); }
.auth-brand small { color: var(--muted); }
.auth-brand { flex-direction: column; align-items: flex-start; gap: 14px; }
.auth-logo { display: block; width: 190px; height: auto; }
.auth-title { font-size: 26px; }
.auth-art { background: radial-gradient(circle at 20% 20%, rgba(26,255,105,.25), transparent 45%), radial-gradient(circle at 80% 70%, rgba(85,217,231,.3), transparent 45%), linear-gradient(140deg, #0d3b27, var(--green)); color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-art-inner { max-width: 460px; }
.auth-art h2 { color: #fff; font-size: 34px; line-height: 1.2; margin-bottom: 14px; }
.auth-art p { color: #d6efe2; font-size: 15px; }
.flow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.flow span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.flow span:nth-child(5) { background: var(--orange); color: #2b1b07; border-color: var(--orange); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.link-small { font-size: 13px; display: inline-block; }
.role-help ul { padding-left: 18px; margin: 8px 0 0; }
.role-help summary { cursor: pointer; color: var(--green-dark); font-weight: 500; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3-1 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .menu-btn { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { padding: 40px 24px; }
}
@media (max-width: 680px) {
  .content { padding: 16px 16px 40px; }
  .topbar { padding: 10px 16px; }
  .user-meta { display: none; }
  .user-chip { padding: 3px; }
  .kpis, .kpis-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .toolbar-group input, .toolbar-group select { flex: 1 1 140px; }
  /* Tables become stacked cards */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td, .table tfoot { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .table td { border: 0; padding: 4px 0; display: flex; gap: 12px; justify-content: space-between; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--muted); font-weight: 500; text-align: left; flex: 0 0 40%; }
  .table td.num { text-align: right; }
  .actions-cell { justify-content: flex-end; flex-wrap: wrap; }
  .report-table td { white-space: normal; }
  .inline-edit { flex-wrap: wrap; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
}

@media print {
  .sidebar, .topbar, .toolbar, .filters, .btn, .pager { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}
