:root {
  --black: #080807;
  --charcoal: #141312;
  --charcoal-2: #211f1d;
  --panel: #f8f5ee;
  --panel-2: #fffaf0;
  --gold: #c99a34;
  --gold-light: #f2d58a;
  --gold-dark: #825d17;
  --ink: #16130e;
  --muted: #6d675e;
  --line: #ddd2bd;
  --danger: #a64032;
  --success: #2e7250;
  --warning: #9c6917;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--black);
  font-family: Arial, Helvetica, sans-serif;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 440px);
  gap: 34px;
  align-items: center;
  padding: 38px;
  color: #fff7df;
  background:
    linear-gradient(135deg, rgba(201, 154, 52, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.55)),
    #111;
}

.login-brand {
  max-width: 720px;
}

.login-logo {
  width: min(460px, 100%);
  height: auto;
  display: block;
  margin-bottom: 28px;
  border: 1px solid rgba(242, 213, 138, 0.28);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.login-brand h1 {
  color: #fff7df;
  font-size: clamp(36px, 5vw, 64px);
}

.login-copy {
  max-width: 620px;
  color: #e8dcc5;
  font-size: 18px;
  line-height: 1.6;
}

.login-card {
  padding: 28px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.96);
  border: 1px solid rgba(242, 213, 138, 0.58);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-note {
  color: var(--muted);
  line-height: 1.5;
}

.login-submit {
  width: 100%;
  margin-top: 14px;
}

.login-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--gold-dark);
  font-weight: 800;
  line-height: 1.4;
}

.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  color: #fff7df;
  background:
    linear-gradient(145deg, rgba(201, 154, 52, 0.16), transparent 38%),
    radial-gradient(circle at 20% 0%, rgba(242, 213, 138, 0.16), transparent 28%),
    var(--charcoal);
  border-right: 1px solid rgba(242, 213, 138, 0.22);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px 18px;
  border-bottom: 1px solid rgba(242, 213, 138, 0.22);
}

.brand-logo {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(242, 213, 138, 0.5);
  border-radius: 8px;
  background: #111;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.brand-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.brand-subtitle {
  margin: 6px 0 0;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  color: #f7ecd0;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.nav-item:hover,
.nav-item.active {
  color: #140f07;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-color: rgba(255, 255, 255, 0.22);
}

.contact-card {
  margin-top: auto;
  display: grid;
  gap: 7px;
  padding: 14px;
  color: #f9efd7;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(242, 213, 138, 0.24);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.contact-card p {
  margin: 0;
}

.main {
  min-width: 0;
  background:
    linear-gradient(180deg, #fffaf0 0, #f6efe1 260px, #eee4d2 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  background: rgba(255, 250, 240, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1;
}

.search-input {
  width: min(420px, 100%);
  height: 42px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ghost-button,
.primary-button,
.small-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  color: #1b1305;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: 1px solid var(--gold-dark);
}

.ghost-button,
.small-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.view-root {
  padding: 28px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}

.stat-card,
.panel,
.record-card,
.plan-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 9px 28px rgba(94, 66, 20, 0.09);
}

.stat-card {
  min-height: 118px;
  padding: 18px;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  margin: 12px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 700;
}

.stat-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 14px;
}

.record-card {
  min-height: 190px;
  padding: 16px;
}

.record-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--ink);
  background: #f4ead5;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.success {
  color: #17442c;
  background: #dff2e7;
  border-color: #b8dec8;
}

.pill.warning {
  color: #6b4100;
  background: #fff0c8;
  border-color: #e8c987;
}

.pill.danger {
  color: #7d241a;
  background: #ffe0dc;
  border-color: #e8b7b0;
}

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

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.list-row strong {
  display: block;
}

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fffaf0;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--gold-dark);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
}

.modal-root.hidden {
  display: none;
}

.modal-card {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.plan-card {
  padding: 18px;
}

.plan-price {
  margin: 10px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
}

.plan-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  padding: 34px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

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

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

  .nav-list {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
  }

  .contact-card {
    margin-top: 0;
  }

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

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

@media (max-width: 720px) {
  .login-screen {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .login-brand h1 {
    font-size: 34px;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .view-root {
    padding: 18px;
  }

  .nav-list,
  .stats-grid,
  .records-grid,
  .plans-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 29px;
  }
}
