:root {
  --ink: #18252b;
  --navy: #19323c;
  --navy-2: #244550;
  --blue: #1e6b88;
  --teal: #2f806a;
  --gold: #c58c3c;
  --orange: #ee712d;
  --red: #c95050;
  --paper: #f5f3ee;
  --panel: #ffffff;
  --line: #dfe5e3;
  --muted: #6f7c82;
  --soft-blue: #e4eff3;
  --soft-green: #e4f1eb;
  --soft-gold: #f7ebd6;
  --shadow: 0 8px 30px rgba(24, 37, 43, .07);
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy); color: #e8efef; padding: 28px 18px 20px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--gold); color: var(--navy); font-family: "Playfair Display", serif; font-size: 25px; font-weight: 700; }
.brand strong { display: block; font-family: "Playfair Display", serif; font-size: 21px; letter-spacing: .03em; }
.brand small { display: block; margin-top: 2px; color: #9fb1b6; font-size: 11px; }
.nav { display: grid; gap: 5px; margin-top: 24px; }
.nav-link { display: flex; gap: 11px; align-items: center; padding: 11px 12px; border-radius: 8px; color: #b9c7ca; font-weight: 600; transition: .2s ease; }
.nav-link:hover { color: white; background: rgba(255,255,255,.06); }
.nav-link.active { color: white; background: var(--navy-2); box-shadow: inset 3px 0 0 var(--gold); }
.nav-icon { width: 20px; text-align: center; font-size: 18px; line-height: 1; color: var(--gold); }
.nav-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.nav-footer p { margin: 18px 11px 0; color: #b7c3c6; font-size: 11px; line-height: 1.55; }
.nav-footer p span { color: #7f959b; }
.logout-form { margin-top: 13px; }
.logout-button { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.main { min-width: 0; }
.topbar { height: 92px; padding: 18px 32px; display: flex; align-items: center; gap: 18px; background: rgba(245,243,238,.95); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.topbar h1 { margin: 1px 0 0; font-family: "Playfair Display", serif; font-size: 28px; line-height: 1.1; }
.eyebrow { margin: 0; color: var(--gold); font-size: 10px; line-height: 1.2; font-weight: 700; letter-spacing: .13em; }
.period-selector { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.period-selector label { color: var(--muted); font-size: 12px; font-weight: 600; }
select, input[type="search"], input[type="number"] { min-height: 40px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); padding: 0 12px; outline: none; }
input[type="text"], input[type="password"] { min-height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); padding: 0 12px; outline: none; }
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,107,136,.12); }
.menu-button { display: none; background: transparent; border: 0; font-size: 22px; }
.content { padding: 26px 32px 40px; max-width: 1600px; margin: 0 auto; }
.footer { color: #879297; font-size: 11px; padding: 0 32px 26px; text-align: right; }
.page-intro { min-height: 34px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.status-dot { width: 8px; height: 8px; display: inline-block; margin-right: 8px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 4px rgba(47,128,106,.12); }
.text-link { color: var(--blue); font-weight: 700; }
.text-link:hover { text-decoration: underline; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 21px 15px; }
.panel-heading h2, .checklist h2 { margin: 3px 0 0; font-size: 18px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { position: relative; overflow: hidden; min-height: 128px; padding: 21px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--navy); }
.kpi-card.blue::before { background: var(--blue); }
.kpi-card.positive::before { background: var(--teal); }
.kpi-card.negative::before { background: var(--red); }
.kpi-card.courtesy::before { background: var(--orange); }
.kpi-card.gold::before { background: var(--gold); }
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card > strong { display: block; margin: 13px 0 7px; font-size: 25px; line-height: 1; }
.kpi-card small { color: var(--muted); }
.unit-panel { margin-bottom: 18px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 13px; padding: 0 21px 21px; }
.unit-card { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; }
.unit-title { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.unit-title span { font-weight: 800; letter-spacing: .05em; }
.unit-stat, .unit-result { display: flex; justify-content: space-between; align-items: center; margin-top: 11px; }
.unit-stat span, .unit-result span { color: var(--muted); }
.unit-result { padding-top: 10px; border-top: 1px dashed var(--line); }
.text-positive { color: var(--teal); }
.text-negative { color: var(--red); }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: var(--soft-blue); color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.badge-ok { background: var(--soft-green); color: var(--teal); }
.badge-alert { background: #f9e2e2; color: var(--red); }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr); gap: 18px; margin-bottom: 18px; }
.chart-panel { min-width: 0; }
.chart-wrap { position: relative; height: 310px; padding: 0 18px 20px; }
.chart-wide { height: 285px; }
.chart-tall { height: 390px; }
.split-legend { display: grid; gap: 9px; padding: 0 21px 20px; }
.split-legend > div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }.blue-dot { background: var(--blue); }.orange-dot { background: var(--orange); }
.ranking { list-style: none; padding: 0 21px; margin: 0 0 15px; }
.ranking li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); background: #f0f3f2; font-size: 11px; font-weight: 700; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: 7px; border: 1px solid transparent; font-weight: 700; cursor: pointer; }
.button-primary { color: white; background: var(--navy); }.button-primary:hover { background: var(--navy-2); }
.button-secondary { color: var(--navy); background: var(--soft-gold); border-color: #ead4b0; }
.button-ghost { background: white; border-color: var(--line); }
.button-large { min-height: 48px; padding: 0 22px; }
.full { display: flex; margin: 0 21px 20px; }
.table-panel { margin-bottom: 18px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 13px; background: var(--navy); color: white; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td { padding: 10px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #f8faf9; }
.number { text-align: right; white-space: nowrap; }.total-cell { font-weight: 700; }.muted { color: var(--muted); }.scope { color: var(--muted); font-size: 12px; min-width: 220px; }
.empty-table { padding: 35px; text-align: center; color: var(--muted); }
.share-list { padding: 0 21px 22px; }
.share-row { margin-bottom: 16px; }
.share-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 12px; }
.progress { height: 7px; background: #edf0ef; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg,var(--blue),#3d9eb5); border-radius: inherit; }
.filter-panel { padding: 15px; margin-bottom: 18px; }
.filter-form { display: flex; gap: 12px; align-items: end; }
.filter-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-form .grow { flex: 1; }.filter-form .grow input { width: 100%; }
.pagination { padding: 16px; display: flex; justify-content: center; align-items: center; gap: 22px; border-top: 1px solid var(--line); }
.pagination a { color: var(--blue); font-weight: 700; }.pagination span { color: var(--muted); }
.import-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .7fr); gap: 18px; margin-bottom: 18px; }
.upload-panel { padding-bottom: 22px; }.upload-panel .lead { max-width: 780px; color: var(--muted); line-height: 1.65; margin: 0; padding: 0 21px 17px; }
.upload-form { padding: 0 21px; display: grid; gap: 17px; }
.drop-zone { min-height: 210px; border: 2px dashed #bdc9c8; border-radius: 10px; background: #f9fbfa; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; cursor: pointer; transition: .2s; }
.drop-zone:hover { border-color: var(--blue); background: var(--soft-blue); }.drop-zone input { display: none; }.drop-zone small { color: var(--muted); }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: white; font-size: 25px; }
.manual-period { display: grid; grid-template-columns: 1fr 150px 150px; gap: 13px; align-items: end; padding: 15px; border: 1px solid var(--line); border-radius: 9px; }
.manual-period > div small { display: block; margin-top: 3px; color: var(--muted); }.manual-period label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.checklist { padding: 22px; }.checklist ul { list-style: none; padding: 0; margin: 21px 0; }.checklist li { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }.checklist li > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--soft-green); color: var(--teal); font-weight: 800; }.checklist small { display: block; color: var(--muted); margin-top: 3px; }
.info-box { padding: 14px; border-radius: 8px; color: #6d562f; background: var(--soft-gold); line-height: 1.5; font-size: 12px; }
.flash { padding: 13px 15px; margin-bottom: 18px; border-radius: 8px; font-weight: 600; }.flash-success { color: #205f4e; background: var(--soft-green); }.flash-error { color: #8b3030; background: #f9e2e2; }
.empty-state { max-width: 620px; margin: 80px auto; padding: 52px; text-align: center; }.empty-state h2 { font-family: "Playfair Display", serif; font-size: 27px; }.empty-state p { color: var(--muted); line-height: 1.6; }.empty-icon { width: 64px; height: 64px; margin: auto; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-size: 30px; }
.login-page { min-height: 100vh; background: var(--navy); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.1fr); }
.login-intro { padding: 56px clamp(38px, 6vw, 90px); color: white; background: radial-gradient(circle at 15% 80%, rgba(197,140,60,.24), transparent 38%), linear-gradient(145deg, #132830, #1d3b45); display: flex; flex-direction: column; justify-content: space-between; }
.login-brand { display: flex; gap: 12px; align-items: center; }
.login-brand strong { display: block; font-family: "Playfair Display", serif; font-size: 22px; }
.login-brand small { color: #a9bdc2; }
.login-intro h1 { margin: 13px 0 20px; font-family: "Playfair Display", serif; font-size: clamp(42px, 5vw, 68px); line-height: 1.02; }
.login-intro > div > p:not(.eyebrow) { max-width: 520px; color: #b9c9cd; font-size: 16px; line-height: 1.7; }
.login-caption { color: #879da3; }
.login-form-panel { padding: 40px; background: var(--paper); display: grid; place-items: center; }
.login-form { width: min(430px, 100%); padding: 42px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 22px 70px rgba(12,29,35,.15); }
.login-form h2 { margin: 7px 0 8px; font-family: "Playfair Display", serif; font-size: 31px; }
.login-help { margin: 0 0 26px; color: var(--muted); }
.login-form label { display: grid; gap: 7px; margin: 0 0 16px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.login-form .button { width: 100%; margin-top: 5px; }
.login-form .button:disabled { opacity: .45; cursor: not-allowed; }
.security-note { margin: 18px 0 0; color: #8b969a; font-size: 11px; text-align: center; }
@media (max-width: 1180px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); }.chart-grid { grid-template-columns: 1fr; }.import-layout { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }.sidebar { position: fixed; left: -260px; transition: left .2s; }.menu-open .sidebar { left: 0; box-shadow: 20px 0 60px rgba(0,0,0,.3); }.menu-button { display: block; }.topbar { padding: 15px 18px; }.topbar h1 { font-size: 22px; }.period-selector label { display: none; }.content { padding: 20px 15px; }.kpi-grid { grid-template-columns: 1fr; }.manual-period { grid-template-columns: 1fr; }.filter-form { align-items: stretch; flex-direction: column; }.filter-form label select { width: 100%; }.page-intro { align-items: flex-start; flex-direction: column; gap: 8px; }.chart-wrap { height: 340px; }
  .login-shell { grid-template-columns: 1fr; }.login-intro { min-height: 270px; padding: 32px 25px; }.login-intro h1 { font-size: 39px; }.login-intro > div > p:not(.eyebrow), .login-caption { display: none; }.login-form-panel { padding: 24px 15px; }.login-form { padding: 28px 22px; }
}
