:root {
  --bg: #071019;
  --surface: #0c1622;
  --surface-2: #111d2c;
  --border: #213446;
  --gold: #c9a84c;
  --text: #dce7f3;
  --text-dim: #7e95ac;
  --green: #3fa56d;
  --amber: #d89237;
  --red: #c05a5a;
  --blue: #4a89d8;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
}
button, input, select, textarea {
  font: inherit;
}
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), #8f6a1f);
  color: #071019;
  font-weight: 800;
}
.brand-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
}
.brand-sub {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.lang-switch {
  display: flex;
  gap: 8px;
  margin: 10px 0 16px;
}
.lang-btn, .nav-item, .tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
}
.lang-btn {
  border-radius: 999px;
  padding: 6px 10px;
}
.lang-btn.active,
.nav-item.active,
.tab.active {
  background: rgba(201,168,76,.1);
  color: var(--gold);
  border-color: rgba(201,168,76,.35);
}
.nav-item {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
}
.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-dim);
}
.mini-label {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10px;
  margin-bottom: 6px;
}
.main {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(7,16,25,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 18px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 34px;
  font-weight: 400;
}
.topbar p {
  margin: 4px 0 0;
  color: var(--text-dim);
}
.top-actions {
  color: var(--text-dim);
  font-size: 12px;
}
.page {
  display: none;
  padding: 26px;
}
.page.active {
  display: block;
}
.section-head {
  margin-bottom: 22px;
}
.section-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 30px;
  font-weight: 400;
}
.section-head p {
  margin: 4px 0 0;
  color: var(--text-dim);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.card-head h3 {
  margin: 0;
  font-size: 16px;
}
.grid-2, .grid-3, .stats-grid {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stats-grid { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-num {
  font-family: "Cormorant Garamond", serif;
  font-size: 42px;
  line-height: 1;
}
.stat-num.green { color: var(--green); }
.stat-num.gold { color: var(--gold); }
.stat-label {
  margin-top: 8px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .12em;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
}
textarea { resize: vertical; }
.btn {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 16px;
  cursor: pointer;
}
.btn-primary {
  background: var(--gold);
  color: #071019;
  border: none;
  font-weight: 700;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.badge-green { background: rgba(63,165,109,.12); color: #70d79a; border: 1px solid rgba(63,165,109,.4); }
.badge-amber { background: rgba(216,146,55,.12); color: #ffc36d; border: 1px solid rgba(216,146,55,.4); }
.badge-red { background: rgba(192,90,90,.12); color: #ff9b9b; border: 1px solid rgba(192,90,90,.4); }
.badge-blue { background: rgba(74,137,216,.12); color: #88bbff; border: 1px solid rgba(74,137,216,.4); }
.badge-gray { background: rgba(126,149,172,.12); color: #b3c3d5; border: 1px solid rgba(126,149,172,.3); }
.hidden { display: none !important; }
.mt16 { margin-top: 16px; }
.divider {
  color: var(--text-dim);
  text-align: center;
  margin: 8px 0 18px;
}
.list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child {
  border-bottom: none;
}
.list-title {
  font-weight: 700;
}
.list-sub {
  color: var(--text-dim);
  font-size: 13px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .12em;
}
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.tab {
  border-radius: 999px;
  padding: 8px 14px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
  color: var(--text-dim);
}
.log-box {
  background: #050b12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  min-height: 80px;
  color: #9bd8b0;
  font-family: monospace;
  white-space: pre-wrap;
}
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.alert-success { background: rgba(63,165,109,.12); border: 1px solid rgba(63,165,109,.35); color: #8fe0b1; }
.alert-error { background: rgba(192,90,90,.12); border: 1px solid rgba(192,90,90,.35); color: #ffaaaa; }
.w200 { width: 200px; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .grid-2, .grid-3, .stats-grid { grid-template-columns: 1fr; }
}