:root {
  --ink: #102331;
  --muted: #64748b;
  --line: #d8e2ec;
  --bg: #f4f7fb;
  --navy: #102a56;
  --blue: #155eaa;
  --cyan: #0e7490;
  --green: #047857;
  --amber: #b45309;
  --red: #be123c;
  --card: #fff;
  --shadow: 0 16px 44px rgba(15, 42, 86, .09);
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.48 system-ui, -apple-system, "Segoe UI", sans-serif; }
.shell { display: grid; grid-template-columns: 286px minmax(0, 1fr); min-width: 0; min-height: 100vh; }
aside { position: sticky; top: 0; height: 100vh; padding: 22px 18px; overflow: auto; background: linear-gradient(180deg, #0b2148, #123f78 56%, #0e7490); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 19px; }
.brand span, .mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: #fff; color: var(--navy); font-weight: 950; }
.module { display: flex; gap: 12px; align-items: center; margin: 28px 0 22px; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .11); }
.module .mark { flex: 0 0 48px; background: #dbeafe; font-size: 12px; }
.module b, .module small { display: block; }
.module small { margin-top: 3px; color: #bae6fd; font-size: 10px; }
nav { display: grid; gap: 7px; }
nav button { width: 100%; min-height: 48px; padding: 10px 12px; border: 0; border-radius: 13px; background: transparent; color: #dbeafe; text-align: left; font: inherit; font-weight: 800; cursor: pointer; }
nav button:hover, nav button.active { background: #fff; color: var(--navy); }
aside footer { position: static; margin-top: 22px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, .18); }
aside footer b, aside footer small { display: block; }
aside footer small { color: #bae6fd; }
main { width: 100%; min-width: 0; padding: 26px 30px 60px; overflow: hidden; }
main > header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 20px; }
header p { margin: 0; color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
header h1 { margin: 3px 0 0; font-size: clamp(25px, 3vw, 39px); letter-spacing: -.035em; }
.actions { display: flex; align-items: end; gap: 9px; }
.actions label { font-size: 10px; font-weight: 850; color: var(--muted); }
select, input, textarea { width: 100%; min-height: 44px; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font: inherit; }
.actions select { min-width: 80px; margin-top: 2px; }
.actions a, .actions button { display: grid; place-items: center; min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--navy); font: inherit; font-weight: 850; text-decoration: none; cursor: pointer; }
#content { display: grid; min-width: 0; gap: 17px; }
#content > * { min-width: 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 18px; padding: 26px; border-radius: 24px; background: linear-gradient(135deg, #102a56, #155eaa 60%, #0e7490); color: #fff; box-shadow: var(--shadow); }
.hero h2 { margin: 0 0 8px; font-size: clamp(27px, 3.2vw, 43px); line-height: 1.12; }
.hero p { margin: 0; color: #dbeafe; }
.ai { padding: 16px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 17px; background: rgba(255, 255, 255, .1); }
.ai b, .ai small { display: block; }
.ai small { margin-top: 7px; color: #e0f2fe; }
.progress { height: 9px; margin-top: 13px; overflow: hidden; border-radius: 9px; background: rgba(255, 255, 255, .2); }
.progress span { display: block; height: 100%; background: #86efac; }
.kpis, .cards, .actions-grid { display: grid; min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.kpi, .card, .panel, .quick { border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 5px 20px rgba(15, 23, 42, .035); }
.kpi { padding: 16px; }
.kpi strong { display: block; margin-bottom: 4px; font-size: 27px; }
.kpi span, .panel-head p, .card p { color: var(--muted); }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { min-height: 170px; padding: 18px; }
.card .number { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #dbeafe; color: var(--navy); font-weight: 950; }
.card h3 { margin: 12px 0 4px; }
.state, .pill { display: inline-flex; padding: 5px 9px; border-radius: 99px; background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 900; }
.state.pending { background: #eff6ff; color: #1d4ed8; }
.state.ready, .pill.active, .pill.approved, .pill.paid, .pill.accepted, .pill.standard, .pill.converted, .pill.posted, .pill.reconciled, .pill.acknowledged, .pill.delivered, .pill.passed, .pill.completed { background: #dcfce7; color: #166534; }
.pill.rejected, .pill.declined, .pill.cancelled, .pill.lapsed, .pill.critical { background: #ffe4e6; color: #9f1239; }
.panel { padding: 20px; }
.panel-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.panel h2, .panel h3 { margin: 0; }
.panel-head p { margin: 5px 0 0; }
.primary, .quick, .dialog-actions button { min-height: 43px; padding: 10px 14px; border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.actions-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.quick { min-height: 72px; text-align: left; }
.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 11px 12px; border-bottom: 1px solid #edf2f6; text-align: left; font-size: 12px; }
th { background: #f8fafc; color: #475569; font-size: 10px; text-transform: uppercase; }
.empty { padding: 28px; border: 1px dashed #cbd5e1; border-radius: 14px; color: var(--muted); text-align: center; }
.notice { position: sticky; top: 10px; z-index: 5; margin-bottom: 15px; padding: 12px 15px; border-radius: 12px; background: #dcfce7; color: #166534; font-weight: 800; box-shadow: var(--shadow); }
.notice.error { background: #ffe4e6; color: #9f1239; }
dialog { width: min(820px, calc(100% - 30px)); max-height: 90vh; padding: 0; border: 0; border-radius: 22px; box-shadow: 0 30px 90px rgba(15, 23, 42, .28); }
dialog::backdrop { background: rgba(15, 23, 42, .55); }
dialog form { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; gap: 15px; }
.dialog-head small { color: var(--blue); font-weight: 900; }
.dialog-head h2 { margin: 3px 0 16px; }
.close { width: 42px; height: 42px; border: 0; border-radius: 11px; background: #f1f5f9; font-size: 25px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid label { font-size: 12px; font-weight: 850; color: #334155; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid textarea { min-height: 90px; }
.form-grid input[type="checkbox"] { width: 22px; min-height: 22px; }
.field-marker { margin-left: 5px; color: var(--blue); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.field-marker.optional { color: var(--muted); }
.check { display: flex; min-height: 52px; align-items: center; gap: 7px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; }
.check input { flex: 0 0 auto; margin: 0; }
.form-guidance, .form-blocker { padding: 14px 16px; border-radius: 14px; }
.form-guidance { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; }
.form-guidance b, .form-blocker b { display: block; margin-bottom: 4px; }
.form-guidance p, .form-blocker p { margin: 0; font-weight: 500; }
.form-blocker { border: 1px solid #f59e0b; background: #fffbeb; color: #92400e; }
.form-blocker strong { display: inline-block; margin-top: 7px; }
select:disabled, input:disabled, button:disabled { cursor: not-allowed; opacity: .58; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.dialog-actions .secondary { background: #e2e8f0; color: #334155; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #dbeafe, #f8fafc, #cffafe); }
.auth-gate section { max-width: 500px; padding: 36px; border: 1px solid var(--line); border-radius: 24px; background: #fff; text-align: center; box-shadow: var(--shadow); }
.auth-gate .mark { margin: auto; background: linear-gradient(135deg, var(--navy), var(--cyan)); color: #fff; font-size: 12px; }
.auth-gate a { display: inline-block; padding: 12px 22px; border-radius: 11px; background: var(--navy); color: #fff; text-decoration: none; font-weight: 900; }
@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .actions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hero { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .shell { display: block; width: 100%; } aside { position: static; width: 100%; max-width: 100vw; height: auto; padding: 13px; overflow: hidden; } .brand, .module, aside footer { display: none; } nav { display: flex; width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; } nav button { flex: 0 0 auto; width: auto; white-space: nowrap; } main { padding: 16px 13px 45px; } main > header { align-items: flex-start; } .actions { flex-wrap: wrap; justify-content: flex-end; } .actions button { font-size: 0; } .actions button::after { content: "⇥"; font-size: 18px; } .cards, .form-grid { grid-template-columns: 1fr; } .form-grid .wide { grid-column: auto; } .panel-head { flex-wrap: wrap; } .panel-head .primary { width: 100%; } }
@media (max-width: 480px) { .kpis, .cards, .actions-grid { grid-template-columns: 1fr; } .panel { padding: 15px; } header p { display: none; } }
[hidden] { display: none !important; }
