@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  display: grid;
  grid-template-columns: 240px 1fr;
}
.sidebar {
  min-height: 100vh;
  padding: 24px;
  background: #111827;
  border-right: 1px solid #1f2937;
}
.sidebar h1 { font-size: 22px; margin-top: 0; }
.sidebar nav { display: grid; gap: 12px; margin-top: 24px; }
.sidebar a { color: #93c5fd; text-decoration: none; }
.content { padding: 24px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.card strong { font-size: 28px; }
.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.grid-form textarea,
.grid-form button { grid-column: span 2; }
input, select, textarea, button {
  box-sizing: border-box;
  width: 100%;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1220;
  color: #e2e8f0;
  padding: 12px;
  font: inherit;
  font-family: "Inter", Arial, sans-serif;
}
textarea {
  line-height: 1.5;
  resize: vertical;
}
button {
  cursor: pointer;
  background: #2563eb;
  border: none;
  font-weight: 700;
  letter-spacing: -.01em;
}
table { width: 100%; border-collapse: collapse; background: #111827; border-radius: 12px; overflow: hidden; }
th, td { padding: 12px; border-bottom: 1px solid #1f2937; text-align: left; vertical-align: top; }
a { color: #93c5fd; }

.admin-shell {
  background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
}
.admin-shell .sidebar {
  background: #0f172a;
  border-right: 1px solid rgba(148, 163, 184, .14);
  padding: 28px 20px;
}
.admin-shell .sidebar h1 {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.03em;
  color: #f8fafc;
  margin: 0;
}
.admin-shell .sidebar nav {
  margin-top: 28px;
  gap: 10px;
}
.admin-shell .sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: #cbd5e1;
  font-weight: 700;
  transition: background .16s ease, color .16s ease;
}
.admin-shell .sidebar a:hover {
  background: rgba(59, 130, 246, .12);
  color: #eff6ff;
}
.sidebar .admin-logout-link {
  margin-top: 4px;
  color: #93c5fd;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  text-decoration: none;
}
.sidebar .admin-logout-link:hover {
  color: #bfdbfe;
}
.admin-shell .content {
  padding: 32px;
}
.admin-shell h2 {
  margin: 0 0 20px 0;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -.04em;
  color: #f8fafc;
}
.admin-shell h3 {
  margin: 0 0 14px 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #f8fafc;
}
.admin-shell .stats {
  gap: 20px;
  margin-bottom: 28px;
}
.admin-shell .card {
  background: rgba(15, 23, 42, .78);
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(2, 8, 23, .16);
}
.admin-shell .card strong {
  font-size: 40px;
  letter-spacing: -.04em;
  color: #f8fafc;
}
.admin-shell .card span {
  color: #94a3b8;
  font-weight: 600;
}
.admin-shell .grid-form {
  gap: 14px;
}
.admin-shell input,
.admin-shell select,
.admin-shell textarea,
.admin-shell button {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .16);
  background: rgba(15, 23, 42, .92);
  color: #e2e8f0;
  padding: 13px 14px;
}
.admin-shell input::placeholder,
.admin-shell textarea::placeholder {
  color: #64748b;
}
.admin-shell button {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  font-weight: 700;
}
.admin-shell table.labels-table {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, .12);
  background: rgba(15, 23, 42, .78);
}
.admin-shell table.labels-table tbody tr:hover {
  background: rgba(30, 41, 59, .45);
}

.labels-table {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 16px;
  overflow: hidden;
}
.labels-table thead th {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  padding: 16px 14px;
}
.labels-table tbody td {
  padding: 14px;
  font-size: 15px;
  color: #e5e7eb;
}
.labels-table tbody tr:hover {
  background: rgba(30, 41, 59, .35);
}
.label-id {
  display: inline-block;
  font-weight: 700;
  letter-spacing: .04em;
  color: #f8fafc;
}
.label-price {
  font-weight: 700;
  color: #f8fafc;
}
.label-date {
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
.status-pill--queued { background: #fef3c7; color: #92400e; }
.status-pill--processing { background: #dbeafe; color: #1d4ed8; }
.status-pill--ready { background: #dcfce7; color: #166534; }
.status-pill--hold { background: #ffedd5; color: #9a3412; }
.status-pill--failed { background: #fee2e2; color: #991b1b; }
.status-pill--quoted { background: #ede9fe; color: #6d28d9; }

.confirm-modal {
  position: fixed;
  inset: 0;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}
.confirm-modal.is-open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
.confirm-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .68);
  backdrop-filter: blur(6px);
}
.confirm-modal__dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(calc(100vw - 32px), 460px);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: linear-gradient(180deg, rgba(15, 23, 42, .985) 0%, rgba(15, 23, 42, .95) 100%);
  box-shadow: 0 36px 96px rgba(2, 6, 23, .52);
  transform: translate(-50%, calc(-50% + 10px)) scale(.98);
  transition: transform .18s cubic-bezier(0.16, 1, 0.3, 1);
}
.confirm-modal.is-open .confirm-modal__dialog {
  transform: translate(-50%, -50%) scale(1);
}
.confirm-modal__icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(248, 113, 113, .14);
  color: #fca5a5;
  font-weight: 800;
  font-size: 24px;
  margin-bottom: 18px;
}
.confirm-modal__copy h3 {
  margin: 0 0 10px 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -.04em;
  color: #f8fafc;
}
.confirm-modal__copy p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.65;
  font-size: 15px;
}
.confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}
.confirm-modal__button {
  width: auto;
  min-width: 118px;
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
}
.confirm-modal__button--ghost {
  background: rgba(30, 41, 59, .85);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, .16);
}
.confirm-modal__button--danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}
.confirm-modal__button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.portal-address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
}
.portal-address-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  background: #f8fafc;
}
.portal-section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.portal-section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}
.portal-book-select,
.portal-address-card input,
.portal-address-card select,
.portal-address-card textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none;
}
.portal-address-card input::placeholder,
.portal-address-card textarea::placeholder {
  color: #6b7280;
}
.portal-book-select:focus,
.portal-address-card input:focus,
.portal-address-card select:focus,
.portal-address-card textarea:focus {
  outline: none;
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.portal-inline-3 {
  display: grid;
  grid-template-columns: 1.35fr .8fr .95fr;
  gap: 12px;
}
.portal-inline-2 {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.portal-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
}
.portal-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.portal-address-book-table {
  table-layout: fixed;
}
.portal-address-book-table th:nth-child(1) {
  width: 90px;
}
.portal-address-book-table th:nth-child(2) {
  width: 180px;
}
.portal-address-book-table th:nth-child(4) {
  width: 120px;
}
.portal-address-book-table th:nth-child(5) {
  width: 180px;
}
.portal-actions-header,
.portal-address-actions-cell {
  text-align: center;
}
.portal-address-actions-cell {
  vertical-align: middle;
}
.portal-address-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}
.portal-address-actions form {
  margin: 0;
  display: flex;
  align-items: center;
}
.portal-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, .18);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .16);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.portal-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, .24);
}
.portal-action-button--secondary {
  background: rgba(15, 23, 42, .82);
  color: #dbeafe;
}
.portal-action-button--secondary:hover {
  background: rgba(30, 41, 59, .96);
  color: #eff6ff;
}
.portal-action-button--danger {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border: none;
}
.portal-action-button--danger:hover {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

@media (max-width: 980px) {
  .portal-address-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .portal-inline-3,
  .portal-inline-2 {
    grid-template-columns: 1fr;
  }
  .portal-book-select {
    min-width: 0;
  }
}

/* Active nav link */
.nav-active {
  background: transparent !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-left: 3px solid #3b82f6;
  padding-left: 9px !important;
}

/* Action buttons uniform width */
.action-btn {
  display: inline-block;
  min-width: 130px;
  text-align: center;
  box-sizing: border-box;
}

/* Mobile */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    min-height: auto;
    padding: 16px;
  }
  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }
  .sidebar nav a {
    padding: 8px 12px;
    font-size: 14px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .grid-form {
    grid-template-columns: 1fr;
  }
  .grid-form textarea,
  .grid-form button {
    grid-column: span 1;
  }
  .portal-address-grid {
    grid-template-columns: 1fr !important;
  }
}
