/* ===== Stories Mapped admin dashboard ===================================
   Design tokens intentionally echo the storefront brand (navy/gold) so the
   admin tools feel like part of the same product, not a bolted-on backend. */

:root {
  --db-navy: #12234f;
  --db-navy-deep: #0a1733;
  --db-ink: #1c2333;
  --db-muted: #64708a;
  --db-bg: #f3f5fb;
  --db-surface: #ffffff;
  --db-surface-soft: #f7f9fd;
  --db-border: #e3e7f1;
  --db-accent: #f2911e;
  --db-accent-soft: #fde9cf;
  --db-danger: #c0392b;
  --db-danger-soft: #fbeae8;
  --db-success: #1f8a52;
  --db-success-soft: #e7f6ee;
  --db-radius: 14px;
  --db-shadow: 0 16px 32px -20px rgba(10, 23, 51, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Nunito Sans", Arial, sans-serif;
  background: var(--db-bg);
  color: var(--db-ink);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--db-navy);
}

h1, h2, h3 {
  color: var(--db-navy);
  margin: 0 0 0.5rem;
  font-weight: 800;
  line-height: 1.25;
}

h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

p {
  line-height: 1.55;
}

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

/* --- top navigation --- */

.db-topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--db-navy-deep);
  padding: 0.85rem 1.5rem;
  flex-wrap: wrap;
}

.db-topbar-brand {
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  text-decoration: none;
  white-space: nowrap;
}

.db-topbar-brand span {
  color: var(--db-accent);
}

.db-topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex: 1;
}

.db-topbar-nav a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.db-topbar-nav a:hover,
.db-topbar-nav a.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.db-topbar-logout {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
}

.db-topbar-logout:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- shell / layout --- */

.db-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.4rem 1.5rem 4rem;
}

.db-shell--narrow {
  max-width: 640px;
}

.db-page-header {
  margin-bottom: 1.6rem;
}

.db-page-header p {
  color: var(--db-muted);
  max-width: 68ch;
  margin: 0.4rem 0 0;
}

.db-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--db-muted);
  margin-bottom: 0.9rem;
}

.db-breadcrumbs a {
  color: var(--db-muted);
  text-decoration: none;
  font-weight: 700;
}

.db-breadcrumbs a:hover {
  color: var(--db-navy);
}

/* --- card --- */

.db-card {
  background: var(--db-surface);
  border-radius: var(--db-radius);
  box-shadow: var(--db-shadow);
  padding: 2rem;
}

.db-card + .db-card {
  margin-top: 1.4rem;
}

.db-card--soft {
  background: var(--db-surface-soft);
  box-shadow: none;
  border: 1px solid var(--db-border);
}

/* legacy alias so any un-migrated markup still gets a sane look */
.container {
  background: var(--db-surface);
  border-radius: var(--db-radius);
  box-shadow: var(--db-shadow);
  padding: 2rem;
  max-width: 640px;
  margin: 2.4rem auto;
}

/* --- tool launcher grid (dashboard home) --- */

.db-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}

.db-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--db-surface);
  border-radius: var(--db-radius);
  box-shadow: var(--db-shadow);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.db-tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 38px -18px rgba(10, 23, 51, 0.38);
}

.db-tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  background: var(--db-navy);
  color: var(--db-accent);
}

.db-tool-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.db-tool-card h3 {
  margin: 0;
}

.db-tool-card p {
  margin: 0;
  color: var(--db-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* --- forms --- */

.db-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.db-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.db-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
}

.db-form-row--wide,
.full-width {
  grid-column: 1 / -1;
}

label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--db-navy);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="url"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.68rem 0.8rem;
  border: 1px solid var(--db-border);
  border-radius: 9px;
  background: var(--db-surface);
  color: var(--db-ink);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--db-accent);
  box-shadow: 0 0 0 3px rgba(242, 145, 30, 0.18);
}

input[type="file"] {
  padding: 0.55rem 0.6rem;
}

.db-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--db-ink);
}

.db-checkbox input {
  width: auto;
}

.db-hint {
  font-size: 0.8rem;
  color: var(--db-muted);
  font-weight: 500;
}

hr {
  border: none;
  border-top: 1px solid var(--db-border);
  margin: 1.6rem 0;
}

/* --- buttons --- */

button,
a.button,
.db-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--db-accent);
  color: var(--db-navy-deep);
  border: 0;
  padding: 0.75rem 1.3rem;
  border-radius: 9px;
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 3px 0 rgba(184, 123, 62, 0.28), 0 8px 16px -6px rgba(10, 23, 51, 0.3);
}

button:hover,
a.button:hover,
.db-btn:hover {
  transform: translateY(-1px);
  background: #f7a13f;
}

button:active,
a.button:active,
.db-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(184, 123, 62, 0.28);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.db-btn-secondary {
  background: var(--db-surface);
  color: var(--db-navy);
  border: 1px solid var(--db-border);
  box-shadow: none;
}

.db-btn-secondary:hover {
  background: var(--db-surface-soft);
}

.db-btn-danger,
button.db-btn-danger {
  background: var(--db-surface);
  color: var(--db-danger);
  border: 1px solid rgba(192, 57, 43, 0.35);
  box-shadow: none;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.db-btn-danger:hover {
  background: var(--db-danger-soft);
}

.db-btn-ghost {
  background: transparent;
  color: var(--db-navy);
  border: 1px solid var(--db-border);
  box-shadow: none;
}

.db-btn-ghost:hover {
  background: var(--db-surface-soft);
}

.db-btn-block {
  display: flex;
  width: 100%;
}

.db-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

/* --- alerts / callouts --- */

.db-alert {
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.db-alert p {
  margin: 0;
}

.db-alert p + p {
  margin-top: 0.3rem;
}

.db-alert-error {
  background: var(--db-danger-soft);
  color: var(--db-danger);
  border: 1px solid rgba(192, 57, 43, 0.2);
}

.db-alert-success {
  background: var(--db-success-soft);
  color: var(--db-success);
  border: 1px solid rgba(31, 138, 82, 0.2);
}

.db-callout {
  background: var(--db-surface-soft);
  border: 1px solid var(--db-border);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
}

.db-callout p:first-child {
  margin-top: 0;
}

.db-callout p:last-child {
  margin-bottom: 0;
}

.db-callout-accent {
  background: var(--db-accent-soft);
  border-color: rgba(242, 145, 30, 0.35);
}

.db-mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  word-break: break-all;
  font-size: 0.85rem;
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}

.db-mono-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.db-mono-row .db-mono {
  flex: 1;
}

.db-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin-top: 0.4rem;
  background: var(--db-surface);
  color: var(--db-muted);
  border: 1px solid var(--db-border);
  border-radius: 7px;
  box-shadow: none;
  cursor: pointer;
}

.db-copy-btn:hover {
  background: var(--db-surface-soft);
  color: var(--db-navy);
  transform: none;
}

.db-copy-btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.db-copy-btn.is-copied {
  color: var(--db-success);
  border-color: rgba(31, 138, 82, 0.35);
}

/* --- status pills --- */

.db-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--db-border);
  color: var(--db-muted);
}

.db-pill-paid { background: var(--db-success-soft); color: var(--db-success); }
.db-pill-pending { background: var(--db-accent-soft); color: #9a5b0e; }
.db-pill-failed { background: var(--db-danger-soft); color: var(--db-danger); }

/* --- table --- */

.db-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 0.7rem 0.8rem;
  color: var(--db-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--db-border);
}

tbody td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--db-border);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--db-surface-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

table a {
  font-weight: 700;
  text-decoration: none;
}

table a:hover {
  text-decoration: underline;
}

/* --- misc content helpers --- */

.db-image-frame img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--db-border);
}

.db-preview-grid {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.db-preview-item {
  text-align: center;
}

.db-preview-item img {
  width: 100px;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--db-border);
  display: block;
  margin-bottom: 0.4rem;
}

.db-item-card {
  border: 1px solid var(--db-border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  background: var(--db-surface-soft);
}

.db-item-card p {
  margin: 0.25rem 0;
}

.text-center {
  text-align: center;
}

/* --- airport autocomplete (create manual order) --- */

.airport-field {
  position: relative;
}

.airport-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: 10px;
  box-shadow: var(--db-shadow);
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
}

.airport-suggestion-item {
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.airport-suggestion-item:hover,
.airport-suggestion-item.is-active {
  background: var(--db-surface-soft);
}

/* --- footer link row (legacy pages not yet using db-topbar) --- */

.db-footer-links {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--db-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.db-footer-links a {
  text-decoration: none;
}

.db-footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .db-topbar {
    flex-wrap: nowrap;
  }

  .db-topbar-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .db-topbar-nav::-webkit-scrollbar {
    display: none;
  }

  .db-topbar-nav a {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .db-shell {
    padding: 1.4rem 1rem 3rem;
  }

  .db-card,
  .container {
    padding: 1.4rem;
  }

  .db-topbar {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }

  .db-topbar-brand {
    font-size: 0.92rem;
  }
}
