:root {
  --bg: #0e0c09;
  --bg-soft: #17130e;
  --panel: rgba(27, 22, 17, 0.9);
  --panel-strong: rgba(34, 28, 22, 0.98);
  --panel-lite: rgba(255, 248, 235, 0.06);
  --line: rgba(231, 196, 120, 0.12);
  --line-strong: rgba(231, 196, 120, 0.22);
  --text: #f4ead7;
  --muted: #b8aa91;
  --accent: #d7aa4b;
  --accent-strong: #f0c96f;
  --danger: #dd7d61;
  --success: #6dc597;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(215, 170, 75, 0.2), transparent 28%),
    radial-gradient(circle at bottom right, rgba(141, 101, 20, 0.18), transparent 22%),
    linear-gradient(180deg, #12100c 0%, #0a0907 100%);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(231, 196, 120, 0.12);
  background: rgba(255, 248, 235, 0.03);
  color: var(--text);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(184, 170, 145, 0.74);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(240, 201, 111, 0.45);
  box-shadow: 0 0 0 4px rgba(215, 170, 75, 0.12);
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.login-panel {
  width: min(520px, 100%);
  padding: 40px;
  border-radius: 32px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 244, 221, 0.06), rgba(255, 244, 221, 0.01)),
    var(--panel-strong);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 160px;
  background: linear-gradient(135deg, rgba(240, 201, 111, 0.18), transparent 56%);
  pointer-events: none;
}

.brand-mark,
.workspace-kicker,
.sidebar-foot-label {
  color: var(--accent);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 12px;
}

.login-panel h1 {
  margin: 16px 0 0;
  font-size: clamp(34px, 5vw, 42px);
  line-height: 1.08;
  position: relative;
}

.login-panel p,
.login-note,
.user-meta,
.panel-head p,
.workspace-subtitle,
.workspace-message,
.sidebar-copy,
.sidebar-foot-value,
.summary-label,
.cell-meta,
.empty-note {
  color: var(--muted);
}

.login-panel p {
  margin: 14px 0 0;
  max-width: 380px;
  line-height: 1.7;
}

.login-form,
.inline-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-form label,
.inline-form label {
  display: grid;
  gap: 8px;
}

.login-form span,
.inline-form span {
  font-size: 13px;
  color: #f3e2be;
}

.primary-button,
.ghost-button,
.inline-button,
.danger-button {
  min-height: 46px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
}

.primary-button,
.inline-button {
  background: linear-gradient(135deg, #f0c96f, #c6912c);
  color: #2a1d08;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(215, 170, 75, 0.22);
}

.primary-button:hover,
.inline-button:hover {
  box-shadow: 0 18px 32px rgba(215, 170, 75, 0.28);
}

.ghost-button {
  background: rgba(255, 248, 235, 0.02);
  border-color: var(--line);
  color: var(--text);
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 248, 235, 0.06);
}

.danger-button {
  background: rgba(221, 125, 97, 0.08);
  border-color: rgba(221, 125, 97, 0.18);
  color: var(--danger);
}

.feedback {
  min-height: 22px;
  margin-top: 14px;
  color: var(--danger);
}

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

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 244, 221, 0.06), transparent 28%),
    rgba(12, 10, 8, 0.92);
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: blur(14px);
}

.sidebar-brand {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  align-content: start;
}

.nav-item {
  text-align: left;
  border: 1px solid transparent;
  padding: 14px 16px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav-item:hover {
  color: var(--text);
  border-color: rgba(231, 196, 120, 0.08);
  background: rgba(255, 248, 235, 0.03);
}

.nav-item.is-active {
  background: linear-gradient(135deg, rgba(240, 201, 111, 0.18), rgba(215, 170, 75, 0.08));
  border-color: rgba(240, 201, 111, 0.24);
  color: #fff3d1;
}

.sidebar-foot {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 248, 235, 0.03);
}

.sidebar-foot-value {
  margin-top: 8px;
  line-height: 1.6;
  font-size: 13px;
}

.workspace {
  padding: 28px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 244, 221, 0.05), rgba(255, 244, 221, 0.01)),
    rgba(20, 16, 12, 0.72);
  box-shadow: var(--shadow);
}

.workspace-heading {
  max-width: 720px;
}

.workspace-title {
  margin-top: 10px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.05;
}

.workspace-subtitle {
  margin-top: 12px;
  max-width: 660px;
  line-height: 1.7;
}

.workspace-user {
  min-width: 220px;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.workspace-user-name {
  font-size: 18px;
  font-weight: 600;
}

.workspace-message {
  min-height: 24px;
  margin-top: 16px;
  padding: 0 4px;
}

.workspace-section {
  display: none;
  margin-top: 22px;
}

.workspace-section.is-active {
  display: block;
}

.summary-grid,
.panel-grid {
  display: grid;
  gap: 18px;
}

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

.panel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.panel-grid-wide {
  grid-template-columns: 380px minmax(0, 1fr);
}

.panel,
.summary-card,
.table {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 244, 221, 0.04), rgba(255, 244, 221, 0.01)),
    var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.01em;
}

.panel-head p {
  margin: 8px 0 0;
  line-height: 1.65;
}

.summary-card {
  padding: 18px;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.summary-label {
  font-size: 13px;
  line-height: 1.6;
}

.summary-value {
  margin-top: 12px;
  font-size: 34px;
  font-weight: 700;
  color: #fff5da;
}

.table {
  overflow: hidden;
}

.table-head,
.table-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.table-head {
  background: rgba(240, 201, 111, 0.08);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table-row {
  min-height: 74px;
}

.table-row:nth-child(even) {
  background: rgba(255, 248, 235, 0.015);
}

.table-row + .table-row {
  border-top: 1px solid rgba(231, 196, 120, 0.08);
}

.table.row-accounts .table-head,
.table.row-accounts .table-row {
  grid-template-columns: 1.2fr 1fr 1fr 0.8fr 0.9fr 1.1fr;
}

.table.row-stores .table-head,
.table.row-stores .table-row {
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1.1fr 1.7fr;
}

.table.row-subscriptions .table-head,
.table.row-subscriptions .table-row,
.table.row-reviews .table-head,
.table.row-reviews .table-row,
.table.row-settlements .table-head,
.table.row-settlements .table-row,
.table.row-sms .table-head,
.table.row-sms .table-row,
.table.row-audit .table-head,
.table.row-audit .table-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.cell-title {
  font-weight: 600;
  color: #fff0cf;
}

.cell-meta {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.55;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(240, 201, 111, 0.12);
  color: #ffe8ae;
  font-size: 12px;
}

.tag.is-danger {
  background: rgba(221, 125, 97, 0.12);
  color: #ffb59d;
}

.tag.is-success {
  background: rgba(109, 197, 151, 0.12);
  color: #9ff3c7;
}

.empty-note {
  padding: 28px 20px;
  line-height: 1.7;
}

@media (max-width: 1360px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid-wide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: relative;
    height: auto;
  }

  .workspace {
    padding: 18px;
  }

  .workspace-header {
    flex-direction: column;
  }

  .workspace-user {
    justify-items: start;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-panel,
  .panel,
  .workspace-header {
    padding: 18px;
  }

  .table {
    overflow-x: auto;
  }

  .table-head,
  .table-row {
    min-width: 880px;
  }
}
