@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;1,9..144,300&family=Geist+Mono:wght@400;500&family=Geist:wght@300;400;500;600&display=swap');

/* ── TOKENS ──────────────────────────────────────────────────────── */
:root {
  --bg:           #f5f5f3;
  --bg-subtle:    #ebeae4;
  --card:         #ffffff;
  --ink:          #1a1a18;
  --muted:        #5f5e5a;
  --muted-soft:   #888780;
  --muted-softer: #b4b2a9;
  --line:         rgba(0,0,0,0.08);
  --line-strong:  rgba(0,0,0,0.16);
  --accent:       #8b3a1a;
  --accent-soft:  #f3e7df;

  --green-bg:     #eaf3de; --green-text:  #27500a; --green-border: #97c459;
  --amber-bg:     #faeeda; --amber-text:  #633806; --amber-border: #ef9f27;
  --red-bg:       #fcebeb; --red-text:    #a32d2d; --red-border:   #f09595;
  --blue-bg:      #e6f1fb; --blue-text:   #0c447c; --blue-border:  #85b7eb;

  --radius:   4px;
  --radius-lg:6px;
  --shadow:   0 1px 0 rgba(0,0,0,0.02);
  --shadow-md:0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg:0 8px 32px rgba(0,0,0,0.10);
}

/* ── RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Geist', sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.65; }
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ── NAV ─────────────────────────────────────────────────────────── */
.nav {
  display: flex; align-items: center; gap: 12px;
  padding: 0 56px; height: 72px; flex-shrink: 0;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: relative;
}
.nav::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--accent); }
.nav-left  { display:flex; align-items:center; gap:12px; }
.nav-right { display:flex; align-items:center; gap:8px; margin-left:auto; }
.nav-brand { font-size:15px; font-weight:600; color:var(--ink); letter-spacing:-.005em; }
.nav-sep   { color: var(--muted-softer); font-size:14px; }
.nav-role  { font-size:14px; font-weight:500; color:var(--ink); }
.nav-user  { font-size:13px; color:var(--muted); }
.nav-user .nav-user-name { color:var(--ink); font-weight:500; }

/* ── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; justify-content:center;
  height:36px; padding:0 16px; border-radius:var(--radius);
  font-size:14px; font-weight:500; border:none; transition:opacity .15s; cursor:pointer;
}
.btn:hover { opacity:.88; }
.btn-dark  { background:var(--ink); color:#fff; }
.btn-ghost { background:var(--card); color:var(--ink); border:1px solid var(--line-strong); }
.btn-amber { background:var(--amber-bg); color:var(--amber-text); border:1px solid var(--amber-border); }
.btn-lg    { height:44px; padding:0 24px; font-size:15px; }

/* ── CHIP ────────────────────────────────────────────────────────── */
.chip {
  display:inline-flex; align-items:center;
  padding:2px 8px; border-radius:var(--radius);
  font-family:'Geist Mono',monospace; font-size:11px; font-weight:500;
  text-transform:uppercase; border:1px solid transparent;
}
.chip-green  { background:var(--green-bg);  color:var(--green-text);  border-color:var(--green-border); }
.chip-amber  { background:var(--amber-bg);  color:var(--amber-text);  border-color:var(--amber-border); }
.chip-red    { background:var(--red-bg);    color:var(--red-text);    border-color:var(--red-border); }
.chip-blue   { background:var(--blue-bg);   color:var(--blue-text);   border-color:var(--blue-border); }

/* ── EYEBROW ─────────────────────────────────────────────────────── */
.eyebrow {
  font-family:'Geist Mono',monospace; font-size:11px; font-weight:500;
  text-transform:uppercase; letter-spacing:.14em; color:var(--accent);
}

/* ── BADGE ───────────────────────────────────────────────────────── */
.badge {
  display:inline-flex; align-items:center;
  padding:2px 8px; border-radius:var(--radius);
  font-size:10px; font-weight:500;
  font-family:'Geist Mono',monospace; text-transform:uppercase;
}
.badge-blue  { background:var(--blue-bg);  color:var(--blue-text); }
.badge-green { background:var(--green-bg); color:var(--green-text); }

/* ── CARD ────────────────────────────────────────────────────────── */
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow); }

/* ── SNACKBAR ────────────────────────────────────────────────────── */
#snackbar {
  position:fixed; bottom:32px; left:50%; transform:translateX(-50%) translateY(80px);
  background:#1e1e1c; color:#fff; border-radius:var(--radius-lg);
  padding:0 20px; height:48px; display:flex; align-items:center; gap:10px;
  font-size:13px; font-weight:500; box-shadow:0 8px 32px rgba(0,0,0,.2);
  transition:transform .3s cubic-bezier(.34,1.56,.64,1); z-index:9999;
}
#snackbar.show { transform:translateX(-50%) translateY(0); }
#snackbar .check { width:18px; height:18px; background:#4caf27; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; }
#snackbar .dismiss { margin-left:16px; color:var(--muted-soft); cursor:pointer; font-size:12px; }

/* ── FORM FIELDS ─────────────────────────────────────────────────── */
.field-label { font-size:12px; font-weight:500; color:var(--muted); margin-bottom:6px; display:block; }
.field-input {
  width:100%; height:40px; padding:0 14px;
  background:var(--bg); border:1px solid var(--line-strong);
  border-radius:var(--radius); font-size:13px; color:var(--ink);
  outline:none; transition:border-color .15s, box-shadow .15s;
}
.field-input:focus { border-color:var(--ink); box-shadow:0 0 0 2px rgba(26,26,24,.08); }

/* ── TABLE ───────────────────────────────────────────────────────── */
.detail-table { width:100%; border-collapse:collapse; font-size:13px; }
.detail-table th {
  text-align:left; padding:10px 16px;
  font-family:'Geist Mono',monospace; font-size:11px; font-weight:500;
  text-transform:uppercase; letter-spacing:.08em; color:var(--muted-soft);
  background:var(--bg); border-bottom:1px solid var(--line);
}
.detail-table td { padding:12px 16px; border-bottom:1px solid var(--line); vertical-align:middle; }
.detail-table tr:last-child td { border-bottom:none; }
.detail-table tr:nth-child(even) td { background:rgba(0,0,0,.012); }
.detail-table tr.selected td { background:var(--accent-soft); }
.detail-table tr.selected td:first-child { border-left:3px solid var(--accent); padding-left:13px; }
.detail-table tr { cursor:pointer; transition:background .1s; }
.detail-table tr:hover td { background:var(--accent-soft); }

/* ── CHECKBOX ────────────────────────────────────────────────────── */
.cb {
  width:18px; height:18px; border-radius:3px;
  border:1.5px solid rgba(0,0,0,.2); background:var(--card);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:all .12s; flex-shrink:0; font-size:11px;
}
.cb.checked { background:var(--ink); border-color:var(--ink); color:#fff; }

/* ── BROWSER CHROME ──────────────────────────────────────────────── */
.browser-chrome {
  background:var(--bg); border-bottom:1px solid var(--line);
  padding:8px 12px; display:flex; align-items:center; gap:8px;
}
.browser-dots { display:flex; gap:6px; }
.browser-dot  { width:10px; height:10px; border-radius:50%; }
.browser-url  {
  flex:1; background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:4px 10px;
  font-size:11px; color:var(--muted-soft); font-family:'Geist Mono',monospace;
}

/* ── FILTER DROPDOWN ─────────────────────────────────────────────── */
.filter-wrap { position:relative; }
.filter-pill {
  display:flex; align-items:center; gap:4px;
  height:26px; padding:0 10px; border-radius:var(--radius);
  font-size:11px; font-weight:500; font-family:'Geist Mono',monospace;
  background:var(--card); border:1px solid var(--line-strong);
  color:var(--ink); cursor:pointer;
}
.filter-dropdown {
  position:absolute; top:100%; right:0; margin-top:4px;
  background:var(--card); border:1px solid var(--line-strong);
  border-radius:var(--radius); box-shadow:var(--shadow-md);
  min-width:160px; overflow:hidden; z-index:100; display:none;
}
.filter-dropdown.open { display:block; }
.filter-option {
  padding:10px 14px; font-size:13px; cursor:pointer;
  transition:background .1s; border-bottom:1px solid var(--line);
}
.filter-option:last-child { border-bottom:none; }
.filter-option:hover { background:var(--bg); }
.filter-option.active { background:var(--accent-soft); color:var(--accent); font-weight:500; }

/* ── MAP ─────────────────────────────────────────────────────────── */
.map-area {
  flex:1; background:#dde8d9; position:relative; overflow:hidden;
  display:flex; align-items:center; justify-content:center; min-height:360px;
}
.map-grid {
  position:absolute; inset:0;
  background-image:
    linear-gradient(rgba(180,196,176,.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180,196,176,.4) 1px, transparent 1px);
  background-size:80px 80px;
}
.map-road-h { position:absolute; height:10px; background:#f0ede8; left:0; right:0; }
.map-road-v { position:absolute; width:10px;  background:#f0ede8; top:0; bottom:0; }
.map-pin    { position:absolute; display:flex; flex-direction:column; align-items:center; }
.map-pin-dot { width:20px; height:20px; background:var(--accent); border-radius:50%; border:3px solid #fff; box-shadow:0 0 0 6px rgba(139,58,26,.2); }
.map-label  { background:var(--card); padding:4px 10px; border-radius:var(--radius); font-size:12px; font-weight:500; box-shadow:var(--shadow-md); white-space:nowrap; margin-top:8px; }
.map-watermark { position:absolute; bottom:8px; right:12px; font-size:11px; color:var(--muted-soft); }
.address-box {
  background:var(--bg); border:1px solid var(--line);
  border-radius:var(--radius); padding:14px 20px;
  display:flex; align-items:center; gap:10px;
  font-size:13px; color:var(--ink); margin:20px 24px 12px;
}
.address-dot { width:10px; height:10px; background:var(--accent); border-radius:50%; flex-shrink:0; }

/* ── CALENDAR ────────────────────────────────────────────────────── */
.cal-header { background:#4285f4; color:#fff; padding:12px 20px; font-size:16px; font-weight:600; }
.cal-days   { display:grid; grid-template-columns:repeat(7,1fr); background:var(--bg); border-bottom:1px solid var(--line); }
.cal-day-label { text-align:center; padding:8px 0; font-size:11px; color:var(--muted-soft); font-weight:500; }
.cal-grid   { display:grid; grid-template-columns:repeat(7,1fr); }
.cal-cell   { min-height:64px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); padding:6px; }
.cal-date   { font-size:12px; width:24px; height:24px; display:flex; align-items:center; justify-content:center; border-radius:50%; }
.cal-date.today { background:#4285f4; color:#fff; font-weight:600; }
.cal-event  { margin-top:4px; padding:2px 4px; border-radius:2px; font-size:9px; font-weight:500; }
.cal-event.blue  { background:#4285f4; color:#fff; }
.cal-event.amber { background:var(--amber-bg); color:var(--amber-text); }

/* ── SHARED SNACKBAR JS UTIL ─────────────────────────────────────── */
