@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Navy sidebar */
  --nav-bg: #18284a;
  --nav-bg2: #1f3260;
  --nav-border: rgba(255,255,255,.07);
  --nav-text: rgba(255,255,255,.6);
  --nav-text-active: #ffffff;
  --nav-active-bg: rgba(255,255,255,.1);
  --nav-accent: #5b9cf6;

  /* Content */
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface2: #f1f4f9;
  --border: #e4e9f2;
  --border2: #ccd4e3;

  /* Text */
  --text: #111827;
  --text2: #4b5a72;
  --text3: #9aa3b4;

  /* Accent */
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --blue-soft: rgba(37,99,235,.08);
  --green: #16a34a;
  --green-soft: rgba(22,163,74,.09);
  --orange: #c2700a;
  --orange-soft: rgba(194,112,10,.09);
  --red: #dc2626;
  --red-soft: rgba(220,38,38,.08);
  --purple: #7c3aed;
  --purple-soft: rgba(124,58,237,.09);

  /* Pipeline colors */
  --c-prospect: #2563eb;
  --c-oferta: #7c3aed;
  --c-negociere: #c2700a;
  --c-castigat: #16a34a;

  --sidebar-w: 232px;
  --topbar-h: 52px;
  --r: 10px;
  --r-sm: 7px;
  --r-xs: 5px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.13), 0 4px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── SCROLLBAR ─────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }

/* ─── LOGIN ─────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(91,156,246,.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 90% 80%, rgba(37,99,235,.08) 0%, transparent 60%);
}

.login-wrap { width: 100%; max-width: 380px; padding: 20px; }

.login-brand {
  display: flex; align-items: center; gap: 11px; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -.3px;
  margin-bottom: 28px;
}
.login-brand svg { opacity: .9; }

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 34px 30px 30px;
  box-shadow: 0 24px 56px rgba(0,0,0,.28), 0 4px 12px rgba(0,0,0,.12);
}

.login-card h2 {
  font-size: 20px; font-weight: 700; color: var(--text);
  letter-spacing: -.3px; margin-bottom: 4px;
}
.login-sub { font-size: 13px; color: var(--text2); margin-bottom: 24px; }

/* ─── APP LAYOUT ────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ─── SIDEBAR ───────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--nav-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 18px 16px 16px;
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.2px;
  border-bottom: 1px solid var(--nav-border);
  user-select: none;
}

.nav-group { padding: 12px 8px 4px; flex: 1; }

.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.28); padding: 0 10px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-xs);
  color: var(--nav-text); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background .12s, color .12s;
  position: relative; margin-bottom: 1px;
}
.nav-item svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0; opacity: .8;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }
.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-text-active);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 7px; bottom: 7px;
  width: 3px; background: var(--nav-accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-bottom {
  padding: 12px 8px;
  border-top: 1px solid var(--nav-border);
}

.sidebar-user {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-xs);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,.4); text-transform: capitalize; margin-top: 1px; }
.user-info { flex: 1; min-width: 0; }

.logout-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.35); padding: 5px;
  border-radius: var(--r-xs); transition: all .12s;
  display: flex; align-items: center;
}
.logout-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.logout-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── TOPBAR (mobile) ───────────────────────────── */
#topbar {
  display: none; align-items: center; justify-content: space-between;
  padding: 0 16px; height: var(--topbar-h);
  background: var(--nav-bg);
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
#topbar-title { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -.2px; }
.menu-btn { background: none; border: none; cursor: pointer; color: rgba(255,255,255,.7); padding: 4px; display: flex; }
.menu-btn svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ─── MAIN CONTENT ──────────────────────────────── */
#main-content { flex: 1; overflow-y: auto; padding: 28px 30px; }

/* ─── PAGES ─────────────────────────────────────── */
.page { display: none; max-width: 1200px; }
.page.active { display: block; animation: fadeIn .18s ease; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 12px;
}
.page-header h2 {
  font-size: 22px; font-weight: 700; color: var(--text);
  letter-spacing: -.4px; line-height: 1.2;
}
.page-sub { font-size: 13px; color: var(--text2); margin-top: 3px; font-weight: 400; }

/* ─── CARDS ─────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text3);
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.card-body { padding: 16px 18px; }
.mt16 { margin-top: 14px; }
.mb16 { margin-bottom: 14px; }

/* ─── STAT CARDS ────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--blue); opacity: .5;
}
.stat-card.s-green::before { background: var(--green); }
.stat-card.s-orange::before { background: var(--orange); }
.stat-card.s-red::before { background: var(--red); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1; margin-bottom: 5px; color: var(--text); }
.stat-sub { font-size: 12px; color: var(--text2); }

/* ─── DASHBOARD GRID ────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

.pipeline-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.pipeline-label { font-size: 12.5px; color: var(--text2); min-width: 120px; font-weight: 500; }
.pipeline-track { flex: 1; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.pipeline-fill { height: 100%; border-radius: 3px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.pipeline-count { font-size: 12px; font-weight: 600; color: var(--text); min-width: 20px; text-align: right; }

/* Agent rows */
.agent-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.agent-row:last-child { border-bottom: none; }
.agent-color { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.agent-name { font-size: 13px; font-weight: 500; min-width: 110px; color: var(--text); }
.agent-track { flex: 1; height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.agent-fill { height: 100%; border-radius: 3px; }
.agent-stat { font-size: 12px; color: var(--text2); min-width: 120px; text-align: right; }

/* Recent items */
.recent-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
  margin: 0 -18px; padding-left: 18px; padding-right: 18px;
}
.recent-row:last-child { border-bottom: none; }
.recent-row:hover { background: var(--surface2); }
.recent-name { font-size: 13.5px; font-weight: 500; flex: 1; color: var(--text); }
.recent-date { font-size: 12px; color: var(--text3); white-space: nowrap; }

/* ─── FILTERS ───────────────────────────────────── */
.filters-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.search-wrap { flex: 1; min-width: 200px; position: relative; }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; stroke: var(--text3); fill: none;
  stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.search-wrap input { padding-left: 32px; }

/* ─── FORMS ─────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 13px; }
.form-group:last-child { margin-bottom: 0; }
label {
  font-size: 11.5px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: .05em;
}
.label-note { font-size: 10.5px; font-weight: 400; text-transform: none; color: var(--text3); letter-spacing: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input, select, textarea {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 8px 11px;
  font-size: 13.5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  width: 100%;
  transition: border-color .14s, box-shadow .14s, background .14s;
  outline: none;
  line-height: 1.4;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
input::placeholder, textarea::placeholder { color: var(--text3); }
textarea { resize: vertical; min-height: 72px; }
select option { background: #fff; }

/* ─── BUTTONS ───────────────────────────────────── */
.btn-primary {
  background: var(--blue); color: #fff; border: none;
  border-radius: var(--r-sm); padding: 8px 16px;
  font-size: 13.5px; font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600; cursor: pointer;
  transition: background .13s, transform .1s, box-shadow .13s;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.btn-primary:hover { background: var(--blue2); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-primary:active { transform: scale(.98); box-shadow: none; }
.btn-primary.full { width: 100%; justify-content: center; padding: 10px; font-size: 14px; }

.btn-secondary {
  background: var(--surface); color: var(--text2);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 16px; font-size: 13.5px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 500;
  cursor: pointer; transition: all .13s;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-secondary:hover { border-color: var(--border2); color: var(--text); background: var(--surface2); }

.btn-sm { padding: 5px 11px !important; font-size: 12px !important; border-radius: var(--r-xs) !important; }
.btn-ghost { background: none; border: none; cursor: pointer; color: var(--text3); padding: 4px 7px; border-radius: var(--r-xs); font-size: 12px; transition: all .12s; font-family: inherit; }
.btn-ghost:hover { color: var(--red); background: var(--red-soft); }
.btn-export { background: var(--surface2); border: 1.5px solid var(--border); color: var(--text2); border-radius: var(--r-sm); padding: 7px 13px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all .13s; font-family: 'Plus Jakarta Sans', sans-serif; align-self: flex-start; }
.btn-export:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

/* ─── STATUS BADGES ─────────────────────────────── */
.badge-status {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap;
}
.s-prospect { background: var(--blue-soft); color: #1a4fbf; }
.s-oferta_trimisa { background: var(--purple-soft); color: #5b21b6; }
.s-negociere { background: var(--orange-soft); color: #92400e; }
.s-castigat { background: var(--green-soft); color: #145a32; }

/* ─── CONTACTS LIST ─────────────────────────────── */
.contacts-list { display: flex; flex-direction: column; gap: 7px; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 16px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  transition: border-color .13s, box-shadow .13s, transform .13s;
  box-shadow: var(--shadow-xs);
}
.contact-card:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.06), var(--shadow-sm);
  transform: translateY(-1px);
}
.contact-card-main { flex: 1; min-width: 0; }
.contact-company { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-meta { font-size: 12.5px; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.contact-value { font-size: 12.5px; font-weight: 600; color: var(--text2); }
.owner-pip { display: inline-block; width: 7px; height: 7px; border-radius: 50%; vertical-align: middle; margin-right: 3px; }

/* ─── PAGINATION ────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 14px; flex-wrap: wrap; }
.page-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text2); border-radius: var(--r-xs); padding: 5px 11px; font-size: 12.5px; cursor: pointer; transition: all .12s; font-family: 'Plus Jakarta Sans', sans-serif; }
.page-btn:hover, .page-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ─── MODALS ────────────────────────────────────── */
#modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(17,24,39,.45); backdrop-filter: blur(5px);
  z-index: 1000; align-items: center; justify-content: center; padding: 16px;
}
#modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: none;
  animation: slideUp .18s cubic-bezier(.4,0,.2,1);
}
.modal.open { display: block; }
.modal-wide { max-width: 780px; }

.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px; position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.modal-header-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.modal-close {
  width: 26px; height: 26px; background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 15px; display: flex; align-items: center;
  justify-content: center; border-radius: 5px; transition: all .12s;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ─── DETAIL MODAL ──────────────────────────────── */
.detail-body { display: grid; grid-template-columns: 180px 1fr; gap: 20px; }
.detail-meta { display: flex; flex-direction: column; gap: 14px; }
.detail-field .df-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); margin-bottom: 3px; }
.detail-field .df-val { font-size: 13.5px; color: var(--text); }

.detail-tabs { flex: 1; min-width: 0; }
.tab-bar { display: flex; border-bottom: 1.5px solid var(--border); margin-bottom: 14px; }
.tab-btn {
  padding: 7px 14px; background: none; border: none;
  font-size: 13px; font-weight: 500; color: var(--text2);
  cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif;
  border-bottom: 2px solid transparent; margin-bottom: -1.5px;
  transition: color .12s, border-color .12s;
}
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.add-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px; margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 7px;
}

.activity-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.act-icon {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0; margin-top: 1px;
}
.act-body { flex: 1; }
.act-top { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; flex-wrap: wrap; }
.act-type { font-size: 10.5px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; }
.act-user { font-size: 11px; color: var(--blue); font-weight: 500; }
.act-time { font-size: 11px; color: var(--text3); margin-left: auto; }
.act-desc { font-size: 13px; color: var(--text); line-height: 1.45; }

/* Audit */
.audit-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.audit-item:last-child { border-bottom: none; }
.audit-action { font-weight: 600; color: var(--text); min-width: 80px; }
.audit-detail { color: var(--text2); flex: 1; }
.audit-meta { color: var(--text3); text-align: right; font-size: 11.5px; white-space: nowrap; }

/* ─── TASKS ─────────────────────────────────────── */
.task-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 14px;
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 7px; box-shadow: var(--shadow-xs);
  transition: border-color .12s;
}
.task-item.done { opacity: .45; }
.task-item.overdue { border-color: rgba(220,38,38,.3); background: rgba(220,38,38,.02); }
.task-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border2); cursor: pointer; flex-shrink: 0;
  transition: all .15s; background: none;
  display: flex; align-items: center; justify-content: center;
}
.task-check:hover { border-color: var(--green); }
.task-check.checked { background: var(--green); border-color: var(--green); }
.task-check.checked::after { content: '✓'; font-size: 10px; color: #fff; font-weight: 700; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.task-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.task-due { font-size: 12px; color: var(--text2); white-space: nowrap; font-weight: 500; flex-shrink: 0; }
.task-due.overdue { color: var(--red); font-weight: 600; }

/* ─── USERS ─────────────────────────────────────── */
.user-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 18px;
  display: flex; align-items: center; gap: 13px;
  margin-bottom: 8px; box-shadow: var(--shadow-xs);
}
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.user-card-sub { font-size: 12.5px; color: var(--text2); margin-top: 2px; }
.role-pill { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.role-manager { background: rgba(24,40,74,.08); color: var(--nav-bg); }
.role-agent { background: var(--blue-soft); color: var(--blue2); }
.inactive-tag { background: var(--surface2); color: var(--text3); padding: 2px 7px; border-radius: 100px; font-size: 11px; font-weight: 500; margin-left: 5px; }

/* ─── REPORTS ───────────────────────────────────── */
.reports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.report-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-xs); transition: border-color .13s, box-shadow .13s;
}
.report-card:hover { border-color: var(--border2); box-shadow: var(--shadow); }
.report-card-featured {
  border-color: rgba(37,99,235,.2); background: linear-gradient(135deg, rgba(37,99,235,.03), rgba(37,99,235,.01));
  grid-column: 1/-1; flex-direction: row; align-items: center;
}
.report-card-featured .report-info { flex: 1; }
.report-icon { font-size: 22px; }
.report-info h3 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.report-info p { font-size: 12.5px; color: var(--text2); line-height: 1.5; }

/* ─── SETTINGS ──────────────────────────────────── */
.settings-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow-xs);
}
.settings-block-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 18px;
  background: var(--surface2); border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: .07em;
}
.settings-block-header svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.settings-block-body { padding: 18px; }
.settings-note { font-size: 12.5px; color: #7a5c00; background: #fefce8; border: 1px solid #fde68a; border-radius: var(--r-xs); padding: 9px 12px; margin-bottom: 16px; line-height: 1.5; }
.settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.test-row { display: flex; gap: 7px; flex: 1; min-width: 240px; }
.test-row input { flex: 1; }

/* ─── BADGES ────────────────────────────────────── */
.notif-badge {
  background: var(--red); color: #fff; border-radius: 100px;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  min-width: 17px; text-align: center; margin-left: auto;
}

/* ─── GLOBAL SEARCH ─────────────────────────────── */
#global-search-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(17,24,39,.4); backdrop-filter: blur(5px);
  z-index: 2000; align-items: flex-start; justify-content: center; padding-top: 72px;
}
#global-search-overlay.open { display: flex; }
.gs-box {
  background: var(--surface); border-radius: 14px;
  width: 100%; max-width: 540px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); overflow: hidden;
  animation: slideUp .15s ease;
}
.gs-top { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.gs-top .search-icon { position: static; transform: none; flex-shrink: 0; }
.gs-top input { flex: 1; background: none; border: none; font-size: 15px; padding: 0; box-shadow: none !important; }
.gs-top input:focus { background: none; border: none; box-shadow: none !important; }
.gs-top kbd { background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; font-size: 11px; color: var(--text3); cursor: pointer; flex-shrink: 0; }
.gs-results { max-height: 360px; overflow-y: auto; }
.gs-item { display: flex; align-items: center; gap: 11px; padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .1s; }
.gs-item:last-child { border-bottom: none; }
.gs-item:hover { background: var(--surface2); }
.gs-item-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.gs-item-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ─── MISC ──────────────────────────────────────── */
.error-msg { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 18px; }

#toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--nav-bg); color: #fff;
  padding: 11px 18px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(70px); opacity: 0;
  transition: all .22s cubic-bezier(.4,0,.2,1);
  z-index: 9999; max-width: 300px; pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.ok { background: var(--green); }
#toast.err { background: var(--red); }

.empty { text-align: center; padding: 40px 20px; color: var(--text3); font-size: 13.5px; }

kbd { background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-family: monospace; color: var(--text2); }

#search-hint {
  position: fixed; bottom: 18px; left: calc(var(--sidebar-w) + 18px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 12px; font-size: 11.5px; color: var(--text3);
  box-shadow: var(--shadow-xs); pointer-events: none; z-index: 10;
}

/* ─── ANIMATIONS ────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ─── MOBILE ────────────────────────────────────── */
@media (max-width: 768px) {
  #topbar { display: flex; }
  #main-content { padding: calc(var(--topbar-h) + 16px) 14px 20px; }
  #search-hint { display: none; }
  #sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: 6px 0 20px rgba(0,0,0,.25); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .detail-body { grid-template-columns: 1fr; }
  .modal { max-width: 100%; border-radius: 14px; }
  .contact-card { flex-wrap: wrap; }
  .contact-card-right { flex-direction: row; align-items: center; gap: 8px; }
  .reports-grid { grid-template-columns: 1fr; }
  .report-card-featured { flex-direction: column; }
  .settings-actions { flex-direction: column; align-items: flex-start; }
  .test-row { width: 100%; }
}
@media (min-width: 769px) { #sidebar { transform: none !important; } }
