.admin-main { padding-top: 46px; }

.admin-login {
  min-height: calc(100vh - 210px);
  display: grid;
  place-items: center;
}
.admin-login form {
  position: relative;
  width: min(460px, 100%);
  overflow: hidden;
  padding: 38px;
  box-shadow: var(--shadow-lg);
}
.admin-login form::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--brand), var(--teal));
}
.admin-lock {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 23px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand), var(--teal));
  color: #fff;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--brand) 24%, transparent);
  font-size: 18px;
  font-weight: 820;
}
.admin-login h1 {
  margin: 8px 0 11px;
  font-size: 43px;
}
.admin-login > form > p { margin-bottom: 27px; font-size: 13px; }
.login-note {
  display: block;
  margin-top: 14px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .055em;
  text-align: center;
  text-transform: uppercase;
}

.dashboard { animation: admin-in 280ms ease both; }
@keyframes admin-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.admin-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 26px;
}
.admin-title h1 {
  margin: 8px 0 5px;
  font-size: clamp(43px, 5vw, 60px);
}
.admin-title p { margin: 0; }

.admin-quicknav {
  position: sticky;
  top: 84px;
  z-index: 20;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 38px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(140%);
  scrollbar-width: none;
}
.admin-quicknav::-webkit-scrollbar { display: none; }
.admin-quicknav a {
  flex: 1;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 7px 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease;
}
.admin-quicknav a:hover { background: var(--surface-strong); color: var(--text); }

.admin-block {
  margin-bottom: 44px;
  scroll-margin-top: 150px;
}
.block-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 17px;
  padding: 0 4px;
}
.block-heading h2 { margin: 6px 0 0; font-size: 27px; }
.block-heading > p { max-width: 470px; margin: 0; font-size: 12px; text-align: right; }

.total-banner {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(400px, 1.3fr);
  align-items: center;
  gap: 34px;
  margin-bottom: 12px;
  padding: 29px 31px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.revenue-total { min-width: 0; }
.revenue-total small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.revenue-total strong {
  display: block;
  margin: 6px 0 3px;
  font-size: clamp(38px, 5vw, 52px);
  font-weight: 740;
  line-height: 1;
  letter-spacing: -.055em;
}
.revenue-total span { color: var(--muted); font-size: 10px; }
.total-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.total-split > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
}
.total-split small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.total-split strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font-size: 18px;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  min-width: 0;
  padding: 18px 19px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.metric small {
  display: block;
  min-height: 27px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.metric strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 24px;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
}

.admin-section {
  margin-bottom: 17px;
  scroll-margin-top: 150px;
}
.anchored { margin-bottom: 22px; }
.admin-section .card-head { margin-bottom: 19px; }
.supply {
  border-color: color-mix(in srgb, var(--teal) 27%, var(--border));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--teal-soft) 62%, var(--surface)) 0%, var(--surface) 50%);
}
.supply .card-head { align-items: center; }
.ready-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ready-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.supply-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}
.supply-row.compact-row { margin-top: 18px; }
.supply-label {
  flex: 0 0 auto;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 720;
}
.supply-link {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: var(--brand);
  font-size: 11px;
}
.supply-note { margin: 11px 2px 0; font-size: 10px; }
.supply-note a { color: var(--text-soft); }

.provider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px 3px;
  border-top: 1px solid var(--border);
}
.provider-row:first-child { border-top: 0; }
.provider-row code, td code { font-size: 10px; }
.provider-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.provider-row > small:last-child { margin: 0; white-space: nowrap; }
.provider-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.provider-form label { margin: 0; }
.provider-form button { min-height: 46px; }

.sms-balance {
  min-height: 0;
  margin: 0 0 13px;
  font-size: 11px;
}
.sms-balance:empty { display: none; }
.sms-balance.ok, .sms-balance.bad {
  padding: 10px 12px;
  border-radius: 9px;
}
.sms-balance.ok { background: var(--success-soft); color: var(--success); }
.sms-balance.bad { background: var(--danger-soft); color: var(--danger); }

.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  scrollbar-color: var(--border-strong) transparent;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  padding: 0 11px 11px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 14px 11px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 11px;
  white-space: nowrap;
}
tbody tr { transition: background-color 140ms ease; }
tbody tr:hover { background: var(--surface-soft); }
th:first-child, td:first-child { padding-left: 4px; }
th:last-child, td:last-child { padding-right: 4px; }
td .quiet { min-height: 32px; padding: 6px 9px; font-size: 10px; }
.table-empty {
  padding: 34px 4px;
  color: var(--muted);
  text-align: center;
}

/* Delivery confirmation */
.delivery-dialog {
  width: min(480px, calc(100% - 32px));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.delivery-dialog::backdrop {
  background: rgba(3, 9, 18, .7);
  backdrop-filter: blur(5px);
}
.delivery-dialog form { padding: 30px; }
.dialog-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 850;
}
.delivery-dialog h2 { margin-bottom: 8px; font-size: 24px; }
.delivery-dialog p { margin-bottom: 22px; font-size: 12px; }
textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
}
textarea::placeholder { color: var(--faint); }
textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

@media (max-width: 940px) {
  .total-banner { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .storefront-link { display: none; }
  .admin-title { align-items: flex-start; }
  .admin-quicknav {
    top: 73px;
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .admin-quicknav a { flex: 0 0 auto; }
  .block-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .block-heading > p { text-align: left; }
}

@media (max-width: 540px) {
  .admin-login form { padding: 27px 21px; border-radius: 18px; }
  .admin-login h1 { font-size: 38px; }
  .admin-title { flex-direction: column; }
  .total-banner { padding: 23px 20px; border-radius: 17px; }
  .total-split { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { padding: 15px; }
  .metric strong { font-size: 21px; }
  .supply .card-head { align-items: flex-start; flex-direction: column; }
  .supply-row { align-items: flex-start; flex-direction: column; }
  .supply-row button { width: 100%; }
  .provider-row, .provider-form { grid-template-columns: 1fr; align-items: start; }
  .provider-form button { width: 100%; }
  .delivery-dialog form { padding: 24px 20px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
}
