/* =============================================================================
   THE WASH — Client Portal · shared styles
   Brand tokens mirror the marketing site (Plus Jakarta Sans / Manrope).
   ============================================================================= */
:root {
  --ink:      #1a2332;
  --ink-2:    #16202e;
  --deep:     #2f4f63;
  --brand:    #4FA3C7;
  --brand-600:#3a85a8;
  --brand-700:#2f6c8a;
  --brand-800:#265670;
  --hero:     #399abe;
  --paper:    #FAF6F2;
  --surface:  #ffffff;
  --mist:     #f4eee8;
  --line:     #e6edf2;
  --line-2:   #eef4f8;
  --muted:    #5a7280;
  --muted-2:  #7b95a6;
  --yellow:   #f7c843;
  --ok:       #2f9e6f;
  --ok-bg:    #e6f6ee;
  --warn:     #d98a2b;
  --warn-bg:  #fdf1e0;
  --danger:   #d8564f;
  --danger-bg:#fdeceb;
  --info:     #2f7fa8;
  --info-bg:  #e7f3fb;
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px;
  --shadow-sm: 0 4px 14px -6px rgba(58,133,168,.18), 0 1px 3px rgba(15,55,80,.05);
  --shadow-md: 0 14px 40px -16px rgba(58,133,168,.28), 0 4px 10px -4px rgba(15,55,80,.06);
  --shadow-lg: 0 30px 70px -28px rgba(58,133,168,.40), 0 10px 24px -10px rgba(15,55,80,.10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.font-display { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 800; letter-spacing: -.02em; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; letter-spacing: -.02em; margin: 0; }

/* ------------------------------------------------------------------ layout */
.portal-layout { min-height: 100vh; display: flex; }

.portal-sidebar {
  position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 50;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1b2836 0%, #16202e 100%);
  color: #dfe8f0;
  border-right: 1px solid rgba(255,255,255,.06);
  transition: transform 320ms cubic-bezier(.4,0,.2,1);
}
.portal-sidebar__brand { padding: 22px 22px 16px; display: flex; align-items: center; gap: 10px; }
.portal-sidebar__brand img { height: 40px; width: auto; filter: brightness(0) invert(1); opacity: .95; }
.portal-sidebar__tag {
  margin: 0 22px 18px; padding: 4px 0 0;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #6f8aa0;
}
.portal-nav { padding: 6px 14px; display: flex; flex-direction: column; gap: 3px; }
.portal-nav__label {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700;
  font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase;
  color: #62788c; padding: 16px 10px 6px;
}
.portal-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-sm);
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 14.5px;
  color: #b9c8d6; transition: background 160ms ease, color 160ms ease;
}
.portal-nav a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .9; }
.portal-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.portal-nav a.is-active {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff; box-shadow: 0 10px 24px -12px rgba(79,163,199,.7);
}
.portal-nav a.is-active svg { opacity: 1; }

.portal-sidebar__foot { margin-top: auto; padding: 14px; }
.portal-hotelcard {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-md); padding: 12px 13px; display: flex; align-items: center; gap: 11px;
}
.portal-hotelcard .avatar {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-700) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 15px; color: #fff;
}
.portal-hotelcard .meta { min-width: 0; }
.portal-hotelcard .meta b { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13.5px; color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-hotelcard .meta span { display: block; font-size: 11.5px; color: #7f96aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-signout {
  margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.1);
  background: transparent; color: #a8bccd; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600;
  font-size: 13px; cursor: pointer; transition: background 160ms ease, color 160ms ease;
}
.portal-signout:hover { background: rgba(255,255,255,.06); color: #fff; }
.portal-signout svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------- main area */
.portal-main { flex: 1; min-width: 0; margin-left: 264px; display: flex; flex-direction: column; }
.portal-topbar {
  position: sticky; top: 0; z-index: 40;
  height: 68px; display: flex; align-items: center; gap: 14px;
  padding: 0 24px; background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.portal-topbar h1 { font-size: 20px; font-weight: 800; }
.portal-topbar .sub { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.portal-burger {
  display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; align-items: center; justify-content: center; color: var(--deep);
}
.portal-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-chip {
  display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.topbar-chip .avatar {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-700) 100%);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 12.5px;
}
.topbar-chip .txt { font-size: 12.5px; line-height: 1.25; }
.topbar-chip .txt b { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 13px; }
.topbar-chip .txt span { color: var(--muted); font-size: 11.5px; }

.portal-content { padding: 28px 24px 60px; max-width: 1120px; width: 100%; margin: 0 auto; }
.portal-content--wide { max-width: 1280px; }

/* --------------------------------------------------------------- headings */
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 26px; font-weight: 800; }
.page-head p { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card__pad { padding: 20px 22px; }
.card__head {
  padding: 16px 22px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 12px;
}
.card__head h3 { font-size: 15.5px; font-weight: 800; }
.card__head .card__action { margin-left: auto; }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat .stat__icon {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--info-bg); color: var(--brand-700); margin-bottom: 14px;
}
.stat .stat__icon svg { width: 20px; height: 20px; }
.stat .stat__val { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 27px; letter-spacing: -.02em; }
.stat .stat__label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700;
  font-size: 11.5px; letter-spacing: .01em; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.badge--submitted   { background: var(--info-bg);   color: #216b9d; }
.badge--scheduled   { background: #eef0f4;          color: #4a5b6b; }
.badge--collected   { background: #eae7fb;          color: #5b4bb0; }
.badge--processing  { background: var(--warn-bg);   color: #b06a1e; }
.badge--out_for_delivery { background: #e4f1fb;     color: #1f6fae; }
.badge--delivered   { background: var(--ok-bg);     color: #1f7d54; }
.badge--cancelled   { background: #f0f2f4;          color: #8a97a3; }
.badge--unpaid      { background: var(--warn-bg);   color: #b06a1e; }
.badge--paid        { background: var(--ok-bg);     color: #1f7d54; }
.badge--overdue     { background: var(--danger-bg); color: #b83b34; }

/* ------------------------------------------------------------------ tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl thead th {
  text-align: left; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2);
  padding: 12px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
table.tbl tbody td { padding: 15px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background 140ms ease; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.clickable:hover { background: #f7fbfd; }
.tbl .ref { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; color: var(--ink); }
.tbl a.ref { text-decoration: none; border-radius: 6px; }
.tbl a.ref:hover { color: var(--brand-700); text-decoration: underline; }
.tbl a.ref:focus-visible { outline: 3px solid #91c8e0; outline-offset: 3px; }
.tbl .muted { color: var(--muted); }
.tbl .num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 14px;
  padding: 11px 18px; border-radius: 12px; cursor: pointer; border: 1px solid transparent;
  transition: transform 180ms cubic-bezier(.2,.9,.3,1.4), box-shadow 180ms ease, background 160ms ease, opacity 160ms ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-600) 100%); color: #fff;
  box-shadow: 0 10px 26px -12px rgba(58,133,168,.6), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -16px rgba(58,133,168,.7); }
.btn--primary:active { transform: translateY(0); opacity: .95; }
.btn--ghost { background: #fff; color: var(--brand-700); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { transform: translateY(-1px); background: #f7fbfd; }
.btn--subtle { background: var(--info-bg); color: #216b9d; }
.btn--subtle:hover { background: #d9edf9; }
.btn--danger { background: #fff; color: var(--danger); border-color: #f3d3d1; }
.btn--danger:hover { background: var(--danger-bg); }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 22px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn:focus-visible { outline: 3px solid #91c8e0; outline-offset: 2px; }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 16px; }
.field > label {
  display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700;
  font-size: 12.5px; color: var(--deep); margin-bottom: 7px;
}
.input, .select, .textarea {
  width: 100%; font-family: 'Manrope', sans-serif; font-size: 14.5px; color: var(--ink);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease; -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79,163,199,.14);
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a7280' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 12.5px; color: var(--danger); margin-top: 6px; font-weight: 600; display: none; }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); }
.field.has-error .field-error { display: block; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ------------------------------------------------------------------ notices */
.notice {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500; align-items: flex-start;
}
.notice svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.notice--info    { background: var(--info-bg);   color: #1c5f88; }
.notice--warn    { background: var(--warn-bg);   color: #97591a; }
.notice--danger  { background: var(--danger-bg); color: #a93a33; }
.notice--ok      { background: var(--ok-bg);     color: #1c6b48; }

/* config-missing banner */
.config-banner {
  background: #fdf1e0; color: #8a5316;
  border: 1px solid #f2d9b0; border-radius: var(--r-md); padding: 13px 16px; margin-bottom: 20px;
  font-size: 13.5px; display: flex; gap: 11px; align-items: flex-start;
}
.config-banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.config-banner code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; overflow-wrap: anywhere; word-break: break-word; }
.config-banner > div { min-width: 0; }

/* ------------------------------------------------------------ empty / load */
.empty { text-align: center; padding: 48px 24px; }
.empty__icon {
  width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 16px;
  background: var(--info-bg); color: var(--brand-700); display: flex; align-items: center; justify-content: center;
}
.empty__icon svg { width: 28px; height: 28px; }
.empty h3 { font-size: 17px; font-weight: 800; }
.empty p { color: var(--muted); font-size: 14px; margin: 6px auto 20px; max-width: 340px; }

.skeleton { background: linear-gradient(90deg, #eef2f5 25%, #f6f9fb 50%, #eef2f5 75%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ------------------------------------------------------------------ toast */
#toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600;
  transform: translateY(10px); opacity: 0; transition: transform 260ms cubic-bezier(.2,.9,.3,1.3), opacity 260ms ease;
  max-width: 340px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast--ok svg { color: #7fe3b0; }
.toast--err { background: #7c2a25; }

/* ------------------------------------------------------- order detail
   Shared by the client view (portal/order.html) and the staff view
   (portal/admin/order.html). Each page keeps only its own column layout. */
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; font-size: 13.5px; margin-bottom: 14px; }
.back-link:hover { color: var(--brand-700); }
.back-link svg { width: 16px; height: 16px; }

.order-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.order-head .ref-big { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 28px; letter-spacing: -.02em; }
.order-head .meta { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.order-head .act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* status timeline */
.timeline { list-style: none; margin: 0; padding: 6px 4px; }
.tl-step { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: -2px; width: 2px; background: var(--line); }
.tl-step:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: #fff; z-index: 1; }
.tl-dot svg { width: 15px; height: 15px; }
.tl-step.done .tl-dot { background: var(--brand); border-color: var(--brand); }
.tl-step.done::before { background: var(--brand); }
.tl-step.current .tl-dot { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(79,163,199,.2); }
.tl-body b { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 14.5px; color: var(--ink); }
.tl-step:not(.done):not(.current) .tl-body b { color: var(--muted-2); }
.tl-body span { font-size: 12.5px; color: var(--muted); }
.tl-body .stamp { font-variant-numeric: tabular-nums; }

/* key/value rows + order total */
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line-2); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); flex-shrink: 0; }
.kv .v { font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif; text-align: right; }
.kv .v.wrap { font-weight: 500; font-family: 'Manrope', sans-serif; }
.tot-row { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 22px; border-top: 1px solid var(--line); }
.tot-row .k { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 15px; }
.tot-row .v { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 22px; }

/* --------------------------------------------------------------- overlay */
.portal-scrim {
  position: fixed; inset: 0; background: rgba(20,32,45,.45); z-index: 45;
  opacity: 0; pointer-events: none; transition: opacity 280ms ease;
}
.portal-scrim.show { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1023px) {
  .portal-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .portal-sidebar.is-open { transform: translateX(0); }
  .portal-main { margin-left: 0; }
  .portal-burger { display: inline-flex; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-chip .txt { display: none; }
}
@media (max-width: 560px) {
  .portal-content { padding: 20px 16px 48px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .page-head h2 { font-size: 22px; }
  .portal-topbar { padding: 0 16px; }
  .portal-topbar h1 { font-size: 17px; }
}
