:root {
  --bg: #0c1220;
  --bg-soft: #111a2d;
  --panel: #121a2f;
  --line: #263350;
  --text: #f6f8ff;
  --muted: #b6bfda;
  --blue: #4f7bff;
  --blue-soft: #274cb5;
  --light: #e7ecff;
  --green: #30c48b;
  --orange: #f2a23d;
  --red: #e35d5d;
  --violet: #8e83ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", "Avenir Next", sans-serif;
  background: radial-gradient(circle at top, #0f1730 0%, var(--bg) 60%, #080c16 100%);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.admin-body {
  place-items: start center;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.panel {
  width: min(920px, 100%);
  background: linear-gradient(170deg, rgba(17, 26, 46, 0.95), rgba(14, 20, 36, 0.92));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.35);
}

.admin-panel {
  width: min(1100px, 100%);
  padding: 1.75rem;
}

.auth-panel {
  max-width: 420px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

h1 {
  margin: 0.15rem 0;
  font-size: 1.7rem;
}

.subtitle {
  margin: 0.45rem 0 1rem;
  color: var(--muted);
}

.subtitle.small {
  margin-top: 1rem;
  font-size: 0.88rem;
}

.pill {
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  color: var(--blue);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input {
  background: #0b1324;
  border: 1px solid #293552;
  color: var(--text);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  font-size: 1rem;
}

input::placeholder {
  color: #9ba7c4;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.82rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.btn-small {
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
}

.btn-primary {
  background: linear-gradient(180deg, var(--blue), var(--blue-soft));
}

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

.btn-secondary {
  background: #202b48;
}

.btn-ghost {
  background: #121a2f;
  border: 1px solid #304167;
}

.main-action {
  width: 100%;
  min-height: 150px;
  margin: 1.2rem 0;
  font-size: 2rem;
  line-height: 1.2;
}

.toolbar {
  display: flex;
  gap: 0.6rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.6rem;
}

.admin-actions {
  display: flex;
  gap: 0.6rem;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  border-radius: 16px;
  border: 1px solid #243350;
  background: rgba(12, 18, 32, 0.55);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.35rem;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  background: #223150;
}

.card.accent-blue::before {
  background: rgba(79, 123, 255, 0.7);
}

.card.accent-violet::before {
  background: rgba(142, 131, 255, 0.7);
}

.card.accent-green::before {
  background: rgba(48, 196, 139, 0.7);
}

.card.accent-red::before {
  background: rgba(227, 93, 93, 0.7);
}

.card-label {
  margin: 0;
  color: #9fb1cf;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-value {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-label {
  font-size: 0.85rem;
  color: #9fb1cf;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.segmented {
  display: inline-flex;
  gap: 0.45rem;
}

.table-card {
  border-radius: 18px;
  border: 1px solid #223150;
  background: rgba(10, 15, 28, 0.55);
  padding: 0.5rem 0.75rem 0.75rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.dashboard-note {
  margin: 0 0 0.8rem;
  color: #9fb1cf;
  font-size: 0.93rem;
}

.status {
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font-size: 0.95rem;
  display: none;
  border: 1px solid transparent;
}

.status.show {
  display: block;
}

.ok {
  color: var(--green);
  border-color: rgba(48, 196, 139, 0.42);
  background: rgba(48, 196, 139, 0.1);
}

.warn {
  color: var(--orange);
  border-color: rgba(242, 162, 61, 0.5);
  background: rgba(242, 162, 61, 0.1);
}

.status-banner {
  margin-top: 0.45rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.admin-table {
  margin-top: 0.6rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.35rem;
  border-bottom: 1px solid #253253;
}

th {
  color: #9ea9c3;
  font-weight: 500;
}

.admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8ea0bf;
  padding-top: 0.9rem;
  padding-bottom: 0.6rem;
}

.admin-table td {
  padding: 0.85rem 0.45rem;
}

.admin-table td:nth-child(1) {
  font-weight: 600;
}

.admin-table td:nth-child(3),
.admin-table td:nth-child(4),
.admin-table td:nth-child(5) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-table th:nth-child(8),
.admin-table td:nth-child(8) {
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.83rem;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-pill.normal {
  background: rgba(138, 156, 196, 0.18);
  color: #c4d0e7;
}

.status-pill.normal .dot {
  background: #9aa9c4;
}

.status-pill.surcharge {
  background: rgba(227, 93, 93, 0.18);
  color: #f08989;
}

.status-pill.surcharge .dot {
  background: var(--red);
}

.status-pill.pending {
  background: rgba(242, 162, 61, 0.16);
  color: #f4ba60;
}

.status-pill.pending .dot {
  background: #f4ba60;
}

.status-pill.delivered {
  background: rgba(48, 196, 139, 0.16);
  color: #58d6a2;
}

.status-pill.delivered .dot {
  background: #2dd695;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}

.type-pill.today {
  color: #84a6ff;
  border-color: rgba(79, 123, 255, 0.35);
  background: rgba(79, 123, 255, 0.16);
}

.type-pill.tomorrow {
  color: #cbbaff;
  border-color: rgba(142, 131, 255, 0.4);
  background: rgba(142, 131, 255, 0.16);
}

.service-date {
  font-weight: 600;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #c6d0ea;
  border: 1px solid rgba(182, 191, 218, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.row-highlight {
  transition: background 0.12s ease;
}

.row-pending {
  border-left: 3px solid rgba(242, 162, 61, 0.9);
}

.row-pending td {
  background: rgba(242, 162, 61, 0.04);
}

.row-delivered {
  border-left: 3px solid rgba(48, 196, 139, 0.9);
}

.row-delivered td {
  background: rgba(48, 196, 139, 0.04);
}

.admin-table tbody tr:hover td {
  background: rgba(79, 123, 255, 0.04);
}

.status-indicator {
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
  border: 1px solid transparent;
  display: inline-block;
  margin: 0.25rem 0 0.75rem;
}

.status-indicator.normal {
  color: var(--green);
  border-color: rgba(48, 196, 139, 0.45);
  background: rgba(48, 196, 139, 0.12);
}

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

.admin-summary {
  margin: 0 0 0.5rem;
  color: #98a8c3;
  font-size: 0.9rem;
}

.empty-state {
  min-height: 160px;
  border-radius: 14px;
  border: 1px dashed rgba(79, 123, 255, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 1.4rem 1.5rem;
  margin: 0.5rem 0 0.75rem;
  background: rgba(15, 23, 48, 0.35);
}

.empty-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.empty-text {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 680px) {
  .top {
    flex-direction: column;
    gap: 0.7rem;
  }

  .toolbar {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .main-action {
    font-size: 1.6rem;
    min-height: 130px;
  }
}

@media (max-width: 520px) {
  .admin-cards {
    grid-template-columns: 1fr;
  }

  .admin-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}
