/* TETAMU admin page (admin.html). Builds on styles.css for colours, fonts,
   buttons and form fields; this file adds the dashboard layout. */

.adm { background: #F3F6F6; }
.adm-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

/* Sidebar */
.adm-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 24px; padding: 22px 16px;
  background: linear-gradient(180deg, var(--teal-700), var(--teal-900)); color: rgba(255, 255, 255, .8);
}
.adm-side__brand { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; }
.adm-side__brand img { width: 108px; height: auto; }
.adm-side__brand span { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-300); }
.adm-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.adm-nav li[hidden] { display: none; }
.adm-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: rgba(255, 255, 255, .78); font-weight: 600;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.adm-nav svg { width: 19px; height: 19px; flex: none; }
.adm-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.adm-nav a[aria-current="page"] { background: #fff; color: var(--teal-700); }
.adm-side__foot { margin-top: auto; display: grid; gap: 8px; font-size: .875rem; }
.adm-side__foot a { color: rgba(255, 255, 255, .65); }
.adm-side__foot a:hover { color: var(--amber-300); }

/* Top bar */
.adm-body { min-width: 0; display: flex; flex-direction: column; }
.adm-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 14px clamp(16px, 3vw, 32px);
  background: rgba(243, 246, 246, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.adm-top__title { margin: 0; font-size: 1.375rem; letter-spacing: -.02em; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-menu { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; place-items: center; }
.adm-menu svg { width: 20px; height: 20px; }
.adm-role { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); }
.adm-role select { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; color: var(--ink); }
.adm-preview {
  margin: 0; padding: 9px clamp(16px, 3vw, 32px); font-size: .8125rem;
  background: var(--amber-50); color: var(--amber-700); border-bottom: 1px solid var(--amber-100);
}
.adm-preview button { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--amber-700); font-weight: 700; text-decoration: underline; cursor: pointer; }
.adm-main { padding: clamp(16px, 3vw, 32px); outline: none; }

/* Cards and shared bits */
.adm-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow-sm); }
.adm-card h2 { font-size: 1.375rem; margin: 0 0 8px; }
.adm-card h3 { font-size: 1rem; margin: 0 0 12px; letter-spacing: -.01em; }
.adm-help { margin: 0 0 14px; font-size: .875rem; color: var(--muted); }
.adm-muted { color: var(--muted); font-weight: 500; }
.adm-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.adm-badge--amber { background: #FFF2DC; color: #9C5A00; }
.adm-badge--teal { background: #E6F4F2; color: #00695C; }
.adm-badge--blue { background: #E7EFFE; color: #1D4ED8; }
.adm-badge--green { background: #E8F5EE; color: #1E7A4C; }
.adm-badge--grey { background: #EEF1F1; color: #5B6B6D; }
.adm-chip { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: #E8F5EE; color: #1E7A4C; font-size: .75rem; font-weight: 700; }
.adm-back { display: inline-block; margin-bottom: 14px; font-weight: 600; font-size: .9375rem; }

/* Stats */
.adm-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.adm-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; text-align: left;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.adm-stat:hover { border-color: var(--teal-300); }
.adm-stat.is-on { border-color: var(--teal-600); box-shadow: inset 0 0 0 1px var(--teal-600); }
.adm-stat__num { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; color: var(--teal-600); line-height: 1.1; }
.adm-stat__label { font-size: .8125rem; color: var(--muted); font-weight: 600; }

/* Toolbar */
.adm-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.adm-toolbar .adm-help { margin: 0; flex: 1 1 320px; }
.adm-search { position: relative; flex: 1 1 280px; }
.adm-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.adm-search input, .adm-filter select {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: .9375rem;
}
.adm-search input { padding-left: 42px; }
.adm-search input:focus, .adm-filter select:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 4px rgba(31, 106, 111, .12); }

/* Table */
.adm-tablewrap { padding: 0; overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.adm-table th { padding: 12px 16px; text-align: left; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: #FAFCFC; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.adm-table td small { display: block; font-size: .8125rem; color: var(--muted); }
.adm-table tbody tr[data-ref] { cursor: pointer; transition: background-color .15s var(--ease); }
.adm-table tbody tr[data-ref]:hover { background: #F6FAFA; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.adm-table td:first-child strong { white-space: nowrap; }
.adm-empty { margin: 0; padding: 26px; text-align: center; color: var(--muted); }
.adm-code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .04em; }
.adm-actions-cell { white-space: nowrap; text-align: right; }
.adm-actions-cell > * { vertical-align: middle; margin-left: 8px; }
.adm-link-danger { border: 0; background: none; color: #B42318; font-weight: 600; cursor: pointer; padding: 6px; }

/* Switch */
.adm-switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.adm-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.adm-switch span:first-of-type { position: absolute; inset: 0; border-radius: 999px; background: #CBD5D4; transition: background-color .2s var(--ease); }
.adm-switch span:first-of-type::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.adm-switch input:checked + span { background: var(--teal-600); }
.adm-switch input:checked + span::after { transform: translateX(18px); }
.adm-switch input:focus-visible + span { outline: 3px solid rgba(31, 106, 111, .3); outline-offset: 2px; }

/* Booking detail */
.adm-detail__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.adm-eyebrow { margin: 0 0 4px; font-size: .8125rem; color: var(--muted); }
.adm-detail__name { margin: 0 0 8px; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.adm-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.adm-detail__main, .adm-detail__side { display: grid; gap: 18px; min-width: 0; }
.adm-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.adm-dl { margin: 0; display: grid; gap: 10px; }
.adm-dl dt { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.adm-dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.adm-next { border-color: var(--teal-300); background: linear-gradient(135deg, #fff 60%, #E6F4F2); }
.adm-next__text { margin: 0 0 14px; }
.adm-send { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.adm-btn-wa { background: #25D366; color: #fff; gap: 8px; }
.adm-btn-wa:hover { background: #1EB955; color: #fff; }
.adm-btn-wa svg { width: 18px; height: 18px; }
.adm-open { font-size: .875rem; font-weight: 600; }
.adm-paychoice { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; padding: 0; border: 0; }
.adm-paychoice legend { padding: 0; margin-bottom: 6px; font-size: .875rem; font-weight: 700; }
.adm-paychoice label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.adm-paychoice input { accent-color: var(--teal-600); width: 18px; height: 18px; }
.adm-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.adm-inline .form__row { margin: 0; }
.adm-card .form__status:empty { display: none; }
.adm-card .form__status { margin: 10px 0 0; min-height: 0; }

.adm-addons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.adm-addon { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; }
.adm-addon.is-on { border-color: #00695C; background: #E6F4F2; }
.adm-addon > span:first-child { font-weight: 600; font-size: .9375rem; }
.adm-addon small { display: block; font-weight: 500; font-size: .8125rem; color: var(--muted); }
.adm-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; flex: none; }
.adm-qty button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--teal-600); font-weight: 800; font-size: 1.0625rem; cursor: pointer; }
.adm-qty button:hover:not(:disabled) { background: var(--teal-50); }
.adm-qty button:disabled { color: var(--line); cursor: default; }
.adm-qty output { min-width: 20px; text-align: center; font-weight: 800; }

.adm-money { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.adm-money td { padding: 7px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.adm-money td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.adm-money small { display: block; font-size: .75rem; color: var(--muted); }
.adm-money tfoot .is-total td { font-weight: 800; padding-top: 12px; }
.adm-money tfoot .is-due td { border-bottom: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.125rem; color: var(--teal-600); }
.adm-timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.adm-timeline li { position: relative; padding: 0 0 14px 22px; }
.adm-timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal-600); }
.adm-timeline li::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.adm-timeline li:last-child::after { display: none; }
.adm-timeline li:first-child::before { background: var(--amber-500); box-shadow: 0 0 0 4px var(--amber-100); }
.adm-timeline b { display: block; font-size: .9375rem; font-weight: 600; }
.adm-timeline small { font-size: .8125rem; color: var(--muted); }

/* Forms */
.adm-form { max-width: 860px; }
.adm-form h3 { margin: 10px 0 0; font-size: 1rem; }
.adm-form__title { margin: 0; }
.adm-form__actions, .adm-dialog__actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.adm-row3 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1.2fr); gap: 18px; }
.adm-row-tight { gap: 12px; }
.adm-preview-line { margin: 0; padding: 12px 14px; border-radius: 12px; background: #E6F4F2; font-size: .9375rem; }
.was-validated .field :invalid { border-color: #D92D20; box-shadow: 0 0 0 4px rgba(217, 45, 32, .1); }
.adm-check { display: flex; align-items: center; gap: 10px; align-self: end; min-height: 52px; font-weight: 700; cursor: pointer; }
.adm-check input { width: 19px; height: 19px; accent-color: var(--teal-600); }
.adm-locked { max-width: 560px; }

/* Dialog */
.adm-dialog { width: min(640px, calc(100% - 32px)); padding: 26px; border: 0; border-radius: 22px; box-shadow: var(--shadow-lg); }
.adm-dialog::backdrop { background: rgba(7, 40, 42, .55); }
.adm-dialog__title { margin: 0; font-size: 1.375rem; }

/* Toast */
.adm-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 20px);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--teal-900); color: #fff; font-weight: 600; font-size: .9375rem;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.adm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .adm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adm-detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); }
  .adm-side {
    position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%);
    transition: transform .25s var(--ease); box-shadow: var(--shadow-lg);
  }
  .adm-side.is-open { transform: none; }
  .adm-menu { display: grid; }
  .adm-role span { display: none; }
  .adm-grid2, .adm-addons { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .adm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-top__title { font-size: 1.125rem; }
  .adm-row3, .adm-inline { grid-template-columns: minmax(0, 1fr); }
  /* Tables become stacked cards */
  .adm-table thead { display: none; }
  .adm-table, .adm-table tbody, .adm-table tr, .adm-table td { display: block; width: 100%; }
  .adm-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .adm-table td { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; padding: 4px 0; border: 0; }
  .adm-table td::before { content: attr(data-label); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 2px; }
  .adm-table td.adm-actions-cell { display: flex; justify-content: flex-start; padding-top: 8px; }
  .adm-table td.adm-actions-cell::before { display: none; }
  .adm-actions-cell > * { margin: 0 8px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .adm-side, .adm-toast, .adm-switch span, .adm-stat, .adm-nav a { transition: none; }
}

/* Products (packages and add-on devices) */
.adm-products { margin-bottom: 26px; }
.adm-products__intro { max-width: 820px; }
.adm-section-title { margin: 0; font-size: 1.25rem; flex: 0 0 auto; }
.adm-thumb-cell { width: 76px; }
.adm-thumb { display: block; width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: #F6FAFA; border: 1px solid var(--line-2); }
.adm-thumb--none { background: var(--teal-50); }
.adm-included { margin: 0; padding-left: 18px; font-size: .8125rem; color: var(--ink-2); }
.adm-link-danger:disabled { color: #A9B6B5; cursor: not-allowed; }
.adm-field-label { display: block; font-size: .875rem; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.adm-items { display: grid; gap: 8px; }
.adm-item-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: 8px; align-items: center; }
.adm-item-row input { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .9375rem; }
.adm-item-row input:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 4px rgba(31, 106, 111, .12); }
.adm-items__add { justify-self: start; margin-top: 8px; }
.adm-picture { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: center; }
.adm-picture__preview {
  width: 110px; height: 110px; border-radius: 14px; border: 1px dashed var(--teal-300); background: #F6FAFA;
  display: grid; place-items: center; overflow: hidden; font-size: .75rem; color: var(--muted); text-align: center;
}
.adm-picture__preview img { width: 100%; height: 100%; object-fit: contain; }
.adm-picture__controls { display: grid; gap: 6px; justify-items: start; }
.adm-picture__controls input[type="file"] { font-size: .875rem; max-width: 100%; }
.adm-dialog { max-height: calc(100vh - 32px); overflow-y: auto; }
@media (max-width: 640px) {
  .adm-picture { grid-template-columns: 84px minmax(0, 1fr); }
  .adm-picture__preview { width: 84px; height: 84px; }
  .adm-table td.adm-thumb-cell { display: block; width: auto; }
  .adm-table td.adm-thumb-cell::before { display: none; }
}
