:root {
  --navy: #0f2038;
  --navy-2: #16304f;
  --navy-3: #1d3a5f;
  --gold: #c9a227;
  --gold-2: #e3c568;
  --gold-deep: #8a6d14;
  --gold-soft: #f0e5c3;
  --ivory: #f6f2e7;
  --paper: #fffdf8;
  --ink: #1b2740;
  --muted: #5f6b7f;
  --line: #e4ddc9;
  --line-strong: #d3c8ab;
  --teal: #2f8f83;
  --stone: #a9b4c4;
  --pos: #1c7c54;
  --pos-bg: #e3f2e9;
  --neg: #a3382c;
  --neg-bg: #f7e6e3;
  --shadow: 0 18px 40px -30px rgba(15, 32, 56, 0.45);
  --radius: 16px;
  --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1100px 540px at 88% -12%, #efe5c9 0%, rgba(239, 229, 201, 0) 62%),
    radial-gradient(900px 460px at -8% 108%, #ece4d1 0%, rgba(236, 228, 209, 0) 58%),
    var(--ivory);
  min-height: 100vh;
}

[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); color: var(--navy); margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Shell ---------- */

.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.14) 0%, rgba(201, 162, 39, 0) 22%),
    linear-gradient(178deg, var(--navy) 0%, #0b1a2f 72%, #0a172a 100%);
  color: #e9e4d4;
  display: flex;
  flex-direction: column;
  padding: 22px 18px 18px;
  gap: 22px;
  z-index: 20;
  overflow-y: auto;
}

.brand {
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}

.brand img { display: block; width: 100%; height: auto; }

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cfd6e0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.nav-link.active {
  background: rgba(201, 162, 39, 0.16);
  color: var(--gold-soft);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  display: grid;
  gap: 6px;
}

.foot-title { font-size: 12px; font-weight: 600; color: var(--gold-soft); letter-spacing: 0.02em; }
.foot-note { font-size: 11px; color: #93a1b5; line-height: 1.45; }

.main {
  margin-left: 264px;
  padding: 0 34px 54px;
  max-width: 1340px;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin: 0 -34px 22px;
  padding: 20px 34px 14px;
  background: rgba(246, 242, 231, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(228, 221, 201, 0.8);
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 2px;
}

.topbar h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; flex: none; }

.today-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  white-space: nowrap;
}

/* ---------- Buttons & fields ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #f6f2e7;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }

.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--navy);
}
.btn.ghost:hover { background: #f1ead9; filter: none; }
.btn.danger { background: linear-gradient(180deg, #b84537, #98332a); color: #fff; }

.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.icon-btn:hover { background: #f1ead9; color: var(--navy); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.text-link {
  color: var(--gold-deep);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.text-link:hover { text-decoration: underline; }

.field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.field > span { letter-spacing: 0.02em; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffdf9;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea { resize: vertical; min-height: 64px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.field input::placeholder, .field textarea::placeholder { color: #a4a08f; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: grid; gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.calc-line {
  font-size: 13px;
  color: var(--muted);
  background: #f8f3e5;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 9px 12px;
}
.calc-line strong { color: var(--navy); font-size: 15px; }

.divider { height: 1px; background: var(--line); margin: 16px 0; }
.mini-title { font-size: 15px; margin-bottom: 10px; }

.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.inline-select select {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fffdf9;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

/* ---------- Layout blocks ---------- */

.view { display: flex; flex-direction: column; gap: 20px; animation: viewIn 0.25s ease; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 1.9fr 1fr; gap: 20px; align-items: start; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-head h2 { font-size: 19px; letter-spacing: -0.01em; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.kpi {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  width: 46px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
}

.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(23px, 2.1vw, 30px);
  line-height: 1.1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.kpi-meta { font-size: 12px; color: var(--muted); line-height: 1.45; }

.kpi-editor { display: grid; gap: 10px; margin-top: 2px; }
.kpi-editor .field span { font-size: 11px; }

.kpi.just-saved,
.just-saved {
  animation: savedGlow 1.8s ease;
}

@keyframes savedGlow {
  0% { box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.65), var(--shadow); }
  100% { box-shadow: var(--shadow); }
}

tr.just-saved td { background: #f7efd4; }
.cal-day.just-saved { box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.55); }
.activity-card.just-saved { box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.55), var(--shadow); }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  gap: 1px;
}

.stat { background: var(--paper); padding: 15px 18px; display: grid; gap: 3px; }
.stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 23px; color: var(--navy); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-meta { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* ---------- Charts ---------- */

.chart { position: relative; min-width: 0; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg text { font-family: var(--font-body); }

.chart-tip {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  background: var(--navy);
  color: #f4eeda;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 12px 26px -14px rgba(10, 22, 40, 0.7);
  max-width: 260px;
}

.chart-tip strong { display: block; color: var(--gold-2); font-size: 12.5px; margin-bottom: 2px; }
.tip-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tip-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tip-sub { color: #a8b4c6; font-size: 11px; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 16px; height: 3px; border-radius: 2px; }

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-active { background: var(--teal); }
.dot-inactive { background: var(--stone); }

.chart-hit { fill: transparent; cursor: pointer; }
.chart-bar { transition: opacity 0.15s ease; }
.chart-hit:hover + .chart-bar, .chart-hit:hover ~ .chart-bar { opacity: 1; }

.chart-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #faf5e8; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .row-actions { text-align: right; white-space: nowrap; }
.table .row-actions .btn { margin-left: 6px; }
.table tfoot td { font-weight: 700; color: var(--navy); background: #faf5e8; }
.table .type-cell { min-width: 180px; font-weight: 500; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--gold-soft);
  color: #5c4a0c;
  white-space: nowrap;
}
.pill.up { background: var(--pos-bg); color: var(--pos); }
.pill.down { background: var(--neg-bg); color: var(--neg); }
.pill.past { background: #eee9dc; color: var(--muted); }

.table-caption { font-size: 12px; color: var(--muted); margin: 10px 0 8px; }
.table-caption strong { color: var(--navy); }

/* ---------- Dashboard extras ---------- */

.feed { display: grid; gap: 10px; }
.feed-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: #fbf7ec;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.feed-row:hover { background: #f6efdd; border-color: var(--line-strong); }
.feed-body { min-width: 0; }
.feed-body strong { display: block; font-size: 13.5px; color: var(--navy); }
.feed-body .feed-detail { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.date-chip {
  flex: none;
  width: 44px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--gold-soft);
  text-align: center;
  padding: 5px 0 4px;
}
.date-chip .dc-day { display: block; font-family: var(--font-display); font-size: 17px; line-height: 1.1; }
.date-chip .dc-mon { display: block; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #c9d2df; }

.mini-activity {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fbf7ec;
  border-radius: 12px;
  padding: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.mini-activity:hover { background: #f6efdd; }
.mini-thumb {
  width: 72px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
  display: grid;
  place-items: center;
  color: var(--gold-2);
  font-family: var(--font-display);
  font-size: 18px;
}
.mini-activity strong { display: block; font-size: 13.5px; color: var(--navy); }
.mini-activity .mini-detail { display: block; font-size: 11.5px; color: var(--muted); }

.split { display: grid; gap: 16px; }
.split-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #efe9da;
}
.split-bar span { display: block; height: 100%; }
.split-active { background: linear-gradient(90deg, #2f8f83, #24756b); }
.split-inactive { background: linear-gradient(90deg, #b3bdcc, #9aa6b8); }

.split-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.split-legend strong { color: var(--navy); }

.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mini-stat { background: var(--paper); padding: 10px 12px; display: grid; gap: 1px; }
.mini-stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; }
.mini-stat strong { font-family: var(--font-display); font-size: 19px; color: var(--navy); font-variant-numeric: tabular-nums; }

/* ---------- Growth & bars ---------- */

.growth-grid { display: grid; gap: 14px; }
.growth-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fffdf8, #fbf7ec);
}
.growth-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.growth-value {
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.2;
  margin: 3px 0 2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.growth-value .arrow { font-size: 16px; }
.growth-value.pos { color: var(--pos); }
.growth-value.neg { color: var(--neg); }
.growth-meta { font-size: 12.5px; color: var(--ink); }
.growth-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Release comparison ---------- */

.release-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.release-fact { background: var(--paper); padding: 12px 14px; display: grid; gap: 3px; align-content: start; }
.release-fact span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; }
.release-fact strong {
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.15;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.release-fact em { font-style: normal; font-size: 11.5px; color: var(--muted); }

.delta { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.pos { color: var(--pos); }
.delta.neg { color: var(--neg); }

.cmp-row { cursor: pointer; }
.cmp-row.is-selected { background: #f1e8ce; }
.cmp-row.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--gold); font-weight: 700; color: var(--navy); }

.bar-list { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center; }
.bar-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.bar-track { height: 10px; border-radius: 999px; background: #efe9da; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.bar-value { font-size: 12.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-meta { grid-column: 2 / 4; font-size: 11px; color: var(--muted); margin-top: -8px; }

/* ---------- Mix list ---------- */

.mix-list { display: grid; gap: 4px; }
.mix-row {
  display: grid;
  grid-template-columns: 190px 1fr 92px 52px;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.mix-row:hover { background: #faf5e8; }
.mix-row.selected { background: #f1e8ce; box-shadow: inset 0 0 0 1px var(--line-strong); }
.mix-row:not(button) { cursor: default; }
.mix-table-row { cursor: pointer; }
.mix-label { font-size: 12.5px; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-track { height: 9px; border-radius: 999px; background: #efe9da; overflow: hidden; }
.mix-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.mix-row.selected .mix-track i { background: linear-gradient(90deg, var(--navy-3), var(--navy)); }
.mix-amount { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.mix-share { text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.mix-detail {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbf7ec;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.mix-detail strong { color: var(--navy); font-size: 13.5px; }
.mix-detail .detail-grid { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 4px; }
.mix-detail .detail-grid span { color: var(--ink); }
.mix-actions { margin-top: 12px; display: flex; justify-content: flex-end; }

/* ---------- Segmented control ---------- */

.seg { display: inline-flex; background: #f1ead9; border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg button.active { background: var(--navy); color: #f4eeda; }

/* ---------- Membership ---------- */

.snapshot-rate { font-size: 12px; color: var(--muted); }
.snapshot-rate strong { color: var(--navy); }

/* ---------- Activities ---------- */

.upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px dashed var(--line-strong);
  background: #fbf7ec;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.file-btn:hover { background: #f5eeda; border-color: var(--gold); }
.file-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.photo-previews { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-preview { position: relative; width: 96px; height: 72px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-strong); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-preview button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 32, 56, 0.82);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 20px; }

.activity-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.activity-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: block;
  width: 100%;
}
.activity-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.activity-card:hover .activity-cover img { transform: scale(1.03); }
.cover-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--gold-2);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.cover-empty svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.2; opacity: 0.85; }

.photo-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(15, 32, 56, 0.82);
  color: #f4eeda;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 9px;
}

.activity-body { padding: 14px 16px 8px; display: grid; gap: 3px; flex: 1; }
.activity-date { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--gold-deep); }
.activity-body h3 { font-size: 17px; line-height: 1.3; }
.activity-body p { font-size: 12.5px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.activity-actions { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 14px; gap: 8px; }

/* ---------- Calendar ---------- */

.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-title-wrap { flex: 1; min-width: 150px; }
.cal-title-wrap h2 { font-size: 20px; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 6px;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.cal-day {
  position: relative;
  min-height: 64px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fbf8ef;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
}
.cal-day:hover { background: #f3ecda; }
.cal-day.outside { background: transparent; color: #b6ad97; }
.cal-day.outside:hover { background: #f6f0e2; }
.cal-day.today { border-color: var(--gold); }
.cal-day.selected { background: var(--navy); color: #f6f1e2; border-color: var(--navy); }
.cal-day.selected .cal-count { background: rgba(227, 197, 104, 0.22); color: var(--gold-2); }

.cal-num { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-marks { display: flex; align-items: center; gap: 6px; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.16); }
.cal-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--gold-soft);
  color: #5c4a0c;
  border-radius: 999px;
  padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}

.ann-list { display: grid; gap: 8px; }
.ann-item {
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  background: #fbf7ec;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
}
.ann-item strong { display: block; font-size: 13.5px; color: var(--navy); }
.ann-item p { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: pre-line; }
.ann-empty { font-size: 12.5px; color: var(--muted); padding: 10px 2px; }

/* ---------- Financials / empty ---------- */

.placeholder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.placeholder-card {
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 8px;
  min-height: 150px;
}
.placeholder-card .ph-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.placeholder-card h3 { font-size: 16px; }
.placeholder-card .ph-value { font-family: var(--font-display); font-size: 30px; color: var(--line-strong); line-height: 1; }
.placeholder-card p { font-size: 12px; color: var(--muted); }
.ph-chip { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-deep); background: var(--gold-soft); border-radius: 999px; padding: 2px 8px; }

.placeholder-note { display: grid; gap: 6px; max-width: 720px; }
.placeholder-note strong { color: var(--navy); font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.placeholder-note p { font-size: 13px; color: var(--muted); }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fbf7ec;
  padding: 22px 18px;
  display: grid;
  gap: 6px;
  justify-items: start;
  color: var(--muted);
  font-size: 12.5px;
}
.empty strong { color: var(--navy); font-size: 14px; font-family: var(--font-display); font-weight: 600; }
.empty .btn { margin-top: 6px; }
.empty-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gold-soft);
  display: grid;
  place-items: center;
  color: var(--gold-deep);
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Dialogs & toast ---------- */

.dialog {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  max-width: 440px;
  width: calc(100% - 40px);
  box-shadow: 0 30px 80px -30px rgba(10, 22, 40, 0.6);
}
.dialog::backdrop { background: rgba(10, 22, 40, 0.45); }
.dialog-body { padding: 22px; display: grid; gap: 12px; }
.dialog-body h3 { font-size: 19px; }
.dialog-body p { font-size: 13px; color: var(--muted); }
.dialog .form-actions { justify-content: flex-end; }

.gallery-dialog { max-width: 860px; }
.gallery-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gallery-desc { white-space: pre-line; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; max-height: 62vh; overflow-y: auto; }
.gallery-grid img { width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--navy);
  color: #f4eeda;
  border: 1px solid rgba(201, 162, 39, 0.5);
  border-radius: 11px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 20px 44px -20px rgba(10, 22, 40, 0.75);
  z-index: 100;
  max-width: min(90vw, 520px);
  text-align: center;
}
.toast.error { border-color: rgba(200, 90, 75, 0.7); color: #ffd9d1; }

.page-foot {
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .kpi-grid, .placeholder-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1 { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: auto;
    height: auto;
    padding: 12px 16px;
    gap: 10px;
  }
  .main { margin-left: 0; padding: 0 18px 44px; }
  .topbar { margin: 0 -18px 18px; padding: 14px 18px 12px; }
  .brand { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 2px; padding-bottom: 2px; }
  .nav-link { white-space: nowrap; padding: 8px 10px; font-size: 12.5px; }
  .nav-link svg { width: 17px; height: 17px; }
  .nav-link.active::before { left: 8px; right: 8px; top: auto; bottom: 2px; width: auto; height: 2px; }
  .sidebar-foot { display: none; }
  .topbar h1 { font-size: 25px; }
  .today-chip { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .release-facts { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .kpi-grid, .placeholder-grid, .stat-strip { grid-template-columns: 1fr; }
  .release-facts { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 48px; padding: 5px; }
  .cal-count { display: none; }
  .mix-row { grid-template-columns: 1fr 78px 40px; }
  .mix-label { grid-column: 1 / -1; margin-bottom: -6px; }
  .btn { height: 38px; }
  .topbar { flex-wrap: wrap; align-items: center; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- Print ---------- */

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
  .sidebar, .topbar-actions, .page-foot, .form-card, form, .btn, .icon-btn,
  .seg, .text-link, .upload-row, .photo-previews, .mini-title, .divider,
  .cal-head .btn, .mix-actions, .chart-tip { display: none !important; }
  .app { display: block; }
  .main { margin: 0; padding: 0; max-width: none; }
  .topbar { position: static; margin: 0 0 14px; padding: 0 0 10px; background: #fff; backdrop-filter: none; }
  .view { gap: 12px; }
  .card, .kpi, .stat-strip, .activity-card { box-shadow: none; break-inside: avoid; border-color: #cfc6ae; }
  .release-card { break-inside: auto; }
  .release-card .chart, .release-card .release-facts, .release-card tbody tr { break-inside: avoid; }
  .kpi-grid, .stat-strip, .placeholder-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2-1 { grid-template-columns: 1fr 1fr; }
  .activity-grid { grid-template-columns: repeat(3, 1fr); }
  .cal-day { min-height: 42px; }
  a { text-decoration: none; }
}
