/* ============================================================
   BMS Staff PWA — Modern operations dashboard
   Clean, data-dense, cohesive brand (gold) on a cool light shell.
   ============================================================ */

:root {
  --ink:       #1f2330;
  --ink-soft:  #5d6473;
  --gold:      #b89a5e;
  --gold-deep: #9a7d44;
  --bg:        #f3f4f7;
  --panel:     #ffffff;
  --line:      #e6e8ee;
  --brand:     #2c3047;
  --ok:        #2e9e6b;
  --warn:      #d8922b;
  --danger:    #c4503a;
  --info:      #3d6fb4;
  --shadow:    0 8px 28px rgba(31, 35, 48, 0.08);
  --shadow-sm: 0 3px 12px rgba(31, 35, 48, 0.06);
  --font:      'Jost', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-ar:   'Tajawal', 'Segoe UI', system-ui, sans-serif;
  --radius: 12px;
  --side: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
[dir='rtl'] body { font-family: var(--font-ar); }
h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 600; }
a { color: inherit; text-decoration: none; }

.muted { color: var(--ink-soft); }
.center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: .92rem; padding: 11px 22px;
  border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: all .2s ease;
  background: var(--brand); color: #fff;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--gold { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-deep); filter: none; }
.btn--sm { padding: 7px 14px; font-size: .85rem; }
.btn--block { width: 100%; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px 24px; }

/* Fields */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-family: inherit; font-size: .95rem; color: var(--ink); transition: border-color .2s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }

/* Table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: .76rem; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-soft); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable { cursor: pointer; transition: background .15s; }
.tbl tr.clickable:hover { background: #faf9f6; }

/* Badges / stages */
.badge { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge--new   { background: #eef4fb; color: var(--info); }
.badge--warm  { background: #fdf3e3; color: var(--warn); }
.badge--won   { background: #e8f6ee; color: var(--ok); }
.badge--lost  { background: #fbeae6; color: var(--danger); }
.badge--muted { background: #eef0f4; color: var(--ink-soft); }

.fade-in { animation: fadeIn .4s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
