:root {
  --ink: #17252a;
  --muted: #66777c;
  --paper: #f4f2ec;
  --surface: #fffdfa;
  --line: #d9ddd9;
  --teal: #157a78;
  --teal-dark: #0d5657;
  --teal-soft: #e2f2ef;
  --gold: #c79b4b;
  --danger: #a23b3b;
  --warn: #9a6718;
  --shadow: 0 14px 38px rgba(23, 37, 42, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.identity-header { min-height: 94px; padding: 10px 24px 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; background: white; border-bottom: 1px solid var(--line); }
.identity-logo { display: block; width: auto; object-fit: contain; flex: 0 0 auto; }
.identity-logo-altaf { height: 70px; }
.identity-logo-consigliere { height: 45px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #123f42; color: white; padding: 26px 18px 18px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: #173b3b; font: 800 22px Georgia, serif; }
.brand strong { display: block; font: 700 20px Georgia, serif; letter-spacing: .2px; }
.brand small { display: block; color: #b9d3d0; margin-top: 2px; }
nav { display: grid; gap: 5px; margin-top: 24px; }
nav button { border: 0; background: transparent; color: #d7e7e5; text-align: left; padding: 11px 12px; border-radius: 8px; }
nav button:hover, nav button.active { background: rgba(255,255,255,.12); color: white; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.14); color: #b9d3d0; font-size: 12px; display: grid; gap: 12px; }
.storage-state { display: flex; gap: 8px; align-items: center; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #e7b95e; }
.status-dot.online { background: #63d5a4; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.compact { padding: 7px 10px; font-size: 12px; }
.auth-card { max-width: 680px; }
main { min-width: 0; padding: 0 34px 60px; }
.topbar { min-height: 104px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.eyebrow { color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: 1.8px; margin: 0 0 5px; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; }
h1 { font-size: 30px; margin: 0; }
h2 { font-size: 27px; margin: 0 0 10px; }
h3 { font-size: 18px; margin: 0 0 10px; }
.entity-context { text-align: right; display: grid; gap: 4px; }
.entity-context span { color: var(--muted); font-size: 12px; }
.hero-card, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.hero-card { max-width: 920px; padding: 42px; margin: 56px auto; }
.hero-card > p:not(.eyebrow) { color: var(--muted); max-width: 700px; line-height: 1.65; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
label { display: grid; gap: 7px; color: #304247; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cbd3d1; border-radius: 8px; padding: 10px 11px; background: white; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(21,122,120,.14); border-color: var(--teal); }
.primary, .secondary, .danger { border-radius: 8px; padding: 10px 15px; font-weight: 750; }
.primary { border: 1px solid var(--teal); background: var(--teal); color: white; }
.secondary { border: 1px solid var(--line); background: white; color: var(--ink); }
.danger { border: 1px solid #e5bcbc; background: #fff4f4; color: var(--danger); }
.form-grid > button { align-self: end; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.metric span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .6px; }
.metric strong { display: block; font: 700 25px Georgia, serif; margin-top: 9px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { padding: 22px; margin-bottom: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.card-head p, .muted { color: var(--muted); margin: 4px 0 0; font-size: 12px; }
.inline-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; }
.inline-form .wide { grid-column: span 2; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }
th, td { padding: 10px 8px; border-bottom: 1px solid #e8ebe8; }
td.number, th.number { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.badge.warn { background: #fff0cf; color: var(--warn); }
.empty { color: var(--muted); padding: 28px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.notice { margin: -12px 0 18px; padding: 12px 14px; border-radius: 8px; background: var(--teal-soft); color: var(--teal-dark); font-weight: 650; font-size: 13px; }
.notice.error { background: #fff0f0; color: var(--danger); }
.action-row { display: flex; flex-wrap: wrap; gap: 9px; }
.summary-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.summary-metric { min-height: 76px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; }
.summary-metric > span:first-child { display: block; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .55px; margin-bottom: 9px; }
.summary-metric strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.summary-block { margin-bottom: 18px; }
.summary-block h4, .card h4 { margin: 4px 0 9px; font-size: 13px; }
.summary-actions { align-items: center; margin-top: 16px; }
.statement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.statement-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid #eceeec; }
.statement-row.total { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 8px; }
.tool-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tool-link { display: block; padding: 18px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: white; }
.tool-link strong { display: block; color: var(--teal-dark); margin-bottom: 5px; }
.tool-link span { color: var(--muted); font-size: 12px; }
@media (max-width: 980px) { .app-shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } nav { grid-template-columns: repeat(3, 1fr); } .sidebar-foot { margin-top: 18px; } .metrics, .summary-metrics { grid-template-columns: repeat(2, 1fr); } .inline-form { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .identity-header { min-height: 64px; padding: 8px 12px 6px; gap: 18px; } .identity-logo-altaf { height: 49px; } .identity-logo-consigliere { height: 32px; } main { padding: 0 16px 40px; } .topbar { align-items: flex-start; padding-top: 22px; } .entity-context { display: none; } nav { grid-template-columns: 1fr 1fr; } .form-grid, .grid-2, .statement-grid, .tool-links { grid-template-columns: 1fr; } .metrics { grid-template-columns: 1fr 1fr; } .inline-form { grid-template-columns: 1fr; } .inline-form .wide { grid-column: auto; } .hero-card { padding: 25px; margin: 20px auto; } }
