/* Tulip Delivery — shared styles (admin + driver + tracking). White & beige, calm and simple, black like the TF logo. */
:root {
  --ink: #2b2622; --ink-2: #4a423b; --muted: #867b70; --line: #ebe4da; --line-2: #ddd3c5;
  --bg: #faf8f4; --card: #ffffff; --beige: #f5f0e8; --beige-2: #ece4d7; --sand: #d8cab5;
  --accent: #9a7a55; --accent-soft: #f5eee4;
  --brand: #2b2622; --brand-2: #b08d63; --brand-soft: #f5f0e8;
  --ok: #3b7752; --ok-soft: #e8f2eb; --warn: #9c6719; --warn-soft: #faf0dd; --bad: #a5463c; --bad-soft: #f9e9e6;
  --info: #3f698a; --info-soft: #e9f0f5; --violet: #67588c; --violet-soft: #efebf6; --teal: #2f726d; --teal-soft: #e4f1ef; --grey-soft: #f2eee8;
  --r: 14px; --shadow: 0 1px 2px rgba(43, 38, 34, .04), 0 3px 10px rgba(43, 38, 34, .045); --shadow-lg: 0 24px 60px rgba(43, 38, 34, .2);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15.5px; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1 1 auto; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* buttons & inputs */
.btn { appearance: none; border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 10px; padding: 9px 15px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; text-decoration: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover { background: var(--beige); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #453d36; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { background: #326848; }
.btn.go { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.bad { background: #fff; border-color: #e7c3bd; color: var(--bad); }
.btn.bad:hover { background: var(--bad-soft); }
.btn.soft { background: var(--beige); border-color: var(--beige-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--beige); }
.btn.small { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn.big { min-height: 54px; font-size: 17px; border-radius: 14px; }
.btn.block { width: 100%; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; background: #fff; width: 100%; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(176, 141, 99, .22); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); }
label { font-weight: 600; font-size: 13px; color: var(--ink-2); display: block; margin-bottom: 5px; }
.field { margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: 15px; color: var(--ink); }
.check input { width: 18px; height: 18px; min-height: 0; }

/* cards, badges */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; letter-spacing: .01em; }
.st-new { background: var(--warn-soft); color: var(--warn); }
.st-assigned { background: var(--info-soft); color: var(--info); }
.st-picked_up { background: var(--teal-soft); color: var(--teal); }
.st-on_the_way { background: var(--violet-soft); color: var(--violet); }
.st-delivered { background: var(--ok-soft); color: var(--ok); }
.st-failed { background: var(--bad-soft); color: var(--bad); }
.st-cancelled { background: var(--grey-soft); color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #c9bfb2; flex: none; }
.dot.on { background: #4caf74; box-shadow: 0 0 0 3px rgba(76, 175, 116, .2); }
.dot.mid { background: #d49a3a; }
.dot.off { background: #c4574c; }

/* toast & modal */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 2000; width: min(92vw, 420px); }
.toast { background: var(--ink); color: #fff; padding: 12px 15px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font-weight: 600; animation: rise .2s ease; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.modal-back { position: fixed; inset: 0; background: rgba(43, 38, 34, .38); display: flex; align-items: flex-start; justify-content: center; z-index: 1500; padding: 4vh 12px; overflow-y: auto; animation: fade .15s ease; backdrop-filter: blur(2px); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 18px; width: min(720px, 100%); box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.modal.narrow { width: min(470px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); gap: 8px; }
.modal-h h2 { margin: 0; font-size: 17px; }
.modal-b { padding: 18px; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: #fcfbf8; border-radius: 0 0 18px 18px; }
.x { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.x:hover { background: var(--beige); }

/* photos */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); background: var(--beige); cursor: zoom-in; }
.thumb-add { width: 84px; height: 84px; border-radius: 12px; border: 1.5px dashed var(--sand); display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--ink-2); font-size: 12px; font-weight: 700; cursor: pointer; background: var(--beige); text-align: center; gap: 2px; font-family: inherit; }
.thumb-add:hover { border-color: var(--accent); }
.thumb-wrap { position: relative; }
.thumb-wrap .rm { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 14px; line-height: 22px; cursor: pointer; }
.viewer { position: fixed; inset: 0; background: rgba(20, 17, 15, .9); z-index: 3000; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 96vw; max-height: 92vh; border-radius: 10px; }
.photo-group { margin-top: 4px; }
.photo-group .lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 8px 0 4px; }

/* tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
th { background: #fbf9f5; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; position: sticky; top: 0; z-index: 1; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fdfbf8; }
td.num, th.num { text-align: right; }
tr.total td { font-weight: 800; background: #fbf9f5; }

.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--beige-2); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* logo */
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 38px; height: 38px; flex: none; display: block; }
.wordmark { font-variant: small-caps; font-variant-ligatures: none; letter-spacing: .2em; font-weight: 600; font-size: 17px; line-height: 1.1; white-space: nowrap; }
.wordmark small { display: block; font-variant: normal; text-transform: none; letter-spacing: .04em; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; }

/* sign-in screens */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1200px 600px at 20% 0%, #fff 0%, var(--beige) 55%, var(--beige-2) 100%); }
.auth .card { width: min(410px, 100%); padding: 28px 26px; border-radius: 20px; box-shadow: var(--shadow-lg); border-color: #fff; }
.auth .brandbox { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 18px; text-align: center; }
.auth .brandbox .logo-mark { width: 74px; height: 74px; }
.auth h2 { text-align: center; font-weight: 600; color: var(--ink-2); font-size: 16px; }
.err { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 20px; }

/* coloured notice boxes */
.banner { border-radius: 12px; padding: 11px 13px; margin-bottom: 12px; font-weight: 600; border: 1px solid transparent; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0dcb8; }
.banner.bad { background: var(--bad-soft); color: var(--bad); border-color: #efcdc7; }
.banner.info { background: var(--beige); color: var(--ink-2); border-color: var(--beige-2); }
.banner.ok { background: var(--ok-soft); color: var(--ok); border-color: #cfe4d6; }
