:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef6f4;
  --ink: #162033;
  --muted: #64748b;
  --line: #dbe4ef;
  --brand: #1f9f89;
  --brand-2: #2f80ed;
  --danger: #d92d20;
  --warning: #b7791f;
  --success: #1b7f45;
  --shadow: 0 18px 48px rgba(18, 31, 53, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #0f172a;
  color: #e5edf8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 20px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-2), #31d184);
  color: #fff;
  font-weight: 900;
}

.role-switcher {
  display: grid;
  gap: 8px;
}

.role-switcher button,
.nav-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
}

.role-switcher button.active,
.nav-button.active {
  background: #ffffff;
  color: #0f172a;
}

.sidebar-note {
  margin-top: auto;
  color: #a8b3c5;
  font-size: 13px;
  line-height: 1.5;
}

.main {
  padding: 28px;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #e8f5f2;
  color: #096753;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.card h2,
.card h3 {
  margin: 0 0 12px;
}

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

.metric strong {
  font-size: 28px;
}

.metric span {
  color: var(--muted);
  font-size: 14px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}

.status.confirmed {
  background: #dcfce7;
  color: var(--success);
}

.status.pending {
  background: #fff7ed;
  color: var(--warning);
}

.status.disputed,
.status.declined {
  background: #fee2e2;
  color: var(--danger);
}

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

.button {
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  padding: 10px 12px;
  font-weight: 700;
}

.button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.button.success {
  background: var(--success);
}

.button.danger {
  background: var(--danger);
}

.button.brand {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
}

.button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.form {
  display: grid;
  gap: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

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

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

.empty {
  border: 1px dashed var(--line);
  background: #f8fafc;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
}

.notice {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.danger-notice {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.auth-main {
  display: grid;
  align-content: center;
}

.auth-card {
  max-width: 620px;
}

.auth-card h1 {
  margin: 14px 0 10px;
  font-size: 32px;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.55;
}

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

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.message strong {
  display: block;
  margin-bottom: 4px;
}

.message span {
  color: var(--muted);
  font-size: 12px;
}

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

  .sidebar {
    position: static;
  }

  .grid.cols-2,
  .grid.cols-3,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }
}
