:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #6b7280;
  --line: #dfe5ee;
  --brand: #f7931a;
  --brand-dark: #c66b0e;
  --green: #0f9f6e;
  --red: #c2413d;
  --blue: #246bfe;
  --nav: #111827;
  --soft: #eef6f2;
  --shadow: 0 16px 34px rgba(28, 39, 60, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 16px 14px 96px;
  max-width: 820px;
  margin: 0 auto;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.coin {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 28%, #ffe3a2 0, #f7931a 46%, #b85d09 100%);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(247, 147, 26, 0.28);
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.brand p,
.muted {
  color: var(--muted);
}

.brand p {
  margin: 2px 0 0;
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #263b78;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.green {
  background: #dff7ec;
  color: #08734e;
}

.pill.red {
  background: #ffe8e5;
  color: #a33430;
}

.pill.gray {
  background: #eef1f5;
  color: #4b5563;
}

.content {
  display: grid;
  gap: 14px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0;
}

.section-title h2 {
  margin: 0;
  font-size: 22px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(30, 41, 59, 0.06);
  padding: 14px;
}

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

.card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.card p {
  margin: 8px 0;
  color: #4b5563;
  line-height: 1.45;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: #374151;
  font-size: 13px;
  line-height: 1.3;
}

.check input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.permission-grid {
  display: grid;
  gap: 6px;
  min-width: 260px;
}

.btn {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--nav);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn.primary {
  background: var(--brand);
  color: #2c1600;
}

.btn.blue {
  background: var(--blue);
}

.btn.green {
  background: var(--green);
}

.btn.ghost {
  background: #eef1f5;
  color: #182033;
}

.btn.danger {
  background: var(--red);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

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

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

.input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.16);
}

.progress {
  height: 8px;
  background: #e9edf3;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  min-width: 4px;
  background: linear-gradient(90deg, var(--brand), var(--green));
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.stat {
  background: #f5f7fb;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  padding: 10px;
}

.stat strong {
  display: block;
  font-size: 18px;
}

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

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(820px, calc(100vw - 20px));
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.nav-btn {
  min-height: 54px;
  border-radius: 10px;
  color: #d1d5db;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 5px 3px;
}

.nav-btn span:first-child {
  font-size: 17px;
}

.nav-btn.active {
  background: #fff;
  color: var(--ink);
}

.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 24px));
  background: #111827;
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 100;
  display: none;
}

.toast.show {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: none;
  place-items: end center;
  z-index: 60;
}

.modal.show {
  display: grid;
}

.modal-panel {
  width: min(820px, 100vw);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px;
  box-shadow: var(--shadow);
}

.empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: #4b5563;
  background: #f7f9fc;
  font-size: 12px;
  text-transform: uppercase;
}

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

.sidebar {
  background: #111827;
  color: #fff;
  padding: 16px;
}

.sidebar .brand {
  margin-bottom: 18px;
}

.side-nav {
  display: grid;
  gap: 7px;
}

.side-nav button {
  text-align: left;
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 10px;
  background: transparent;
  color: #d1d5db;
  font-weight: 800;
}

.side-nav button.active {
  background: #fff;
  color: #111827;
}

.admin-main {
  padding: 20px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.login-box {
  width: min(420px, calc(100vw - 28px));
  margin: 12vh auto;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

@media (max-width: 760px) {
  .grid.two,
  .split,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .side-nav {
    display: flex;
    overflow: auto;
    padding-bottom: 2px;
  }

  .side-nav button {
    white-space: nowrap;
  }

  .admin-main {
    padding: 14px;
  }
}
