/* Tulip Delivery — shared styles (admin + driver) */
:root {
  --brand: #c2255c; --brand-2: #e64980; --brand-soft: #fff0f6;
  --ink: #1d2230; --muted: #6b7280; --line: #e5e7eb; --bg: #f4f5f7; --card: #ffffff;
  --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fff4e0; --bad: #c92a2a; --bad-soft: #ffeaea;
  --info: #1c64d1; --info-soft: #e8f0fe; --violet: #6d28d9; --violet-soft: #f1eafe; --grey-soft: #eef0f3;
  --r: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "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.45; -webkit-font-smoothing: antialiased; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
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); background: #fff; color: var(--ink); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; text-decoration: none; }
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #a61e4d; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: #fff; border-color: #f1a7a7; color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 32px; padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.big { min-height: 52px; font-size: 17px; border-radius: 12px; }
.btn.block { width: 100%; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid #d5d9e0; border-radius: 10px; padding: 9px 11px; background: #fff; width: 100%; min-height: 40px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: transparent; }
label { font-weight: 600; font-size: 13px; color: #374151; display: block; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 8px; 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 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-new { background: var(--warn-soft); color: var(--warn); }
.st-assigned { background: var(--info-soft); color: var(--info); }
.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: #9ca3af; flex: none; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.dot.mid { background: #f59e0b; }
.dot.off { background: #ef4444; }

/* 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: #111827; color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-weight: 600; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
.modal-back { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 1500; padding: 4vh 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: min(720px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.narrow { width: min(460px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 8px; }
.modal-h h2 { margin: 0; font-size: 17px; }
.modal-b { padding: 16px; }
.modal-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }

/* photos */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: #eee; cursor: zoom-in; }
.thumb-add { width: 84px; height: 84px; border-radius: 10px; border: 2px dashed #cbd0d8; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; background: #fafbfc; text-align: center; gap: 2px; }
.thumb-wrap { position: relative; }
.thumb-wrap .rm { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #111827; color: #fff; font-size: 14px; line-height: 22px; cursor: pointer; }
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 3000; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }

/* 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: #fafbfc; color: #4b5563; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; z-index: 1; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfcfd; }
td.num, th.num { text-align: right; }
tr.total td { font-weight: 800; background: #fafbfc; }

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

/* auth screens */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #fff0f6 0%, #f4f5f7 55%); }
.auth .card { width: min(400px, 100%); padding: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; }
.err { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 20px; }
