@font-face {
  font-family: "Noto Serif Display";
  src: url("fonts/NotoSerifDisplay.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #060605;
  --panel: #0e0d0a;
  --panel-soft: #14120d;
  --paper: #f2eee3;
  --muted: #aaa291;
  --gold: #d4af37;
  --gold-bright: #f1d36a;
  --line: rgba(212, 175, 55, 0.23);
  --line-soft: rgba(242, 238, 227, 0.11);
  --danger: #efaca4;
  --serif: "Noto Serif Display", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--ink); color-scheme: dark; }
body { min-width: 320px; background: var(--ink); color: var(--paper); font-family: var(--serif); font-size: 16px; font-weight: 350; line-height: 1.5; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.admin-skip {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 9px 12px;
  transform: translateY(-150%);
  background: var(--gold-bright);
  color: var(--ink);
}
.admin-skip:focus { transform: none; }

.admin-brand {
  color: var(--paper);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}
.admin-brand em { color: var(--gold-bright); font-style: normal; }
.eyebrow { display: block; color: var(--gold-bright); font-size: 0.65rem; font-weight: 650; letter-spacing: 0.24em; text-transform: uppercase; }

.admin-login { display: grid; min-height: 100svh; padding: 24px; place-items: center; }
.login-panel { width: min(100%, 460px); padding: clamp(30px, 6vw, 54px); border: 1px solid var(--line); background: var(--panel); }
.login-panel .admin-brand { display: inline-block; margin-bottom: 68px; }
.login-panel h1 { margin-top: 10px; font-size: clamp(2.25rem, 7vw, 3.6rem); font-weight: 480; letter-spacing: -0.04em; line-height: 0.95; }
.login-panel p { margin-top: 18px; color: var(--muted); }
.login-panel label { display: block; margin-top: 32px; color: var(--muted); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.login-panel input { width: 100%; height: 50px; margin-top: 8px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; outline: 0; background: transparent; color: var(--paper); }
.login-panel input:focus { border-color: var(--gold); }
.login-panel .admin-button { width: 100%; margin-top: 26px; }
.admin-status { min-height: 24px; color: var(--danger) !important; font-size: 0.9rem; }

.admin-button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 160ms ease, color 160ms ease;
}
.admin-button:hover, .admin-button:focus-visible { background: var(--gold-bright); }
.admin-button.secondary { background: transparent; color: var(--gold-bright); }
.admin-button.secondary:hover, .admin-button.secondary:focus-visible { background: var(--gold); color: var(--ink); }
.text-button { padding: 10px 0; border: 0; background: transparent; color: var(--muted); font-size: 0.75rem; }
.text-button:hover, .text-button:focus-visible { color: var(--paper); }

.admin-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  background: rgba(6, 6, 5, 0.94);
  backdrop-filter: blur(16px);
}
.admin-header-title { text-align: center; }
.admin-header-title strong { display: block; margin-top: 2px; font-size: 1rem; font-weight: 500; }
.admin-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }

.admin-main { width: min(calc(100% - 40px), 1440px); min-width: 0; margin-inline: auto; padding: clamp(44px, 6vw, 80px) 0 90px; }
.admin-intro { display: flex; margin-bottom: 36px; align-items: flex-end; justify-content: space-between; gap: 24px; }
.admin-intro h1 { margin-top: 7px; font-size: clamp(2.5rem, 5vw, 4.6rem); font-weight: 480; letter-spacing: -0.045em; line-height: 0.95; }
.admin-intro p { margin-top: 12px; color: var(--muted); font-size: 0.9rem; }

.metric-grid { display: grid; margin-bottom: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.metric { min-height: 166px; padding: 25px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); }
.metric span { color: var(--muted); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; }
.metric strong { display: block; margin: 12px 0 2px; color: var(--gold-bright); font-size: clamp(2.3rem, 4vw, 3.5rem); font-weight: 460; line-height: 1; }
.metric strong.metric-text { max-width: 240px; font-size: clamp(1.3rem, 2.1vw, 2rem); line-height: 1.12; }
.metric small { color: #777064; font-size: 0.78rem; }

.admin-panel { min-width: 0; margin-top: 24px; border: 1px solid var(--line); background: var(--panel); }
.panel-heading { display: flex; padding: 25px 28px; border-bottom: 1px solid var(--line); align-items: flex-end; justify-content: space-between; gap: 24px; }
.panel-heading h2 { margin-top: 5px; font-size: clamp(1.55rem, 2.6vw, 2.35rem); font-weight: 460; letter-spacing: -0.025em; line-height: 1; }
.panel-note, .result-count { color: var(--muted); font-size: 0.78rem; }

.demand-bars { display: grid; padding: 28px; gap: 18px; }
.demand-row { display: grid; grid-template-columns: minmax(150px, 230px) minmax(100px, 1fr) 54px; align-items: center; gap: 18px; }
.demand-label { overflow: hidden; color: var(--paper); font-size: 0.9rem; text-overflow: ellipsis; white-space: nowrap; }
.demand-track { height: 8px; overflow: hidden; background: rgba(242, 238, 227, 0.08); }
.demand-fill { height: 100%; transform-origin: left; background: var(--gold); }
.demand-count { color: var(--gold-bright); font-size: 0.85rem; text-align: right; }

.admin-filters { display: grid; padding: 20px 28px; border-bottom: 1px solid var(--line-soft); grid-template-columns: minmax(230px, 1.5fr) repeat(2, minmax(160px, 0.75fr)); gap: 16px; }
.admin-filters label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.admin-filters input, .admin-filters select { width: 100%; height: 42px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 0; outline: 0; background: var(--ink); color: var(--paper); }
.admin-filters input:focus, .admin-filters select:focus { border-color: var(--gold); }
.dashboard-status { min-height: 0; padding: 0 28px; color: var(--danger); }
.dashboard-status:not(:empty) { padding-top: 18px; }

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; contain: inline-size; }
.enquiry-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.enquiry-table th { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: #7e776a; font-size: 0.6rem; font-weight: 650; letter-spacing: 0.14em; text-align: left; text-transform: uppercase; }
.enquiry-table th:first-child, .enquiry-table td:first-child { padding-left: 28px; }
.enquiry-table th:last-child, .enquiry-table td:last-child { padding-right: 28px; text-align: right; }
.enquiry-table td { padding: 17px 16px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 0.85rem; vertical-align: middle; }
.enquiry-table tr:last-child td { border-bottom: 0; }
.enquiry-table tbody tr:hover { background: rgba(212, 175, 55, 0.035); }
.customer-name { display: block; color: var(--paper); font-size: 0.95rem; font-weight: 500; }
.customer-email, .table-sub { display: block; margin-top: 2px; color: #777064; font-size: 0.76rem; }
.package-chip { display: inline-block; padding: 4px 8px; border: 1px solid var(--line); color: var(--gold-bright); font-size: 0.72rem; }
.details-button { padding: 7px 0; border: 0; border-bottom: 1px solid var(--gold); background: transparent; color: var(--gold-bright); font-size: 0.72rem; }
.details-button:hover, .details-button:focus-visible { color: var(--paper); }
.empty-state { padding: 70px 24px; text-align: center; }
.empty-state strong { font-size: 1.35rem; font-weight: 470; }
.empty-state p { max-width: 480px; margin: 8px auto 0; color: var(--muted); }

.detail-dialog { width: min(calc(100% - 32px), 760px); max-width: none; max-height: min(88svh, 860px); margin: auto; padding: 0; border: 1px solid var(--line); overflow: hidden; background: var(--panel); color: var(--paper); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.75); }
.detail-dialog::backdrop { background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(7px); }
.detail-heading { display: flex; padding: 26px 28px; border-bottom: 1px solid var(--line); align-items: flex-start; justify-content: space-between; gap: 24px; }
.detail-heading h2 { margin-top: 6px; font-size: 2rem; font-weight: 470; letter-spacing: -0.025em; line-height: 1; }
.detail-heading p { margin-top: 8px; color: var(--muted); font-size: 0.82rem; }
.dialog-close { width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--line); background: transparent; color: var(--paper); font-size: 1.65rem; line-height: 1; }
.dialog-close:hover, .dialog-close:focus-visible { border-color: var(--gold); color: var(--gold-bright); }
.detail-content { display: grid; max-height: calc(88svh - 120px); padding: 28px; overflow-y: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.detail-item { padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.detail-item.wide { grid-column: 1 / -1; }
.detail-item dt { color: #777064; font-size: 0.6rem; font-weight: 650; letter-spacing: 0.15em; text-transform: uppercase; }
.detail-item dd { margin-top: 5px; color: var(--paper); overflow-wrap: anywhere; }
.detail-item a { color: var(--gold-bright); border-bottom: 1px solid var(--line); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .admin-header { min-height: 68px; padding: 12px 16px; grid-template-columns: 1fr auto; }
  .admin-header-title { display: none; }
  .admin-header-actions { gap: 12px; }
  .admin-header .admin-button { min-height: 38px; padding: 8px 12px; }
  .admin-main { width: min(calc(100% - 28px), 1440px); padding-top: 36px; }
  .admin-intro { align-items: stretch; flex-direction: column; }
  .admin-intro .admin-button { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 145px; padding: 19px 16px; }
  .metric strong { font-size: 2.4rem; }
  .metric strong.metric-text { font-size: 1.2rem; }
  .panel-heading { padding: 20px; align-items: flex-start; flex-direction: column; }
  .demand-bars { padding: 22px 20px; }
  .demand-row { grid-template-columns: minmax(105px, 1fr) 1.2fr 30px; gap: 10px; }
  .demand-label { font-size: 0.78rem; }
  .admin-filters { padding: 18px 20px; grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .table-wrap { overflow-x: hidden; }
  .enquiry-table { min-width: 0; table-layout: fixed; }
  .enquiry-table th:nth-child(1) { width: 30%; }
  .enquiry-table th:nth-child(2) { width: 46%; }
  .enquiry-table th:last-child { width: 24%; }
  .enquiry-table th:nth-child(3),
  .enquiry-table th:nth-child(4),
  .enquiry-table th:nth-child(5),
  .enquiry-table td:nth-child(3),
  .enquiry-table td:nth-child(4),
  .enquiry-table td:nth-child(5) { display: none; }
  .enquiry-table th,
  .enquiry-table td { padding-right: 8px; padding-left: 8px; overflow-wrap: anywhere; }
  .enquiry-table th:first-child,
  .enquiry-table td:first-child { padding-left: 20px; }
  .enquiry-table th:last-child,
  .enquiry-table td:last-child { padding-right: 20px; }
  .detail-dialog { width: 100%; height: 100svh; max-height: 100svh; border: 0; }
  .detail-heading { padding: 22px 18px; }
  .detail-content { max-height: calc(100svh - 110px); padding: 22px 18px; grid-template-columns: 1fr; }
  .detail-item.wide { grid-column: auto; }
}
