:root {
  --bg: #0b1220;
  --card: #111a2c;
  --muted: #8aa0c7;
  --pri: #4f8cff;
  --ok: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial;
  background: linear-gradient(120deg, #09101e, #0f1830);
  color: #e9f0ff;
  line-height: 1.5;
}

/* Layout */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 8px;
}

header h1 {
  font-size: 18px;
  margin: 0;
}

.badge {
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.container {
  max-width: 1100px;
  margin: 18px auto;
  padding: 0 16px;
}

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

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

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

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  min-width: 0;
}

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

.between {
  justify-content: space-between;
}

.center {
  align-items: center;
}

.flex1 {
  flex: 1;
}

label {
  display: block;
  margin: 8px 0 6px;
}

input,
select,
textarea {
  width: 100%;
  background: #0c1426;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e5ecff;
  border-radius: 10px;
  padding: 10px;
  font-size: 15px;
}

button,
.btn {
  background: var(--pri);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  transition: 0.2s;
}
button:hover,
.btn:hover {
  opacity: 0.9;
}

.btn.ok {
  background: var(--ok);
}
.btn.bad {
  background: var(--bad);
}
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

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

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

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn.sm {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

.right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  overflow-x: auto;
}

.tab {
  padding: 8px 12px;
  border-radius: 10px 10px 0 0;
  background: #0d1528;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  cursor: pointer;
  white-space: nowrap;
}

.tab.active {
  background: #111a2c;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  min-width: 600px;
}

thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9fb0d8;
  text-align: left;
  font-size: 14px;
  word-break: break-word;
}

tbody td {
  background: #0d1528;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px;
}

tbody tr td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

tbody tr td:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.pill.pending {
  background: #1e293b;
  color: #f8fafc;
}

.pill.approved {
  background: #052e1a;
  color: #86efac;
}

.pill.denied {
  background: #3a1010;
  color: #fecaca;
}

.pill.delivered {
  background: #102a3a;
  color: #7dd3fc;
}

.kbd {
  font-family: ui-monospace, Consolas, monospace;
  background: #0a1222;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
}

.inbox {
  max-height: 240px;
  overflow: auto;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  padding: 8px;
  border-radius: 10px;
  background: #0c1426;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
}

.nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.nav .btn {
  background: #0d1528;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav .btn.active {
  background: #1b2642;
}

.qr {
  display: grid;
  place-items: center;
  background: #0d1528;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 14px;
  border-radius: 10px;
}

/* Landing */
.landing .role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.landing .role-card {
  display: grid;
  gap: 10px;
  place-items: center;
  padding: 18px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: #0d1528;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: 0.2s;
}

.landing .role-card:hover {
  outline: 2px solid rgba(79, 140, 255, 0.25);
}

.role-icon {
  font-size: 40px;
}

/* Tips bottom sheet (mobile) */
.tips-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0d1528;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  display: none;
  z-index: 20;
}

.tips-sheet details summary {
  cursor: pointer;
}

/* Responsive */
@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .landing .role-grid {
    grid-template-columns: 1fr;
  }

  /* Hide inline tips on phone; show bottom sheet instead */
  [data-tips] {
    display: none !important;
  }

  .tips-sheet {
    display: block;
  }
}
@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .landing .role-grid {
    grid-template-columns: 1fr;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  [data-tips] {
    display: none !important;
  }
  .tips-sheet {
    display: block;
  }
  button,
  .btn {
    width: 100%;
    text-align: center;
  }
  nav button,
  nav .btn {
    flex: 1;
  }
}
