/* ============================================================
   Pia's Laundry Shop POS — shared SaaS interface
   ============================================================ */

:root {
  /* Shared palette with the customer mobile app */
  --pink:        #58265f;
  --pink-dark:   #49204f;
  --pink-light:  #8a5594;
  --pink-glow:   rgba(88,38,95,.14);
  --pink-soft:   rgba(138,85,148,.12);
  --black:       #f6efe6;
  --black-2:     #fffaf2;
  --black-3:     #f2eaf4;
  --black-4:     #ded3df;
  /* legacy aliases so nothing breaks */
  --teal:        var(--pink);
  --teal-dark:   var(--pink-dark);
  --teal-darker: #18131a;
  --ink:         #201820;
  --muted:       #786f78;
  --line:        #ded3df;
  --bg:          #f6efe6;
  --card:        #fffaf2;
  --input:       #fffdf9;
  --radius:      14px;
  --shadow:      0 3px 10px rgba(24,19,26,.07);
  --shadow-lg:   0 14px 34px rgba(24,19,26,.16);
  --green:       #40513b;
  --orange:      #bd7841;
  --blue:        #326ca8;
  --red:         #a43e4a;
  --gray:        #786f78;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--pink-light); text-decoration: none; }
a:hover { color: var(--pink); }

/* ---------------- Layout ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f2eaf4 100%);
  border-right: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
}
.brand-icon { font-size: 26px; }
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-sub  { font-size: 11px; color: var(--pink); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; }
.brand-icon { filter: drop-shadow(0 0 10px var(--pink-glow)); }

.nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #624b56;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--pink-soft); color: var(--pink-dark); }
.nav-link.active { background: linear-gradient(90deg, var(--pink), var(--pink-dark)); color: #fff; box-shadow: 0 6px 18px var(--pink-glow); }
.nav-icon { width: 22px; text-align: center; font-size: 15px; }
.nav-link.small { font-size: 13px; padding: 8px 12px; }

.sidebar-footer { border-top: 1px solid var(--line); padding: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 4px 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark)); color: #fff; font-weight: 700;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--pink);
  display: grid; place-items: center; flex-shrink: 0;
}
.user-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--pink-light); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title h1 { margin: 0; font-size: 20px; }
.topbar-title h1::before { content: ''; display: inline-block; width: 4px; height: 18px; background: var(--pink); border-radius: 2px; margin-right: 10px; vertical-align: -2px; }
.topbar-title p  { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbar-right { margin-left: auto; }
.today { color: var(--muted); font-size: 13px; }

.menu-toggle {
  display: none;
  background: var(--black-3); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  font-size: 18px; padding: 4px 10px; cursor: pointer;
}

.content { padding: 24px 28px 40px; }

/* ---------------- Flash ---------------- */
.flash {
  margin: 16px 28px 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 500;
}
.flash-success { background: #eaf7ef; color: #21633c; border: 1px solid #b9e3c8; }
.flash-error   { background: #fff0f0; color: #a52e38; border: 1px solid #f0c2c5; }
.flash-info    { background: var(--pink-soft); color: var(--pink-dark); border: 1px solid #efb9d0; }

/* ---------------- Cards & grid ---------------- */
.grid { display: grid; gap: 18px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.two   { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card h2, .card h3 { margin: 0 0 12px; font-size: 16px; }
.card .card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card .card-head h2, .card .card-head h3 { margin: 0; }

.stat-card { position: relative; overflow: hidden; border-top: 2px solid var(--pink); }
.stat-card .stat-value { color: var(--ink); }
.stat-card .stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-card .stat-sub   { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-card-link { display: block; color: inherit; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.stat-card-link:hover { color: inherit; text-decoration: none; transform: translateY(-2px); border-color: var(--pink); box-shadow: 0 8px 22px rgba(39, 28, 35, .08); }
.stat-card-link:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(39, 28, 35, .08); }
.stat-card-link:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.stat-card .stat-icon {
  position: absolute; right: 14px; top: 14px; font-size: 22px; opacity: .35;
}

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: rgba(88,38,95,.05); }
tbody tr.order-row { cursor: pointer; }
tbody tr.order-row:focus-visible { outline: 3px solid var(--pink); outline-offset: -3px; }
thead th { background: rgba(255,255,255,.02); }
td.num, th.num { text-align: right; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: filter .15s, background .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%); color: #fff; box-shadow: 0 4px 14px var(--pink-glow); }
.btn-primary:hover { background: linear-gradient(135deg, #ff4d9d 0%, var(--pink) 100%); box-shadow: 0 6px 20px var(--pink-glow); filter: none; }
.btn-outline { background: #fff; color: var(--ink); border-color: #d8c2cc; }
.btn-outline:hover { border-color: var(--pink); color: var(--pink-light); background: var(--pink-soft); filter: none; }
.btn-danger  { background: #fff4f3; color: var(--red); border-color: #edc2c0; }
.btn-danger:hover { background: #ffe8e6; filter: none; }
.notification-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.notification-actions form { margin: 0; }
.order-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.order-actions form { margin: 0; }
.btn-ghost   { background: transparent; color: var(--pink-light); }
.btn-ghost:hover { background: var(--pink-soft); filter: none; }
.btn[disabled], .btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------------- Forms ---------------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  background: var(--input); color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #9a9aa6; opacity: 1; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft);
}
button:focus-visible, a:focus-visible { outline: 3px solid var(--pink-light); outline-offset: 2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--pink); width: auto; }
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.badge-pending   { background: #fff4d8; color: #795600; }
.badge-washing   { background: #eaf3ff; color: #285b91; }
.badge-ready     { background: #e8f6ed; color: #21633c; }
.badge-picked_up { background: #f1edf0; color: #5d4b55; }
.badge-cancelled { background: #fff0f0; color: #a52e38; }
.badge-admin     { background: var(--pink-soft); color: var(--pink-dark); border: 1px solid #efb9d0; }
.badge-staff     { background: #f1edf0; color: #5d4b55; }
.badge-walk_in   { background: #f0edff; color: #57439a; }
.badge-drop_off  { background: var(--pink-soft); color: var(--pink-light); }
.badge-active    { background: #e8f6ed; color: #21633c; }
.badge-inactive  { background: #f1edf0; color: #62545b; }

/* ---------------- POS ---------------- */
.pos-grid { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }

.service-group { margin-bottom: 16px; }
.service-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }
.service-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.service-btn {
  border: 1px solid var(--line); background: var(--black-3); color: var(--ink); border-radius: 10px;
  padding: 12px; cursor: pointer; text-align: left; transition: border .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column; gap: 3px;
}
.service-btn:hover { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft), 0 8px 20px rgba(111,42,74,.12); transform: translateY(-1px); }
.service-btn .s-name { font-weight: 600; font-size: 14px; }
.service-btn .s-price { color: var(--pink); font-weight: 700; font-size: 14px; }
.service-btn .s-unit { color: var(--muted); font-size: 11px; }

.cart-table td { vertical-align: middle; }
.cart-qty { width: 70px; }
.cart-line-total { text-align: right; font-weight: 600; }
.qty-ctrl { display: inline-flex; align-items: center; gap: 4px; }
.qty-ctrl input { width: 50px; text-align: center; padding: 5px 4px; }
.qty-ctrl button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid #d8c2cc;
  background: var(--black-3); color: var(--ink); cursor: pointer; font-weight: 700;
}
.cart-empty { color: var(--muted); text-align: center; padding: 24px 0; }

.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-row.total { font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; color: var(--pink); }
.summary-row .muted { color: var(--muted); }
.change-amount { color: var(--green); font-weight: 700; }
.pos-step-title { margin: 18px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.field-help { margin: 5px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.order-filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr)) auto; align-items: end; gap: 12px; }
.order-filters label { margin-top: 0; }
.filter-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 1px; }
.btn { min-height: 40px; }
.qty-ctrl button { min-width: 36px; min-height: 36px; }
.form-row-full { grid-column: 1 / -1; }
.cancel-order-form { width: min(300px, 100%); padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--black-3); }
.inventory-edit { display: flex; align-items: center; gap: 6px; min-width: 180px; }
.inventory-edit input { min-width: 80px; padding: 7px 8px; }

/* ---------------- Charts (simple CSS bars) ---------------- */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--pink), var(--pink-dark)); border-radius: 6px 6px 2px 2px; min-height: 3px; box-shadow: 0 0 12px var(--pink-glow); }
.bar-val { font-size: 11px; color: var(--muted); }
.bar-lbl { font-size: 11px; color: var(--muted); }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--black-2); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow-lg);
}
.modal h2 { margin: 0 0 4px; }
.modal .modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.modal-close { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

/* ---------------- Receipt (thermal 80mm) — stays WHITE for printing ---------------- */
.receipt {
  width: 320px; margin: 20px auto; background: #fff; color: #111; padding: 22px 18px;
  font-family: "Courier New", monospace; font-size: 13px; box-shadow: var(--shadow-lg);
  border-radius: 4px;
}
.receipt .rc-center { text-align: center; }
.receipt .rc-shop { font-size: 17px; font-weight: 700; }
.receipt .rc-track-url { font-size: 10px; overflow-wrap: anywhere; word-break: break-word; }
.receipt .rc-divider { border-top: 1px dashed #999; margin: 10px 0; }
.receipt .muted { color: #555; }
.receipt th { color: #444; border-bottom: 1px solid #ddd; background: none; }
.receipt table tr:hover { background: none; }
@media print { html, body { background: #fff !important; color: #000 !important; } .receipt { color: #000; } }
.receipt table { width: 100%; }
.receipt td { border: none; padding: 2px 0; font-size: 13px; color: #111; }
.receipt .rc-line { display: flex; justify-content: space-between; }
.receipt .rc-bold { font-weight: 700; }
.no-print { text-align: center; margin: 16px; }
.receipt { position: relative; overflow: hidden; }
.receipt > *:not(.rc-watermark) { position: relative; z-index: 1; }
.receipt .rc-watermark {
  position: absolute; z-index: 0; top: 42%; left: -18%; width: 136%; transform: rotate(-27deg);
  color: rgba(88, 38, 95, .12); text-align: center; font: 700 14px/5 "Courier New", monospace;
  letter-spacing: 2px; pointer-events: none; white-space: normal;
}
.receipt .rc-claim { font-weight: 700; letter-spacing: 1px; }
.receipt .rc-ticket { border-bottom: 1px dashed #999; padding-bottom: 5px; font-weight: 700; }
.receipt .rc-small { font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; margin-top: 4px; }
.receipt .rc-ready { margin: 12px 0; font-weight: 700; line-height: 1.5; }
.receipt .rc-barcode { display: block; width: 100%; height: 48px; margin: 10px auto 3px; }
.receipt .rc-barcode-label { font-size: 10px; letter-spacing: 1px; }

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(88,38,95,.12), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(88,38,95,.08), transparent 60%),
    var(--black);
}
.login-card {
  background: var(--black-2); border: 1px solid var(--line); border-top: 3px solid var(--pink);
  border-radius: 18px; box-shadow: var(--shadow-lg), 0 0 60px rgba(88,38,95,.10);
  width: 100%; max-width: 400px; padding: 34px 32px;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .icon { font-size: 40px; }
.login-brand h1 { margin: 8px 0 2px; font-size: 22px; color: var(--ink); }
.login-brand .icon { filter: drop-shadow(0 0 14px var(--pink-glow)); }
.login-brand p { color: var(--muted); margin: 0; font-size: 13px; }
.login-err { background: #fff0f0; border: 1px solid #f0c2c5; color: #a52e38; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* Password field with show/hide toggle */
.password-field { position: relative; width: 100%; }
.password-field input { width: 100%; padding-right: 48px; }
.toggle-password {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  transition: color .15s, background .15s;
}
.toggle-password:hover { color: var(--pink); background: var(--pink-soft); }
.toggle-password:focus { outline: none; box-shadow: 0 0 0 3px var(--pink-soft); }
.toggle-password svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.toggle-password .eye-open { display: none; }

/* Responsive: small phones */
@media (max-width: 420px) {
  .login-wrap { padding: 12px; align-items: flex-start; }
  .login-card { padding: 24px 20px; border-radius: 14px; margin-top: 8vh; }
  .login-brand h1 { font-size: 20px; }
}

/* ---------------- Utility ---------------- */
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.right { text-align: right; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--black-3); font-weight: 500; font-size: 13px; cursor: pointer; text-decoration: none; color: var(--ink);
}
.pill.active { background: var(--pink); color: #fff; border-color: var(--pink); box-shadow: 0 4px 12px var(--pink-glow); }
.pill:hover { border-color: var(--pink); color: var(--pink-light); }
.pill.active:hover { color: #fff; }

.empty-state { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty-state .big { font-size: 40px; }

.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; }
.pagination a, .pagination span {
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--ink);
}
.pagination .current { background: var(--pink); color: #fff; border-color: var(--pink); }
.pagination a:hover { border-color: var(--pink); color: var(--pink-light); }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .pos-grid, .grid.two { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .order-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s; z-index: 50; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .today { display: none; }
  .order-filters { grid-template-columns: 1fr 1fr; }
  .order-filters > div:first-of-type { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .content { padding: 12px; }
  .card { padding: 16px; }
  .order-filters { grid-template-columns: 1fr; }
  .order-filters > div:first-of-type { grid-column: auto; }
  .filter-actions { flex-wrap: wrap; }
  .filter-actions .btn { flex: 1; justify-content: center; }
  .pos-grid { gap: 12px; }
  .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .sidebar, .topbar, .no-print, .menu-toggle { display: none !important; }
  .main, .content { padding: 0; margin: 0; }
  @page { margin: 3mm; }
  html, body.receipt-page { width: 74mm; min-width: 0; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .receipt { box-sizing: border-box; width: 74mm; max-width: 74mm; margin: 0 auto; padding: 2mm 1mm; box-shadow: none; border-radius: 0; overflow: visible; }
  .receipt table { table-layout: fixed; }
  .receipt th, .receipt td { overflow-wrap: anywhere; }
}

/* ---------------- Alerts (inline notices) ---------------- */
.alert {
  padding: 11px 14px; border-radius: 10px; font-size: 13px; line-height: 1.55;
  border: 1px solid transparent;
}
.alert a { color: inherit; font-weight: 700; }
.alert-info    { background: var(--pink-soft); color: var(--pink-dark); border-color: #efb9d0; }
.alert-warning { background: #fff7e2; color: #795600; border-color: #ecd89d; }
.alert-danger  { background: #fff0f0; color: #a52e38; border-color: #f0c2c5; }
.alert-success { background: #eaf7ef; color: #21633c; border-color: #b9e3c8; }


/* ---------------- Status timeline ---------------- */
.timeline { position: relative; padding-left: 22px; margin: 4px 0 0; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line); border-radius: 2px;
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -22px; top: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: #a5949d; border: 3px solid var(--black-2);
  box-shadow: 0 0 0 2px var(--line);
}
.dot-pending   { background: #fbbf24; box-shadow: 0 0 0 2px rgba(251,191,36,.35); }
.dot-washing   { background: #4b87c4; box-shadow: 0 0 0 2px rgba(75,135,196,.25); }
.dot-ready     { background: #328755; box-shadow: 0 0 0 2px rgba(50,135,85,.22); }
.dot-picked_up { background: var(--pink); box-shadow: 0 0 0 2px var(--pink-glow); }
.dot-cancelled { background: #c94c56; box-shadow: 0 0 0 2px rgba(201,76,86,.22); }
.timeline-head {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
  font-size: 13px;
}
.timeline-body .small { margin-top: 1px; }

/* ---------------- Order status timeline ---------------- */
.order-status-timeline .timeline-item.is-complete .timeline-dot,
.order-status-timeline .timeline-item.is-current .timeline-dot {
  background: #5e9b69;
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(94,155,105,.28);
}
.order-status-timeline .timeline-item.is-current .timeline-dot {
  box-shadow: 0 0 0 3px rgba(94,155,105,.40);
}
.order-status-timeline .timeline-item.is-complete .timeline-head strong,
.order-status-timeline .timeline-item.is-current .timeline-head strong { color: var(--ink); }
.order-status-timeline .timeline-item.is-complete .timeline-body,
.order-status-timeline .timeline-item.is-current .timeline-body { color: #526858; }
.order-status-timeline .timeline-item.is-future .timeline-dot {
  background: #c6bec7;
  border-color: #fff;
  box-shadow: 0 0 0 2px #e4dde5;
}
.order-status-timeline .timeline-item.is-future .timeline-head strong,
.order-status-timeline .timeline-item.is-future .timeline-body { color: #aaa1aa; }
/* ---------------- Checkbox rows (settings) ---------------- */
.checkbox-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; font-size: 14px; color: var(--ink); cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.checkbox-row:last-of-type { border-bottom: none; }
.checkbox-row input[type="checkbox"] {
  width: 17px; height: 17px; margin: 1px 0 0; flex: 0 0 auto;
  accent-color: var(--pink); cursor: pointer;
}
.checkbox-row span { line-height: 1.5; }
.checkbox-row:hover span { color: var(--pink-light); }

/* ---------------- Theme extras ---------------- */
::selection { background: var(--pink); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--black-4); border-radius: 6px; border: 2px solid var(--black); }
::-webkit-scrollbar-thumb:hover { background: var(--pink-dark); }
.card h2, .card h3 { color: var(--ink); }
.muted, .small.muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); }
code { background: var(--black-3); color: var(--pink-dark); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
select option { background: var(--black-3); color: var(--ink); }
.empty-state { color: var(--muted); }
.track-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #fff8fb, #fdeaf2); }
.track-card { width: 100%; max-width: 500px; padding: 30px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.track-brand { color: var(--pink-dark); font-weight: 700; }
.track-card h1 { margin: 10px 0 4px; color: var(--ink); font-size: 25px; }
.track-card .flash { margin: 14px 0; }
.track-result { margin: 18px 0; padding: 16px; background: var(--black-3); border: 1px solid var(--line); border-radius: 12px; }
.track-result h2 { margin: 10px 0; }
.track-result p:last-child { margin-bottom: 0; }
.track-foot { border-top: 1px solid var(--line); padding-top: 14px; margin: 20px 0 0; font-size: 13px; }
.customer-order-card { max-width: 760px; }
.customer-order-card form { margin-top: 20px; }
.customer-order-card h2.customer-category { margin: 22px 0 8px; font-size: 17px; }
.customer-service { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.customer-quantity { width: 105px; flex: 0 0 105px; margin: 0; }
.customer-quantity input { margin-top: 4px; }
.customer-line-estimate { margin-top: 4px; color: var(--pink-dark); font-size: 12px; font-weight: 600; }
.customer-order-estimate { display: grid; gap: 4px; margin: 18px 0; padding: 14px; background: var(--black-3); border: 1px solid var(--line); border-radius: 10px; }
.customer-order-estimate strong { color: var(--pink-dark); font-size: 20px; }
.customer-result { margin: 16px 0; line-height: 1.8; }
.customer-order-card textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }
.laundry-progress { display: flex; gap: 8px; list-style: none; margin: 18px 0 10px; padding: 0; }
.laundry-progress li { position: relative; flex: 1; padding-top: 18px; text-align: center; color: var(--muted); font-size: 12px; }
.laundry-progress li::before { content: ''; position: absolute; top: 0; left: calc(50% - 6px); width: 12px; height: 12px; border: 2px solid var(--line); border-radius: 50%; background: #fff; }
.laundry-progress li.complete::before, .laundry-progress li.current::before { border-color: var(--pink); background: var(--pink); }
.laundry-progress li.current { color: var(--pink-dark); font-weight: 700; }
@media (max-width: 480px) { .track-card { padding: 22px 18px; } }

/* ---------------- Mobile-app visual theme ---------------- */
html { min-width: 320px; }
body { background: var(--bg); color: var(--ink); }
a { color: var(--pink-light); }
a:hover { color: var(--pink-dark); }

.sidebar {
  width: 252px;
  background: linear-gradient(180deg, #241d26 0%, #18131a 100%);
  border-right: 1px solid #3b303e;
  color: #fffaf2;
  box-shadow: 1px 0 0 rgba(24,19,26,.08);
}
.brand { padding: 22px 20px 18px; }
.brand-name { color: #fffaf2; }
.brand-icon { filter: drop-shadow(0 0 10px rgba(138,85,148,.25)); }
.brand-sub { color: #c7bac8; letter-spacing: .08em; }
.nav { padding: 10px 12px; gap: 4px; }
.nav-link { min-height: 42px; color: #e6dbe9; border-radius: 10px; }
.nav-link:hover { background: #34273a; color: #fffaf2; }
.nav-link.active { background: linear-gradient(100deg, #58265f, #80528a); color: #fff; box-shadow: 0 5px 15px rgba(88,38,95,.35); font-weight: 650; }
.nav-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  filter: none;
  opacity: 1;
  font-size: 16px;
  flex: 0 0 30px;
}
.nav-icon-dashboard { background: #e7dcf2; color: #694779; }
.nav-icon-orders { background: #dceaf5; color: #35658a; }
.nav-icon-notifications { background: #f8e9c9; color: #956d21; }
.nav-icon-customers { background: #e4dff3; color: #63518b; }
.nav-icon-services { background: #f3dce9; color: #9b4d72; }
.nav-icon-reports { background: #dcecdf; color: #426c49; }
.nav-icon-employees { background: #dce9f3; color: #486c88; }
.nav-icon-delivery_drivers { background: #f3e0cf; color: #9a6035; }
.nav-icon-reviews { background: #f6ebc8; color: #8a6a25; }
.nav-icon-settings { background: #e6e1eb; color: #66566f; }
.nav-icon-profile { background: #dce9f3; color: #486c88; }
.nav-icon-logout { background: #f3dce0; color: #994754; }
.nav-link.active .nav-icon { box-shadow: 0 1px 3px rgba(24,19,26,.12); }
.nav-link.small { font-size: 13px; padding: 8px 12px; }
.sidebar-footer { background: #241d26; border-top: 1px solid #3b303e; padding: 12px; }
.user-chip { color: #fffaf2; }
.user-name { color: #fffaf2; }
.user-role { color: #c7bac8; }
.avatar { background: linear-gradient(135deg, #8a5594, #58265f); box-shadow: 0 0 0 2px #241d26, 0 0 0 3px #8a5594; }
.sidebar-footer .nav-link.small { color: #e6dbe9; }
.sidebar-footer .nav-link.small:hover { color: #fffaf2; }

.topbar {
  min-height: 72px;
  padding: 14px 30px;
  background: rgba(36,29,38,.97);
  color: #fffaf2;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #3b303e;
}
.topbar-title h1 { color: #fffaf2; font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
.topbar-title h1::before { display: inline-block; background: #8a5594; }
.topbar-title p, .today { color: #c7bac8; }
.menu-toggle { background: #362c39; color: #fffaf2; border-color: #514355; }
.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 28px 30px 44px; }

.flash { border-radius: 10px; font-size: 14px; }
.flash-info { background: #f2eaf4; color: #49204f; border-color: #ded3df; }
.card, .login-card, .track-card {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 20px; }
.card h2, .card h3 { letter-spacing: -.01em; color: var(--ink); }
.stat-card { border-top: 3px solid #8a5594; }
.stat-card .stat-value { letter-spacing: -.025em; }
.stat-card .stat-icon { color: #8a5594; }

th { background: #f2eaf4; color: #58265f; letter-spacing: .035em; }
tbody tr:hover { background: #f6efe6; }
td, th { padding: 11px 12px; }
.table-wrap { max-width: 100%; }

.btn {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 600;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary, .btn-primary:hover {
  background: #58265f;
  border-color: #58265f;
  color: #fff;
  box-shadow: 0 4px 12px rgba(88,38,95,.18);
  filter: none;
}
.btn-primary:hover { background: #49204f; border-color: #49204f; }
.btn-outline { border-color: #cfc2d1; background: #fffaf2; color: #201820; }
.btn-outline:hover { border-color: #8a5594; background: #f2eaf4; color: #58265f; }
.btn-danger { border-color: #e6c5c9; background: #fffaf2; color: #a43e4a; }
.btn-danger:hover { border-color: #d09ba2; background: #fbe6e8; }

input, select, textarea { min-height: 40px; border-color: #cfc2d1; border-radius: 10px; }
textarea { min-height: 96px; }
input:disabled, select:disabled, textarea:disabled { background: #f2eaf4; color: #786f78; }
input::placeholder, textarea::placeholder { color: #988d99; }
label { color: #514653; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(138,85,148,.28);
  outline-offset: 2px;
}

.pill.active, .pagination .current { background: #58265f; border-color: #58265f; box-shadow: 0 4px 12px rgba(88,38,95,.18); }
.service-btn { background: #fffaf2; border-radius: 12px; }
.service-btn:hover { box-shadow: 0 0 0 3px rgba(138,85,148,.12); transform: none; }
.service-btn .s-price, .summary-row.total { color: #bd7841; }
.bar { background: linear-gradient(180deg, #8a5594, #58265f); box-shadow: 0 0 12px rgba(88,38,95,.14); }
.modal-overlay { background: rgba(24,19,26,.58); }
.modal { background: #fffaf2; border-radius: 14px; }
.login-wrap, .track-page { background: #18131a; }
.login-card { background: #fffaf2; border-color: #ded3df; border-top: 3px solid #8a5594; box-shadow: 0 14px 34px rgba(24,19,26,.28); }
.login-brand .icon, .track-brand { filter: none; }
.login-err { border-radius: 10px; }
.track-card { background: #fffaf2; }
.track-result, .customer-order-estimate { border-radius: 12px; background: #f2eaf4; }
.track-auth-card h1 { margin: 0 0 8px; font-size: 22px; }
.track-auth-card .track-brand { display: none; }
.customer-order-card { max-width: 920px; }@media (max-width: 900px) {
  .content { padding: 22px 22px 36px; }
}
@media (max-width: 760px) {
  .sidebar { width: min(290px, 86vw); box-shadow: 12px 0 30px rgba(24,32,42,.14); }
  .content { padding: 18px 16px 30px; }
  .topbar { min-height: 64px; padding: 11px 16px; }
  .topbar-title h1 { font-size: 19px; }
  .flash { margin-left: 16px; margin-right: 16px; }
}
@media (max-width: 480px) {
  .content { padding: 14px 12px 26px; }
  .topbar { gap: 10px; }
  .topbar-right .btn { white-space: normal; }
  .row-between { align-items: flex-start; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }
  .laundry-progress { gap: 4px; }
  .laundry-progress li { font-size: 10px; }
}

/* ---------------- Mobile admin navigation and dashboard ---------------- */
.sidebar-backdrop { display: none; }
.menu-toggle { width: 42px; height: 42px; padding: 0; align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }

@media (max-width: 760px) {
  body.nav-open { overflow: hidden; }
  .sidebar {
    width: min(284px, calc(100vw - 48px));
    height: 100dvh;
    top: 0;
    bottom: 0;
    z-index: 70;
    visibility: hidden;
    pointer-events: none;
    will-change: transform;
  }
  .sidebar.open { visibility: visible; pointer-events: auto; }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(24, 19, 26, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: inline-flex; flex: 0 0 42px; }
  .topbar { width: 100%; min-width: 0; }
  .topbar-title { min-width: 0; }
  .topbar-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { min-width: 0; overflow-x: clip; }
  .grid.stats { grid-template-columns: 1fr; gap: 12px; }
  .grid.two { gap: 14px; }
  .card { min-width: 0; }
  .table-wrap { margin: 0 -4px; padding: 0 4px 4px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .table-wrap table { min-width: 560px; }
  th, td { padding: 10px 9px; }
  .bar-chart { min-width: 0; height: 150px; gap: 4px; }
  .bar-lbl { font-size: 10px; }
}

@media (max-width: 390px) {
  .content { padding: 12px 10px 24px; }
  .topbar { padding: 10px 12px; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-title p { font-size: 12px; }
  .card { padding: 14px; }
  .table-wrap table { min-width: 520px; }
}

[hidden] { display: none !important; }
.notification-count {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #d7a54a;
  color: #201820;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.notification-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: grid;
  gap: 4px;
  width: min(390px, calc(100vw - 32px));
  padding: 16px 18px;
  border: 1px solid #ded3df;
  border-left: 5px solid #80528a;
  border-radius: 13px;
  background: #fffaf2;
  color: #201820;
  box-shadow: 0 12px 35px rgba(24,19,26,.22);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.notification-toast.visible { opacity: 1; transform: translateY(0); }
.notification-toast strong { color: #49204f; }
.notification-toast span { color: #624b56; font-size: 13px; }
.notification-toast:hover { color: #201820; }
tr:target { background: #f2eaf4; }
@media (max-width: 560px) {
  .notification-toast { right: 16px; bottom: 16px; }
}
