:root {
  --ink: #111a35;
  --muted: #667085;
  --line: #e4dfd4;
  --line-strong: #c9ad73;
  --bg: #f5f2eb;
  --bg-deep: #ebe4d5;
  --panel: #fffdfa;
  --panel-soft: #f8f2e6;
  --teal: #1d2f63;
  --teal-dark: #071439;
  --blue: #223a78;
  --amber: #caa45d;
  --amber-soft: #f1dfb8;
  --red: #aa4a3a;
  --green: #526f57;
  --shadow: 0 18px 48px rgba(7, 20, 57, 0.12);
  --shadow-soft: 0 10px 28px rgba(7, 20, 57, 0.08);
}

body.theme-dark {
  --ink: #f3ead8;
  --muted: #b8b0a4;
  --line: #3a4468;
  --line-strong: #5e6d9f;
  --bg: #0a1432;
  --bg-deep: #14214d;
  --panel: #111d42;
  --panel-soft: #172652;
  --teal: #5f76bd;
  --teal-dark: #f2e1bc;
  --blue: #7d90d1;
  --amber: #d8b06b;
  --red: #c36756;
  --green: #8c9a73;
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(7, 20, 57, 0.06), transparent 32%),
    linear-gradient(180deg, #fbfaf7, var(--bg)),
    var(--bg);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

body.theme-dark {
  background:
    radial-gradient(circle at top left, rgba(216, 176, 107, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(4, 10, 28, 0.82), rgba(14, 26, 60, 0.95)),
    var(--bg);
}

body.theme-dark .workspace {
  background:
    linear-gradient(180deg, rgba(10, 20, 50, 0.72), rgba(10, 20, 50, 0.98)),
    var(--bg);
}

body.theme-dark .topbar {
  background: rgba(17, 29, 66, 0.82);
  border-color: rgba(216, 176, 107, 0.22);
}

body.is-locked .app-shell {
  display: none;
}

.login-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(203, 163, 93, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(8, 18, 50, 0.96), rgba(15, 28, 74, 0.96)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 18px);
}

body.is-locked .login-screen {
  display: grid;
}

.login-panel {
  width: min(460px, 100%);
  padding: 28px;
  color: #f7fbfc;
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(203, 163, 93, 0.26);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 26px;
}

.login-panel h1 {
  font-size: 30px;
}

.login-panel p {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
}

.google-box {
  display: grid;
  justify-content: center;
  min-height: 44px;
  margin: 20px 0 12px;
}

.login-fallback {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.login-fallback span {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.login-fallback .ghost-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.google-login-btn {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  color: #f9f3e8;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.16), rgba(255, 250, 242, 0.08));
  border: 1px solid rgba(203, 163, 93, 0.34);
  border-radius: 7px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 28px rgba(0, 0, 0, 0.18);
}

.google-login-btn:hover {
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.22), rgba(255, 250, 242, 0.12));
  border-color: rgba(203, 163, 93, 0.58);
  transform: translateY(-1px);
}

.google-login-btn:active {
  transform: translateY(0);
}

.google-login-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #f9f3e8;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

#loginHelp {
  display: block;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.62);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  color: #f7fbfc;
  background:
    linear-gradient(180deg, rgba(202, 164, 93, 0.12), transparent 24%),
    linear-gradient(180deg, #071439 0%, #0b1b48 54%, #071236 100%);
  border-right: 1px solid rgba(202, 164, 93, 0.28);
  box-shadow: 16px 0 48px rgba(7, 20, 57, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(241, 223, 184, 0.9));
  color: var(--teal-dark);
  border: 1px solid rgba(202, 164, 93, 0.42);
  border-radius: 8px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.brand-mark span {
  font-size: 31px;
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 24px;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  margin-top: 2px;
}

.profile-card {
  background: rgba(255, 250, 242, 0.09);
  border: 1px solid rgba(202, 164, 93, 0.22);
  border-radius: 8px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-card label {
  color: rgba(255, 255, 255, 0.76);
}

.profile-card select,
.profile-card input {
  width: 100%;
  margin-top: 7px;
}

.profile-card p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.35;
}

.user-card {
  display: grid;
  gap: 8px;
}

.test-profile-field {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.test-profile-field select {
  color: #fffdf8;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(202, 164, 93, 0.26);
}

.user-card span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-card strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.user-card .ghost-btn {
  width: 100%;
  color: #fff;
  background: rgba(255, 250, 242, 0.1);
  border-color: rgba(203, 163, 93, 0.2);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fffefa;
  box-shadow: inset 0 1px 0 rgba(7, 20, 57, 0.03);
}

textarea {
  resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #7d7a70;
  background: #efe7d8;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-weight: 700;
}

.nav-item strong {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #071747;
  background: linear-gradient(180deg, #f8d990, var(--amber));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(202, 164, 93, 0.24);
  font-size: 12px;
  line-height: 1;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(202, 164, 93, 0.22), rgba(255, 255, 255, 0.05));
  border-color: rgba(202, 164, 93, 0.32);
  box-shadow: inset 3px 0 0 var(--amber);
}

.side-metrics {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 15px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    radial-gradient(circle at 18% 0%, rgba(202, 164, 93, 0.26), transparent 34%),
    rgba(3, 13, 45, 0.72);
  border: 1px solid rgba(202, 164, 93, 0.24);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 34px rgba(2, 8, 29, 0.24);
}

.side-metrics::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 88%);
}

.side-metrics > * {
  position: relative;
  z-index: 1;
}

.side-metrics-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.side-metrics-head span,
.side-metric-title small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.side-metrics-head strong {
  color: #ffe1a1;
  font-size: 13px;
}

.side-metric-block {
  display: grid;
  gap: 9px;
}

.side-metric-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.side-metric-title span {
  color: #fffaf2;
  font-size: 13px;
  font-weight: 900;
}

.side-bars {
  display: grid;
  gap: 9px;
}

.side-bar-row {
  display: grid;
  gap: 6px;
}

.side-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.side-bar-label span {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-bar-label strong {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.side-bar-track {
  height: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.side-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.side-bar-row.gold .side-bar-track span {
  background: linear-gradient(90deg, #caa45d, #ffe0a1);
  box-shadow: 0 0 16px rgba(202, 164, 93, 0.42);
}

.side-bar-row.blue .side-bar-track span {
  background: linear-gradient(90deg, #5ec2ff, #b7ebff);
  box-shadow: 0 0 16px rgba(94, 194, 255, 0.36);
}

.side-empty {
  padding: 10px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.validated-panel,
.archive-summary {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(7, 20, 57, 0.98), rgba(11, 27, 72, 0.95)),
    radial-gradient(circle at top right, rgba(202, 164, 93, 0.24), transparent 28%);
  border: 1px solid rgba(202, 164, 93, 0.26);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(7, 20, 57, 0.16);
}

.validated-head,
.archive-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.validated-head strong,
.archive-summary-head strong {
  display: block;
  color: #fffaf2;
  font-size: 16px;
}

.validated-head span,
.archive-summary-head span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

.validated-list {
  display: grid;
  gap: 10px;
}

.validated-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 110px;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.validated-item strong {
  display: block;
  color: #fffaf2;
  font-size: 13px;
}

.validated-item span,
.validated-item small {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.archive-categories {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
}

.archive-categories label {
  display: grid;
  gap: 8px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.archive-categories select {
  min-height: 40px;
  color: #fffaf2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06)),
    #071747;
  border-color: rgba(202, 164, 93, 0.26);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.archive-categories input[type="date"] {
  min-height: 40px;
  color: #fffaf2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06)),
    #071747;
  border-color: rgba(202, 164, 93, 0.26);
  font-size: 13px;
  font-weight: 800;
}

.archive-filter-result {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.archive-filter-result strong {
  color: #ffe1a1;
  font-size: 14px;
}

.archive-filtered-list {
  display: grid;
  gap: 10px;
}

.archive-demand-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(92px, 0.7fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.archive-demand-card strong,
.archive-demand-card b {
  display: block;
  color: #fffaf2;
  font-size: 12px;
}

.archive-demand-card span,
.archive-demand-card small {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.archive-demand-card span {
  margin-top: 3px;
  line-height: 1.35;
}

.workspace {
  min-width: 0;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(202, 164, 93, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.95), rgba(245, 242, 235, 0.98)),
    var(--bg);
}

.theme-toggle {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 40;
  min-height: 40px;
  padding: 0 14px;
  color: #fffaf2;
  background: linear-gradient(180deg, var(--blue), var(--teal-dark));
  border: 1px solid rgba(203, 163, 93, 0.3);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(11, 24, 64, 0.2);
  font-size: 12px;
  font-weight: 800;
}

body.theme-dark .theme-toggle {
  color: #0b1840;
  background: linear-gradient(180deg, #f0e0bc, var(--amber));
  border-color: rgba(240, 224, 188, 0.24);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(7, 20, 57, 0.98), rgba(29, 47, 99, 0.94)),
    var(--teal-dark);
  border: 1px solid rgba(202, 164, 93, 0.3);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(7, 20, 57, 0.18);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  color: #fffdf8;
}

.eyebrow {
  margin: 0 0 4px;
  color: #d9bd7a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.05;
}

h2 {
  font-size: 20px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 15px;
  font-weight: 800;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-btn {
  color: #071439;
  background: linear-gradient(180deg, #f4d78d, var(--amber));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 24px rgba(202, 164, 93, 0.24);
}

.ghost-btn {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.topbar .ghost-btn,
.sidebar .ghost-btn {
  color: #fffdf8;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.danger-btn {
  color: #fff;
  background: var(--red);
  border-color: rgba(149, 66, 51, 0.2);
}

.icon-btn {
  width: 38px;
  padding: 0;
  font-size: 24px;
  color: var(--teal-dark);
  background: rgba(255, 250, 242, 0.7);
  border-color: var(--line);
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.icon-btn:hover,
.mini-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn:hover,
.icon-btn:hover,
.mini-btn:hover {
  background: #fff7ea;
  border-color: var(--line-strong);
}

.topbar .ghost-btn:hover,
.sidebar .ghost-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.notice-strip {
  display: none;
  margin-bottom: 16px;
  border: 1px solid rgba(202, 164, 93, 0.42);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #fff6df, #fffdfa);
  color: #745018;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.notice-strip.is-visible {
  display: block;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.scoreboard article {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  padding: 16px;
  background:
    linear-gradient(145deg, #fffefa, #f7f0e3);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.scoreboard article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), rgba(202, 164, 93, 0));
}

.scoreboard span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.scoreboard strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
  color: var(--teal-dark);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.chart-card {
  min-height: 198px;
  padding: 18px;
  background: rgba(255, 254, 250, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.wide-chart {
  grid-column: 1 / -1;
}

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.chart-head h2 {
  color: var(--teal-dark);
  font-size: 17px;
}

.chart-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bar-chart,
.performance-chart {
  display: grid;
  gap: 10px;
}

.bar-row,
.performance-row {
  display: grid;
  grid-template-columns: 116px minmax(80px, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  background: rgba(7, 20, 57, 0.08);
  border: 1px solid rgba(7, 20, 57, 0.06);
  border-radius: 999px;
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 4px;
  background: linear-gradient(90deg, #0b1b48, #caa45d);
  border-radius: 999px;
  box-shadow: none;
}

.performance-row {
  grid-template-columns: 132px minmax(160px, 1fr) minmax(190px, auto);
}

.performance-stack {
  display: grid;
  grid-template-columns: var(--open, 1fr) var(--closed, 1fr) var(--late, 1fr);
  height: 18px;
  overflow: hidden;
  background: #eee6d8;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(7, 20, 57, 0.08);
}

.performance-stack span:nth-child(1) {
  background: var(--blue);
}

.performance-stack span:nth-child(2) {
  background: var(--amber);
}

.performance-stack span:nth-child(3) {
  background: var(--red);
}

.chart-empty {
  color: var(--muted);
  padding: 10px 0;
  font-size: 13px;
  font-weight: 800;
}

.invite-panel {
  margin-bottom: 16px;
  padding: 18px;
  background: linear-gradient(180deg, #fffefa, #faf5ea);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.invite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.invite-head h2 {
  font-size: 16px;
}

.invite-head span,
.invite-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invite-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.invite-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(7, 20, 57, 0.05);
}

.invite-link {
  overflow: hidden;
  min-height: 34px;
  padding: 9px;
  color: #5c6070;
  background: #f8f4eb;
  border: 1px dashed #ccb896;
  border-radius: 6px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-panel {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(255, 253, 250, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.control-panel input,
.control-panel select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.control-panel input:focus,
.control-panel select:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(203, 163, 93, 0.18);
  outline: none;
}

.table-card,
.insight-card {
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

body.theme-dark .chart-head span,
body.theme-dark .table-head span,
body.theme-dark .invite-head span,
body.theme-dark .invite-card span,
body.theme-dark .export-card span,
body.theme-dark .scoreboard span,
body.theme-dark .demand-note,
body.theme-dark .alert-line,
body.theme-dark .bottleneck-line,
body.theme-dark .rules-card span,
body.theme-dark .empty-state,
body.theme-dark .line-count {
  color: var(--muted);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .invite-link,
body.theme-dark .ghost-btn,
body.theme-dark .mini-btn,
body.theme-dark .icon-btn {
  color: var(--ink);
  background: rgba(255, 250, 242, 0.06);
}

body.theme-dark th {
  color: #d4ccbe;
  background: #1a2956;
}

body.theme-dark tbody tr:hover {
  background: rgba(240, 224, 188, 0.06);
}

body.theme-dark .bar-track,
body.theme-dark .performance-stack {
  background: rgba(255, 250, 242, 0.1);
}

body.theme-dark .notice-strip,
body.theme-dark .priority-help {
  background: rgba(216, 176, 107, 0.12);
}

.table-card {
  position: relative;
  overflow: hidden;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fffefa, #fbf6ed);
}

.table-head strong,
.table-head span {
  display: block;
}

.table-head span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.line-count {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid rgba(202, 164, 93, 0.35);
  border-radius: 999px;
  background: #fff5df;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
  max-height: 58vh;
}

table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #394762;
  background: #f4eddf;
  font-size: 12px;
  text-transform: uppercase;
  box-shadow: inset 0 -1px 0 var(--line);
}

tbody tr:hover {
  background: #fff7e8;
}

.demand-title {
  display: block;
  max-width: 230px;
  color: var(--teal-dark);
  font-weight: 850;
}

.demand-note {
  display: block;
  max-width: 260px;
  margin-top: 4px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.priority-critica {
  color: #fff;
  background: var(--red);
}

.priority-alta {
  color: var(--teal-dark);
  background: var(--amber);
}

.priority-media {
  color: #fff;
  background: var(--blue);
}

.priority-baixa {
  color: var(--teal-dark);
  background: var(--green);
}

.status-nova {
  color: #17316e;
  background: #e6edf9;
}

.status-em-execucao {
  color: #66480e;
  background: #f4e3bd;
}

.status-validacao-gestor {
  color: #7a5d25;
  background: #efe0bf;
}

.status-concluida {
  color: #5a6d4c;
  background: #e7eddf;
}

.late {
  color: var(--red);
  font-weight: 900;
}

.soon {
  color: var(--amber);
  font-weight: 900;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.mini-btn {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal-dark);
  background: linear-gradient(180deg, #fffefa, #f8f1e5);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(7, 20, 57, 0.06);
}

.empty-state {
  display: none;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--ink);
  margin-bottom: 4px;
}

.insights-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr;
  gap: 12px;
  margin-top: 16px;
}

.insight-card {
  padding: 18px;
  background: linear-gradient(180deg, #fffefa, #faf5ea);
  box-shadow: var(--shadow-soft);
}

.insight-card h2 {
  font-size: 16px;
  margin-bottom: 10px;
}

.alert-line,
.bottleneck-line,
.rules-card span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.alert-line:first-child,
.bottleneck-line:first-child,
.rules-card span:first-of-type {
  border-top: 0;
}

.alert-line strong,
.bottleneck-line strong {
  color: var(--ink);
}

dialog {
  width: min(920px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #fffefa;
  box-shadow: 0 30px 80px rgba(7, 20, 57, 0.28);
}

dialog::backdrop {
  background: rgba(7, 20, 57, 0.64);
  backdrop-filter: blur(4px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(7, 20, 57, 0.98), rgba(29, 47, 99, 0.94)),
    var(--teal-dark);
}

.modal-head h2 {
  color: #fffdfa;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 20px;
}

.wide {
  grid-column: 1 / -1;
}

.priority-help {
  display: grid;
  gap: 5px;
  margin: 0 20px;
  padding: 14px;
  color: #6f5420;
  background: linear-gradient(180deg, #fff7e6, #fffaf1);
  border: 1px solid rgba(203, 163, 93, 0.45);
  border-radius: 8px;
  font-size: 13px;
}

.attachment-help,
.attachment-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 20px;
  background: #fbf6ed;
  border-top: 1px solid var(--line);
}

#deleteBtn {
  margin-right: auto;
}

#lockHint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.export-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(180deg, #fffefa, #f8f1e5);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.export-card span {
  color: var(--muted);
  font-size: 13px;
}

.import-card input {
  margin-top: 8px;
  padding: 0;
  border: 0;
  min-height: 0;
  background: transparent;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .scoreboard,
  .charts-grid,
  .invite-grid,
  .control-panel,
  .archive-categories,
  .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-demand-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .table-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions button {
    flex: 1;
  }

  .scoreboard,
  .charts-grid,
  .invite-grid,
  .control-panel,
  .insights-grid,
  .form-grid,
  .export-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}

/* Premium AMPLA refresh */
body {
  background:
    linear-gradient(135deg, rgba(7, 20, 57, 0.04), transparent 34%),
    linear-gradient(180deg, #f9fafb 0%, #f2efe8 100%);
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 24px 20px;
  background:
    linear-gradient(180deg, rgba(203, 163, 93, 0.11), transparent 18%),
    linear-gradient(180deg, #071438 0%, #0a1740 48%, #071235 100%);
}

.sidebar .brand {
  justify-content: center;
  padding: 2px 0 14px;
}

.sidebar .brand > div:last-child {
  display: none;
}

.sidebar .brand-mark {
  width: 120px;
  height: 120px;
  background-color: #071438;
  border: 1px solid rgba(203, 163, 93, 0.5);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.28);
}

.profile-card {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.055));
  border-color: rgba(203, 163, 93, 0.24);
}

.user-card span,
.test-profile-field {
  color: rgba(255, 255, 255, 0.62);
}

.user-card strong {
  color: #fffdf8;
}

.test-profile-field select {
  min-height: 42px;
  margin-top: 7px;
  color: #fffdf8;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item {
  min-height: 48px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.is-active {
  color: #fffdf8;
  background: linear-gradient(90deg, rgba(203, 163, 93, 0.28), rgba(255, 255, 255, 0.055));
}

.workspace {
  padding: 28px 32px 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(246, 243, 236, 0.96)),
    var(--bg);
}

.topbar {
  min-height: 112px;
  margin-bottom: 20px;
  padding: 22px 24px;
  background:
    linear-gradient(120deg, rgba(7, 20, 57, 0.99), rgba(13, 31, 79, 0.97)),
    var(--teal-dark);
  border: 1px solid rgba(203, 163, 93, 0.34);
  box-shadow: 0 26px 56px rgba(7, 20, 57, 0.18);
}

.topbar .eyebrow {
  color: #d8bd7b;
}

.topbar h1 {
  font-size: 34px;
  font-weight: 850;
}

.top-actions {
  gap: 10px;
}

.top-actions button {
  min-height: 44px;
}

.topbar .ghost-btn {
  color: #fffdf8;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.topbar .primary-btn {
  color: #071438;
  background: linear-gradient(180deg, #f4d991, #cba35d);
  border-color: rgba(255, 255, 255, 0.28);
}

.scoreboard {
  gap: 14px;
}

.scoreboard article {
  min-height: 108px;
  padding: 18px;
  background: rgba(255, 253, 250, 0.9);
  border: 1px solid rgba(228, 223, 212, 0.95);
  box-shadow: 0 14px 34px rgba(7, 20, 57, 0.08);
}

.scoreboard article::before {
  height: 4px;
  background: linear-gradient(90deg, #cba35d, rgba(203, 163, 93, 0.04));
}

.scoreboard span {
  color: #687386;
  font-size: 12px;
  text-transform: uppercase;
}

.scoreboard strong {
  margin-top: 14px;
  color: #071438;
  font-size: 38px;
  font-weight: 850;
}

.charts-grid {
  gap: 14px;
}

.chart-card,
.invite-panel,
.control-panel,
.table-card,
.insight-card {
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid rgba(228, 223, 212, 0.96);
  box-shadow: 0 14px 34px rgba(7, 20, 57, 0.075);
}

.chart-card {
  min-height: 178px;
  padding: 18px;
}

.wide-chart {
  min-height: 158px;
}

.chart-head h2,
.invite-head h2,
.insight-card h2,
.table-head strong {
  color: #071438;
  font-weight: 850;
}

.chart-head span,
.invite-head span,
.invite-card span,
.table-head span {
  color: #687386;
}

.bar-row,
.performance-row {
  color: #4d5a70;
}

.control-panel {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.96), rgba(248, 244, 236, 0.92));
}

label {
  color: #657084;
  font-size: 11px;
  text-transform: uppercase;
}

input,
select,
textarea {
  border-color: #ddd6ca;
  background: linear-gradient(180deg, #fffdf8, #f7f1e6);
}

body:not(.theme-dark) .profile-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.07)),
    rgba(7, 20, 56, 0.28);
  border-color: rgba(203, 163, 93, 0.34);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body:not(.theme-dark) .test-profile-field select {
  color: #fff8e8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06)),
    #142454;
  border-color: rgba(203, 163, 93, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body:not(.theme-dark) .test-profile-field select option {
  color: #071438;
  background: #fff8e8;
}

body:not(.theme-dark) dialog {
  background: #f8f2e8;
}

body:not(.theme-dark) .form-grid {
  background:
    linear-gradient(180deg, #fbf7ef, #f6efe4);
}

body:not(.theme-dark) .form-grid input,
body:not(.theme-dark) .form-grid select,
body:not(.theme-dark) .form-grid textarea {
  color: #111a35;
  background: linear-gradient(180deg, #fffefa, #f2eadc);
  border-color: #d4c6ad;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(7, 20, 57, 0.04);
}

body:not(.theme-dark) .form-grid input:disabled,
body:not(.theme-dark) .form-grid select:disabled,
body:not(.theme-dark) .form-grid textarea:disabled {
  color: #5f6675;
  background: #e9dfcd;
  border-color: #d1c1a5;
}

body:not(.theme-dark) .priority-help {
  background:
    linear-gradient(180deg, #fff2d5, #f8ead0);
  border-color: rgba(180, 135, 66, 0.4);
}

body:not(.theme-dark) .modal-actions {
  background:
    linear-gradient(180deg, #f4ecdf, #ece2d2);
}

.table-head {
  padding: 18px 20px;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.98), rgba(249, 245, 237, 0.94));
}

th {
  color: #5d687b;
  background: #f4efe6;
  font-size: 11px;
  letter-spacing: 0;
}

td {
  color: #24304a;
}

tbody tr {
  background: rgba(255, 253, 250, 0.76);
}

tbody tr:nth-child(even) {
  background: rgba(249, 246, 240, 0.72);
}

tbody tr:hover {
  background: #fff5df;
}

.pill {
  min-height: 28px;
  padding: 5px 10px;
}

.mini-btn {
  color: #071438;
  background: linear-gradient(180deg, #fffefa, #f2eadc);
}

dialog {
  border: 1px solid rgba(203, 163, 93, 0.22);
  box-shadow: 0 34px 90px rgba(7, 20, 57, 0.34);
}

.modal-head {
  background:
    linear-gradient(120deg, rgba(7, 20, 57, 0.99), rgba(13, 31, 79, 0.97)),
    var(--teal-dark);
}

.theme-toggle {
  left: 20px;
  bottom: 20px;
  color: #fffdf8;
  background: linear-gradient(180deg, #17295d, #071438);
  border-color: rgba(203, 163, 93, 0.34);
  box-shadow: 0 16px 34px rgba(7, 20, 57, 0.28);
}

body.theme-dark .workspace,
body.theme-dark .chart-card,
body.theme-dark .invite-panel,
body.theme-dark .control-panel,
body.theme-dark .table-card,
body.theme-dark .insight-card {
  background: rgba(17, 29, 66, 0.88);
}

body.theme-dark .scoreboard article {
  background: rgba(17, 29, 66, 0.92);
}

body.theme-dark .topbar,
body.theme-dark .modal-head {
  background: linear-gradient(120deg, rgba(5, 12, 34, 0.99), rgba(17, 29, 66, 0.97));
}

body.theme-dark .topbar h1,
body.theme-dark .scoreboard strong,
body.theme-dark .chart-head h2,
body.theme-dark .invite-head h2,
body.theme-dark .insight-card h2,
body.theme-dark .table-head strong,
body.theme-dark .demand-title {
  color: #fffdf8;
}

/* Premium dark mode */
body.theme-dark {
  color: #f4ead8;
  background:
    linear-gradient(135deg, rgba(203, 163, 93, 0.08), transparent 34%),
    linear-gradient(180deg, #040b22 0%, #071438 100%);
}

body.theme-dark .workspace {
  background:
    linear-gradient(180deg, rgba(7, 20, 57, 0.97), rgba(4, 11, 34, 0.99)),
    #071438;
}

body.theme-dark .sidebar {
  background:
    linear-gradient(180deg, rgba(203, 163, 93, 0.1), transparent 18%),
    linear-gradient(180deg, #030a20 0%, #071438 52%, #040b22 100%);
}

body.theme-dark .topbar,
body.theme-dark .modal-head {
  background:
    linear-gradient(120deg, rgba(3, 10, 32, 1), rgba(10, 23, 64, 0.98)),
    #071438;
  border-color: rgba(203, 163, 93, 0.34);
}

body.theme-dark .scoreboard article,
body.theme-dark .chart-card,
body.theme-dark .invite-panel,
body.theme-dark .control-panel,
body.theme-dark .table-card,
body.theme-dark .insight-card,
body.theme-dark .invite-card,
body.theme-dark .export-card {
  color: #f4ead8;
  background:
    linear-gradient(180deg, rgba(17, 29, 66, 0.96), rgba(10, 23, 64, 0.98));
  border-color: rgba(203, 163, 93, 0.18);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

body.theme-dark .table-head,
body.theme-dark .modal-actions {
  background:
    linear-gradient(180deg, rgba(17, 29, 66, 0.98), rgba(10, 23, 64, 0.98));
  border-color: rgba(203, 163, 93, 0.16);
}

body.theme-dark th {
  color: #d7c8aa;
  background: #0e1e4c;
}

body.theme-dark td {
  color: #eee4d2;
}

body.theme-dark tbody tr,
body.theme-dark tbody tr:nth-child(even) {
  background: rgba(12, 27, 72, 0.72);
}

body.theme-dark tbody tr:hover {
  background: rgba(203, 163, 93, 0.12);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .invite-link,
body.theme-dark .mini-btn,
body.theme-dark .icon-btn {
  color: #f4ead8;
  background: #071438;
  border-color: rgba(203, 163, 93, 0.22);
}

body.theme-dark .invite-card {
  background:
    linear-gradient(180deg, rgba(12, 27, 72, 0.98), rgba(7, 20, 57, 0.98));
  border-color: rgba(203, 163, 93, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 248, 232, 0.04), 0 12px 24px rgba(0, 0, 0, 0.22);
}

body.theme-dark .invite-card strong {
  color: #fff8e8;
}

body.theme-dark .invite-card span {
  color: #d7c8aa;
}

body.theme-dark .invite-link {
  color: #fff8e8;
  background: #040b22;
  border-color: rgba(203, 163, 93, 0.34);
}

body.theme-dark .invite-card .mini-btn {
  color: #071438;
  background: linear-gradient(180deg, #f4d991, #cba35d);
  border-color: rgba(244, 217, 145, 0.34);
}

body.theme-dark input:disabled,
body.theme-dark select:disabled,
body.theme-dark textarea:disabled {
  color: rgba(244, 234, 216, 0.58);
  background: #0b1b48;
}

body.theme-dark .ghost-btn {
  color: #f4ead8;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(203, 163, 93, 0.2);
}

body.theme-dark .primary-btn {
  color: #071438;
  background: linear-gradient(180deg, #f4d991, #cba35d);
}

body.theme-dark .scoreboard span,
body.theme-dark .chart-head span,
body.theme-dark .invite-head span,
body.theme-dark .invite-card span,
body.theme-dark .table-head span,
body.theme-dark .export-card span,
body.theme-dark .demand-note,
body.theme-dark .alert-line,
body.theme-dark .bottleneck-line,
body.theme-dark .rules-card span,
body.theme-dark .empty-state,
body.theme-dark .line-count,
body.theme-dark label {
  color: #c4b796;
}

body.theme-dark .scoreboard strong,
body.theme-dark .chart-head h2,
body.theme-dark .invite-head h2,
body.theme-dark .insight-card h2,
body.theme-dark .table-head strong,
body.theme-dark .empty-state strong,
body.theme-dark .demand-title,
body.theme-dark .alert-line strong,
body.theme-dark .bottleneck-line strong {
  color: #fff8e8;
}

body.theme-dark .bar-track,
body.theme-dark .performance-stack {
  background: rgba(255, 248, 232, 0.12);
}

.chart-card::after {
  display: none;
}

body.theme-dark .bar-fill {
  background: linear-gradient(90deg, #f4d991, #5ec2ff);
}

body.theme-dark .priority-help,
body.theme-dark .notice-strip {
  color: #f3dfad;
  background: rgba(203, 163, 93, 0.12);
  border-color: rgba(203, 163, 93, 0.28);
}

body.theme-dark dialog {
  background: #071438;
  border-color: rgba(203, 163, 93, 0.28);
}

body.theme-dark .theme-toggle {
  color: #071438;
  background: linear-gradient(180deg, #f4d991, #cba35d);
  border-color: rgba(244, 217, 145, 0.38);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr);
    align-items: center;
    padding: 16px;
  }

  .sidebar .brand {
    padding: 0;
  }

  .sidebar .brand-mark {
    width: 86px;
    height: 86px;
  }

  .nav-list {
    grid-column: 1 / -1;
  }

  .workspace {
    padding: 20px;
  }

  .topbar {
    min-height: auto;
  }

  .scoreboard,
  .charts-grid,
  .invite-grid,
  .control-panel,
  .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .sidebar {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
  }

  .sidebar .brand {
    justify-content: start;
  }

  .sidebar .brand-mark {
    width: 82px;
    height: 82px;
  }

  .profile-card {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    min-height: auto;
    padding: 18px;
  }

  .topbar h1 {
    font-size: 30px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .charts-grid,
  .invite-grid,
  .control-panel,
  .archive-categories,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .archive-demand-card {
    grid-template-columns: 1fr;
  }

  .theme-toggle {
    left: auto;
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .sidebar,
  .scoreboard,
  .top-actions {
    grid-template-columns: 1fr;
  }
}
