/* ops.gravygo.co.in: the team's order dashboard and its set-up page. */
:root {
  --text: #17201a; --muted: #5f6b64; --line: #e3e7e4; --soft: #f4f6f5; --bg: #f2f4f3; --white: #fff;
  --green: #19552f; --green-dark: #0f3d22; --green-soft: #e3f0e7; --orange: #c2560a; --orange-soft: #fdecd9;
  --blue: #1a4f8a; --blue-soft: #e0ecfa; --red: #b42318; --red-soft: #fde8e7; --grey-soft: #eceeed;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,20,.06), 0 8px 24px -12px rgba(16,24,20,.18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Buttons and fields ---------- */
.btn { min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14px; background: var(--white); border-color: #cfd5d1; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: #b4bcb7; }
.btn:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .tab:focus-visible, .order-row:focus-visible { outline: 3px solid rgba(25,85,47,.35); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { color: #fff; background: var(--green); border-color: var(--green); }
.btn--primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn--danger { color: var(--red); border-color: #f0c6c3; }
.btn--danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--soft); border-color: transparent; }
.btn--small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--wide { width: 100%; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: #3a453f; }
.field label span { font-weight: 500; color: var(--muted); }
.field input, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfd5d1; border-radius: 10px; background: #fff; font-size: 16px; }
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
/* Password box with a show / hide eye */
.pw { position: relative; }
.pw input { padding-right: 48px; }
.pw__toggle { position: absolute; top: 50%; right: 4px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: transparent; transform: translateY(-50%); }
.pw__toggle:hover { color: var(--text); background: var(--soft); }
.pw__toggle:focus-visible { outline: 3px solid rgba(25,85,47,.35); outline-offset: 0; }
.pw__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw__toggle .eye-off, .pw__toggle[aria-pressed="true"] .eye { display: none; }
.pw__toggle[aria-pressed="true"] .eye-off { display: block; }
/* The password rules, ticking off as they're met */
.rules { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.rules li { display: flex; align-items: center; gap: 8px; }
.rules li::before { content: ""; width: 16px; height: 16px; flex: none; border: 1.5px solid #b8c1bc; border-radius: 50%; box-sizing: border-box; }
.rules li.ok { color: var(--green-dark); }
.rules li.ok::before { border-color: var(--green); background: var(--green) no-repeat center / 10px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.5l2.2 2.2L9.5 3.5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.rules li.bad { color: var(--red); }
.rules li.bad::before { border-color: var(--red); }
.error { margin: 0; color: var(--red); font-size: 13.5px; font-weight: 500; }
.error:empty { display: none; }

/* ---------- Sign-in and set-up ---------- */
.auth { min-height: 100vh; padding: 24px 16px; display: grid; place-items: center; background: radial-gradient(120% 80% at 50% 0%, #e6efe9 0%, var(--bg) 60%); }
.auth__card { width: min(420px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); display: grid; gap: 16px; }
.auth__card--wide { width: min(560px, 100%); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 52px; height: auto; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.auth h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.auth form { display: grid; gap: 14px; }
.code-input { text-align: center; font-size: 26px !important; font-weight: 700; letter-spacing: .4em; font-variant-numeric: tabular-nums; }
.link-button { justify-self: start; padding: 0; border: 0; background: none; color: var(--green); font-weight: 600; font-size: 13.5px; }
.secure-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 12.5px; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 18px; counter-reset: step; }
.steps > li { display: grid; gap: 10px; padding-left: 38px; position: relative; }
.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--green); font-size: 13px; font-weight: 700; }
.steps h2 { margin: 0; font-size: 16px; }
.qr { width: 196px; height: 196px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .08em; word-break: break-all; }
.recovery { margin: 0; padding: 14px; border: 1px dashed #b9c3bd; border-radius: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; background: var(--soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; list-style: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); }

/* ---------- Dashboard frame ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
.top .brand img { width: 42px; }
.top__stats { margin-left: auto; display: flex; gap: 18px; color: var(--muted); font-size: 13px; }
.top__stats strong { display: block; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.top__me { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.wrap { width: min(1200px, 100%); margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) 48px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px; border-radius: 12px; background: #e6eae8; }
.tabs::-webkit-scrollbar { display: none; }
.tab { min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #4a5650; font-weight: 600; font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tab .count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: rgba(0,0,0,.07); font-size: 12px; }
.tab[data-status="paid"] .count:not(:empty) { color: #fff; background: var(--orange); }
.search { flex: 1 1 220px; min-width: 0; }
.search input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid #cfd5d1; border-radius: 10px; background: #fff; font-size: 15px; }
.updated { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- Order list ---------- */
.list { display: grid; gap: 10px; }
.empty { padding: 48px 16px; border: 1px dashed #c9d1cc; border-radius: var(--radius); text-align: center; color: var(--muted); background: rgba(255,255,255,.6); }
.order-row { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) auto; gap: 6px 18px; align-items: center; text-align: left; }
.order-row:hover { border-color: #c9d1cc; }
.order-row.is-urgent { border-left: 4px solid var(--orange); padding-left: 13px; }
.order-row__who strong { display: block; font-size: 15px; }
.order-row__who span, .order-row__what span { color: var(--muted); font-size: 13px; }
.order-row__what { min-width: 0; }
.order-row__what strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; }
.order-row__money { display: grid; justify-items: end; gap: 4px; }
.order-row__money strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.chip { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip--paid { color: var(--orange); background: var(--orange-soft); }
.chip--packed { color: #6b4e00; background: #fbf0c9; }
.chip--dispatched { color: var(--blue); background: var(--blue-soft); }
.chip--delivered { color: var(--green-dark); background: var(--green-soft); }
.chip--cancelled, .chip--refunded { color: var(--muted); background: var(--grey-soft); }
.chip--gift { color: #7a3fa0; background: #f3e8fa; }
.age { color: var(--orange); font-weight: 700; }

/* ---------- Order detail (a panel from the right; full screen on phones) ---------- */
.panel { position: fixed; inset: 0 0 0 auto; z-index: 40; width: min(560px, 100%); max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; background: var(--bg); box-shadow: -20px 0 60px rgba(0,0,0,.18); }
.panel[open] { display: flex; flex-direction: column; }
.panel::backdrop { background: rgba(10,20,14,.35); }
.panel__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.panel__head h2 { margin: 0; font-size: 17px; }
.panel__head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.panel__close { margin-left: auto; width: 38px; height: 38px; border: 1px solid #cfd5d1; border-radius: 50%; background: #fff; position: relative; }
.panel__close::before, .panel__close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 15px; height: 1.8px; border-radius: 2px; background: var(--text); }
.panel__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.panel__close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.panel__body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; display: grid; gap: 14px; align-content: start; overscroll-behavior: contain; }
.card { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; display: grid; gap: 8px; }
.card h3 { margin: 0; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card p { margin: 0; }
.card .big { font-size: 16px; font-weight: 600; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.steps-line { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps-line li { position: relative; padding-top: 18px; color: var(--muted); font-size: 12px; }
.steps-line li::before { content: ""; position: absolute; top: 2px; left: 0; width: 10px; height: 10px; border: 2px solid #c6ccc8; border-radius: 50%; background: #fff; }
.steps-line li::after { content: ""; position: absolute; top: 7px; left: 14px; right: 2px; height: 2px; background: #e1e5e2; }
.steps-line li:last-child::after { display: none; }
.steps-line li.done::before { border-color: var(--green); background: var(--green); }
.steps-line li.done::after { background: var(--green); }
.steps-line strong { display: block; color: var(--text); font-size: 12.5px; }
.items { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.items li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.items .total { padding-top: 8px; border-top: 1px dashed #cdd4d0; font-weight: 700; }
.porter-form { display: grid; gap: 12px; }
.porter-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.history { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.history strong { color: var(--text); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.notice { padding: 10px 12px; border-radius: 10px; font-size: 13px; background: var(--orange-soft); color: #7a3c06; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px); padding: 12px 16px; border-radius: 12px; color: #fff; background: #17201a; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 10px; }
  .top__stats { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .top__me { margin-left: auto; }
  .order-row { grid-template-columns: minmax(0, 1fr) auto; }
  .order-row__what { grid-column: 1 / -1; grid-row: 2; }
  .panel { width: 100%; }
  .porter-form .two { grid-template-columns: 1fr; }
  .steps-line { grid-template-columns: 1fr 1fr; row-gap: 12px; }
  .steps-line li:nth-child(2)::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
