/**
 * GREEN DESIGN SYSTEM (GDS)
 * ============================================================
 * The single shared component library for every Workspace — Driver,
 * Pharmacist, Branch Manager, Warehouse Manager, and every future one
 * (Customer, Cashier, Doctor, Communication Center, Attendance).
 * Requested explicitly to stop each Workspace inventing its own
 * button/card/color variants (dw-btn, ph-card, bm-mstat, wh-pill were
 * all slightly different before this file — that drift is exactly
 * what this fixes).
 *
 * Scope: this file defines REUSABLE PRIMITIVES only (buttons, cards,
 * badges, tables, forms, timeline, empty states, dialogs). It does
 * NOT replace each Workspace's own layout file (driver-workspace.css
 * etc still owns things specific to that Workspace's shape — the
 * full-bleed mobile-card layout, the kanban board grid). Migrating
 * existing dw-*/ph-*/bm-*/wh-* classes onto gds- primitives is a
 * follow-up pass per Workspace, not done in this file's first
 * version — see the migration note at the bottom.
 *
 * Colors/spacing/radii are NOT redefined here — every token below is
 * the existing :root set from style.css (--primary, --dark-green,
 * --mint, --gold, --danger, --border, --shadow, --radius, etc). This
 * file only defines component shapes, never a second color palette.
 *
 * Naming: every class is prefixed `gds-` so it can never collide
 * with an existing dash-*/dw-*/ph-*/bm-*/wh-* class during the
 * gradual migration.
 * ============================================================ */

/* ---------- Buttons ---------- */
.gds-btn { border: 0; border-radius: 10px; padding: 11px 16px; font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: filter .15s ease; }
.gds-btn:hover { filter: brightness(0.95); }
.gds-btn:disabled { opacity: .55; cursor: default; filter: none; }
.gds-btn-block { width: 100%; }
.gds-btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.gds-btn-lg { padding: 15px 20px; font-size: 14.5px; }

.gds-btn-primary { background: var(--primary); color: #fff; }
.gds-btn-secondary { background: var(--mint); color: var(--primary-dark); }
.gds-btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--text); }
.gds-btn-danger { background: #fff; border: 1.5px solid #FCA5A5; color: var(--danger); }
.gds-btn-danger-solid { background: var(--danger); color: #fff; }
.gds-btn-ghost { background: transparent; color: var(--muted); }
.gds-btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }

/* ---------- Cards ---------- */
.gds-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.gds-card-lg { border-radius: var(--radius-lg); padding: 20px; }
.gds-card-flat { background: var(--mint-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.gds-card-selected { border-color: var(--primary); background: var(--mint); }
.gds-card-clickable { cursor: pointer; transition: border-color .15s ease; }
.gds-card-clickable:hover { border-color: var(--primary); }
.gds-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.gds-card-header h3 { font-size: 13.5px; margin: 0; display: flex; align-items: center; gap: 8px; }

/* ---------- Status Badges ---------- */
.gds-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.gds-badge-neutral { background: var(--mint); color: var(--primary-dark); }
.gds-badge-success { background: #DCFCE7; color: #166534; }
.gds-badge-warning { background: #FEF3C7; color: #92400E; }
.gds-badge-danger { background: #FEE2E2; color: #991B1B; }
.gds-badge-info { background: #DBEAFE; color: #1D4ED8; }
.gds-badge-purple { background: #F3E8FF; color: #6B21A8; }
.gds-badge-gold { background: var(--gold); color: #1A2E22; }
/* Order-status-specific mapping, so every Workspace shows the same
   color for the same status instead of picking one ad hoc */
.gds-badge-pending, .gds-badge-assigned { background: #FEE2E2; color: #991B1B; }
.gds-badge-confirmed, .gds-badge-accepted { background: #FEF3C7; color: #92400E; }
.gds-badge-processing, .gds-badge-picked_up, .gds-badge-on_the_way { background: #FEF3C7; color: #92400E; }
.gds-badge-out_for_delivery, .gds-badge-arrived { background: #DBEAFE; color: #1D4ED8; }
.gds-badge-delivered { background: #DCFCE7; color: #166534; }
.gds-badge-cancelled, .gds-badge-failed, .gds-badge-rejected, .gds-badge-recalled { background: #FEE2E2; color: #991B1B; }

/* ---------- Tables ---------- */
.gds-table { width: 100%; border-collapse: collapse; }
.gds-table th { text-align: right; font-size: 11px; color: var(--muted); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.gds-table td { padding: 10px; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.gds-table tr:last-child td { border-bottom: 0; }
.gds-table tr.gds-row-clickable { cursor: pointer; }
.gds-table tr.gds-row-clickable:hover { background: var(--mint-2); }

/* ---------- Forms ---------- */
.gds-field { margin-bottom: 14px; }
.gds-field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.gds-field input, .gds-field select, .gds-field textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--border);
  font-family: inherit; font-size: 13px; background: #fff; color: var(--text);
}
.gds-field input:focus, .gds-field select:focus, .gds-field textarea:focus { outline: none; border-color: var(--primary); }
.gds-field-error { color: var(--danger); font-size: 11.5px; margin-top: 4px; display: none; }
.gds-field-error.show { display: block; }
.gds-field-row { display: flex; gap: 10px; }
.gds-field-row .gds-field { flex: 1; }

/* ---------- Timeline ---------- */
.gds-timeline { position: relative; padding-right: 20px; }
.gds-timeline-item { position: relative; padding-bottom: 16px; }
.gds-timeline-item:last-child { padding-bottom: 0; }
.gds-timeline-item::before { content: ''; position: absolute; right: -20px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.gds-timeline-item::after { content: ''; position: absolute; right: -17px; top: 14px; bottom: -2px; width: 1.5px; background: var(--border); }
.gds-timeline-item:last-child::after { display: none; }
.gds-timeline-item strong { font-size: 12.5px; display: block; }
.gds-timeline-item span { font-size: 11px; color: var(--muted); }

/* ---------- Empty States ---------- */
.gds-empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.gds-empty i { font-size: 32px; color: var(--border); margin-bottom: 12px; display: block; }
.gds-empty h4 { font-size: 14px; color: var(--text); margin: 0 0 6px; }
.gds-empty p { font-size: 12.5px; margin: 0 0 14px; }

/* ---------- Dialogs / Modals ---------- */
.gds-dialog-backdrop { position: fixed; inset: 0; background: rgba(11,68,41,.5); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gds-dialog { background: #fff; border-radius: var(--radius-lg); padding: 24px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); }
.gds-dialog h3 { font-size: 16px; margin: 0 0 10px; }
.gds-dialog p { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.gds-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Loading ---------- */
.gds-loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--muted); font-size: 20px; }

/* ============================================================
   MIGRATION NOTE (not yet done, tracked here per §5's living-gap
   convention): dw-btn/ph-card/bm-mstat/wh-pill etc in the four
   already-integrated Workspaces predate this file and still work —
   nothing broke by adding this. Migrating each Workspace's markup
   onto gds- classes is a follow-up pass, one Workspace at a time,
   not a mass find-and-replace that risks breaking working screens.
   ============================================================ */
