/* =====================================================================
   מחלקת חרדים · עיריית אשקלון — Design System
   ===================================================================== */
:root {
  --primary: #3BA7F0;
  --primary-d: #1E88E5;
  --secondary: #6FCF97;
  --accent: #1E88E5;
  --bg: #F5F9FC;
  --card: #FFFFFF;
  --ink: #16324A;
  --ink-2: #51677A;
  --ink-3: #8499AB;
  --line: #E7EEF4;
  --line-2: #EDF3F8;
  --success: #27AE60;
  --warning: #F2C94C;
  --error: #EB5757;
  --orange: #F08A24;

  --shadow-sm: 0 1px 2px rgba(22,50,74,.05), 0 2px 8px rgba(22,50,74,.04);
  --shadow: 0 6px 22px rgba(22,50,74,.08), 0 2px 6px rgba(22,50,74,.04);
  --shadow-lg: 0 18px 50px rgba(22,50,74,.12), 0 6px 16px rgba(22,50,74,.06);
  --shadow-primary: 0 14px 30px rgba(59,167,240,.30);

  --r-sm: 10px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
  --sidebar-w: 264px;
  --topbar-h: 72px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

[data-theme="dark"] {
  --bg: #0E1722;
  --card: #16222F;
  --ink: #EAF1F7;
  --ink-2: #A9BCCC;
  --ink-3: #6F8499;
  --line: #243443;
  --line-2: #1E2C3A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 8px 26px rgba(0,0,0,.4);
  --shadow-lg: 0 22px 56px rgba(0,0,0,.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Heebo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .3s var(--ease);
  overflow: hidden;
}
::selection { background: rgba(59,167,240,.25); }
.ic { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex: 0 0 auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* scrollbars */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 20px; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* =====================================================================
   APP LAYOUT
   ===================================================================== */
.app { display: flex; height: 100vh; width: 100%; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* =====================================================================
   SIDEBAR (right)
   ===================================================================== */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--card);
  border-inline-start: 1px solid var(--line);
  display: flex; flex-direction: column;
  z-index: 60;
  transition: transform .35s var(--ease);
}
.sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px; border-bottom: 1px solid var(--line);
}
.brand__logo {
  width: 46px; height: 46px; border-radius: 13px; background: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line); overflow: hidden; flex: 0 0 auto;
}
.brand__logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__title { font-weight: 800; font-size: 16px; }
.brand__sub { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.sidebar__close { margin-inline-start: auto; display: none; width: 34px; height: 34px; border-radius: 10px; color: var(--ink-2); }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.nav__group { font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 14px 12px 6px; letter-spacing: .3px; }
.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 13px;
  color: var(--ink-2); font-weight: 600; font-size: 14.5px;
  position: relative; transition: all .2s var(--ease); width: 100%; text-align: start;
}
.nav__item .ic { color: var(--ink-3); transition: color .2s; }
.nav__item:hover { background: var(--line-2); color: var(--ink); }
.nav__item:hover .ic { color: var(--primary); }
.nav__item.active { background: linear-gradient(120deg, var(--primary), var(--accent)); color: #fff; box-shadow: var(--shadow-primary); }
.nav__item.active .ic { color: #fff; }
.nav__item .badge-mini {
  margin-inline-start: auto; background: var(--error); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 20px; height: 20px;
  border-radius: 20px; display: grid; place-items: center; padding: 0 5px;
}
.nav__item.active .badge-mini { background: rgba(255,255,255,.25); }

.sidebar__foot { padding: 14px 16px 18px; border-top: 1px solid var(--line); }
.demo-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(242,201,76,.16); color: #B8860B;
  padding: 7px 13px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
}
[data-theme="dark"] .demo-pill { color: var(--warning); }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.sidebar__ver { font-size: 11px; color: var(--ink-3); margin-top: 10px; }

.sidebar__scrim { display: none; position: fixed; inset: 0; background: rgba(10,22,34,.45); z-index: 55; backdrop-filter: blur(2px); }

/* =====================================================================
   TOPBAR
   ===================================================================== */
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line); position: relative; z-index: 40;
}
.topbar__burger { display: none; }
.topbar__spacer { flex: 1; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; color: var(--ink-2);
  display: grid; place-items: center; transition: all .2s var(--ease);
  border: 1px solid transparent;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); border-color: var(--line); }

.search { position: relative; flex: 0 1 440px; max-width: 440px; }
.search input {
  width: 100%; height: 44px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg); padding: 0 44px 0 16px; font-size: 14px; color: var(--ink);
  transition: all .2s var(--ease);
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 4px rgba(59,167,240,.13); }
.search__icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search__results {
  position: absolute; top: 52px; inset-inline: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 50; display: none;
}
.search__results.open { display: block; animation: pop .18s var(--ease); }
.search__row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; cursor: pointer; transition: background .15s; }
.search__row:hover { background: var(--line-2); }
.search__row .av { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg,var(--primary),var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.search__row .meta { display: flex; flex-direction: column; line-height: 1.3; }
.search__row .meta small { color: var(--ink-3); font-size: 12px; }
.search__empty { padding: 18px; text-align: center; color: var(--ink-3); font-size: 13px; }

.topbar__date { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.topbar__date b { color: var(--ink); }

.notif { position: relative; }
.notif__badge {
  position: absolute; top: 6px; inset-inline-end: 6px; background: var(--error); color: #fff;
  font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 10px;
  display: grid; place-items: center; border: 2px solid var(--card);
}
.avatar {
  display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px;
  border-radius: 40px; cursor: pointer; transition: background .2s; border: 1px solid var(--line);
}
.avatar:hover { background: var(--line-2); }
.avatar > span {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 700; font-size: 13px; flex: 0 0 auto;
}
.avatar__meta { display: flex; flex-direction: column; line-height: 1.25; }
.avatar__name { font-size: 13.5px; font-weight: 700; }
.avatar__role { font-size: 11.5px; color: var(--ink-3); }

/* =====================================================================
   VIEW / GENERIC
   ===================================================================== */
.view { flex: 1; overflow-y: auto; padding: 28px 28px 96px; scroll-behavior: smooth; }
.view:focus { outline: none; }
.page-enter { animation: enter .45s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.page-sub { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 13px; font-weight: 700; font-size: 14px; transition: all .2s var(--ease);
  border: 1px solid var(--line); background: var(--card); color: var(--ink); white-space: nowrap;
}
.btn:hover { background: var(--line-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .ic { width: 18px; height: 18px; }
.btn--primary { background: linear-gradient(120deg, var(--primary), var(--accent)); color: #fff; border-color: transparent; box-shadow: var(--shadow-primary); }
.btn--primary:hover { background: linear-gradient(120deg, var(--accent), var(--primary)); filter: brightness(1.03); }
.btn--ghost { background: transparent; }
.btn--success { background: var(--success); color: #fff; border-color: transparent; }
.btn--danger { background: var(--error); color: #fff; border-color: transparent; }
.btn--wa { background: #25D366; color: #fff; border-color: transparent; }
.btn--sm { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn--icon { width: 38px; padding: 0; justify-content: center; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); transition: box-shadow .25s, transform .25s, border-color .25s;
}
.card--pad { padding: 22px; }
.card-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.card-title .ic { color: var(--primary); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.muted { color: var(--ink-3); font-size: 13px; }
.link { color: var(--primary); font-weight: 700; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 19px 30px;
  background: linear-gradient(120deg, #2E8FE0 0%, #3BA7F0 50%, #5BC0DE 100%);
  color: #fff; box-shadow: var(--shadow-lg); margin-bottom: 18px;
}
.hero::after { content: ''; position: absolute; inset-inline-start: -40px; bottom: -90px; width: 320px; height: 320px; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); }
.hero::before { content: ''; position: absolute; inset-inline-end: -60px; top: -80px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%); }
.hero__inner { position: relative; z-index: 1; }
.hero h1 { font-size: 23px; font-weight: 800; letter-spacing: -.5px; }
.hero p { font-size: 13.5px; opacity: .94; margin-top: 3px; max-width: 640px; }
.hero__chips { display: flex; gap: 9px; margin-top: 12px; flex-wrap: wrap; }
.hero__chip { padding: 6px 13px; }
.hero__chip { background: rgba(255,255,255,.18); backdrop-filter: blur(6px); padding: 8px 14px; border-radius: 30px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255,255,255,.22); }

.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi {
  position: relative; overflow: hidden; padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.kpi:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.kpi__icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; margin-bottom: 14px; }
.kpi__val { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.kpi__label { font-size: 13px; color: var(--ink-2); margin-top: 6px; font-weight: 600; }
.kpi__delta { font-size: 12px; font-weight: 700; margin-top: 8px; display: inline-flex; align-items: center; gap: 3px; }
.kpi__delta.up { color: var(--success); }
.kpi__delta.down { color: var(--error); }
.kpi__delta.flat { color: var(--ink-3); }
.kpi__spark { position: absolute; inset-inline-start: 0; bottom: 0; width: 100%; height: 30px; opacity: .5; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1.6fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.dash-charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin: 22px 0; }
.dash-charts-2 { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 18px; margin-bottom: 22px; }
.chart-box { position: relative; height: 260px; }
.chart-box--sm { height: 210px; }
.dash-bottom { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }

/* AI assistant hero card */
.ai-card {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 26px 28px; color: #fff;
  background: linear-gradient(125deg, #163E63 0%, #1E88E5 55%, #3BA7F0 100%);
  box-shadow: var(--shadow-lg); margin-bottom: 22px;
}
.ai-card::before { content: ''; position: absolute; inset-inline-end: -40px; top: -60px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(111,207,151,.32), transparent 65%); }
.ai-card::after { content: ''; position: absolute; inset-inline-start: 8%; bottom: -120px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%); }
.ai-card__head { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; margin-bottom: 18px; }
.ai-badge { width: 50px; height: 50px; border-radius: 15px; background: rgba(255,255,255,.16); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); }
.ai-badge .ic { width: 28px; height: 28px; color: #EAFBF1; }
.ai-card__head h3 { font-size: 20px; font-weight: 800; }
.ai-card__head p { font-size: 13px; opacity: .9; }
.ai-recs { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-rec {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 15px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(4px);
  transition: all .22s var(--ease); cursor: pointer;
}
.ai-rec:hover { background: rgba(255,255,255,.2); transform: translateX(-4px); }
.ai-rec__spark { font-size: 18px; flex: 0 0 auto; }
.ai-rec__txt { font-size: 14px; font-weight: 600; flex: 1; }
.ai-rec__go { font-size: 12px; font-weight: 700; opacity: .85; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ai-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.16); }
.ai-act {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 13px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.28); color: #fff;
  font-weight: 700; font-size: 13.5px; transition: all .2s var(--ease);
}
.ai-act .ic { width: 17px; height: 17px; }
.ai-act:hover { background: #fff; color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.ai-act--primary { background: #fff; color: var(--accent); }
.ai-act--primary:hover { filter: brightness(.98); }

/* urgent notifications strip */
.urgent-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.urgent {
  display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-radius: 15px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .22s var(--ease);
  position: relative; overflow: hidden;
}
.urgent::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; }
.urgent:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.urgent b { color: var(--ink); font-weight: 800; }
.urgent .ic { width: 19px; height: 19px; }
.urgent .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; animation: pulse 2s infinite; }
.urgent.red { color: var(--ink-2); } .urgent.red::before { background: var(--error); } .urgent.red .dot { background: var(--error); } .urgent.red .ic { color: var(--error); }
.urgent.yellow::before { background: var(--warning); } .urgent.yellow .dot { background: var(--warning); } .urgent.yellow .ic { color: #C99A06; }
.urgent.green::before { background: var(--success); } .urgent.green .dot { background: var(--success); } .urgent.green .ic { color: var(--success); }

/* section label */
.section-label { display: flex; align-items: baseline; gap: 12px; margin: 4px 2px 14px; }
.section-label h2 { font-size: 18px; font-weight: 800; display: inline-flex; align-items: center; gap: 9px; letter-spacing: -.3px; }
.section-label h2 .ic { color: var(--primary); }

/* analytics grid */
.analytics-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.card.hoverable { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.card.hoverable:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }

/* municipal emblem near title */
.brand__emblem {
  margin-inline-start: auto; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; color: var(--accent); flex: 0 0 auto;
  background: linear-gradient(135deg, rgba(59,167,240,.16), rgba(30,136,229,.14));
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
}
.brand__emblem .ic { width: 20px; height: 20px; }

/* floating action button — smart, scroll-aware (RTL bottom-right + safe-area) */
.fab {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  z-index: 90;
  display: inline-flex; align-items: center; gap: 9px; height: 54px; padding: 0 22px;
  border-radius: 30px; background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #fff; font-weight: 800; font-size: 14.5px; letter-spacing: -.2px;
  box-shadow: 0 10px 26px rgba(30,136,229,.38), 0 2px 6px rgba(22,50,74,.12);
  will-change: transform, opacity; -webkit-tap-highlight-color: transparent;
  /* show / return: subtle soft spring */
  transition: transform .3s cubic-bezier(.34, 1.32, .5, 1), opacity .3s ease, box-shadow .25s var(--ease);
  animation: fabIn .45s var(--ease);
}
.fab .ic { width: 21px; height: 21px; }
.fab > span { white-space: nowrap; }
.fab:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 18px 38px rgba(30,136,229,.46); }
.fab:active { transform: translateY(1px) scale(.985); transition-duration: .12s; }
/* hide: slide below the screen (no plain fade) */
.fab.fab--hidden { transform: translateY(150%); opacity: 0; pointer-events: none; transition: transform .28s ease-in-out, opacity .28s ease-in-out; }
@keyframes fabIn { from { opacity: 0; transform: translateY(150%); } to { opacity: 1; transform: none; } }

/* mobile full-width search overlay (Spotlight / Gmail style) */
.msearch {
  position: fixed; inset: 0; z-index: 130; display: flex; justify-content: center; align-items: flex-start;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(10,22,34,.5); backdrop-filter: saturate(160%) blur(7px);
  animation: msFade .2s var(--ease);
}
.msearch[hidden] { display: none; }
.msearch__sheet {
  width: min(93vw, 600px); margin-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; max-height: min(78vh, 560px);
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-lg); overflow: hidden; transform-origin: top center;
  animation: msSheet .3s var(--ease);
}
.msearch__bar { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.msearch__bar .ic { color: var(--ink-3); width: 20px; height: 20px; flex: 0 0 auto; }
.msearch__bar input { flex: 1; min-width: 0; border: none; background: transparent; font-size: 15.5px; color: var(--ink); outline: none; padding: 4px 0; }
.msearch__bar input::placeholder { color: var(--ink-3); }
.msearch__close { width: 36px; height: 36px; border-radius: 11px; color: var(--ink-2); display: grid; place-items: center; flex: 0 0 auto; transition: background .15s; }
.msearch__close:hover { background: var(--line-2); }
.msearch__results { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px; }
.msearch__results .search__row { border-radius: 12px; }
.msearch__results .search__empty { padding: 30px 18px; }
@keyframes msFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes msSheet { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }

/* =====================================================================
   TABLES
   ===================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.tbl thead th {
  text-align: start; font-size: 12px; font-weight: 700; color: var(--ink-3);
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: .2px;
}
.tbl tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--line-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.cell-name { display: flex; align-items: center; gap: 11px; }
.cell-av { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.cell-name .meta { display: flex; flex-direction: column; line-height: 1.3; }
.cell-name .meta small { color: var(--ink-3); font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; direction: ltr; text-align: start; unicode-bidi: plaintext; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 30px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-new { color: var(--accent); background: rgba(30,136,229,.12); }
.b-prog { color: #B8860B; background: rgba(242,201,76,.16); }
.b-missing { color: var(--error); background: rgba(235,87,87,.12); }
.b-ok { color: var(--success); background: rgba(39,174,96,.12); }
.b-rej { color: var(--ink-2); background: var(--line-2); }
.b-open { color: var(--accent); background: rgba(30,136,229,.12); }

.docpips { display: inline-flex; gap: 3px; align-items: center; }
.pip { width: 8px; height: 8px; border-radius: 3px; background: var(--success); }
.pip.off { background: var(--line); }
.docpips small { color: var(--ink-3); font-size: 12px; margin-inline-start: 5px; }

.row-actions { display: flex; gap: 6px; }
.row-actions .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
.row-actions .icon-btn:hover.del { color: var(--error); background: rgba(235,87,87,.1); border-color: rgba(235,87,87,.2); }
.row-actions .icon-btn .ic { width: 17px; height: 17px; }

/* toolbar (search + filters) */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .inp { position: relative; flex: 0 1 320px; }
.toolbar .inp input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 0 40px 0 14px; font-size: 14px; color: var(--ink); }
.toolbar .inp input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(59,167,240,.12); }
.toolbar .inp .ic { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border-radius: 30px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); transition: all .18s;
}
.chip:hover { border-color: var(--primary); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
[data-theme="dark"] .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* =====================================================================
   TASKS
   ===================================================================== */
.task-list { display: flex; flex-direction: column; gap: 9px; }
.task {
  display: flex; align-items: center; gap: 13px; padding: 13px 15px; border-radius: 15px;
  border: 1px solid var(--line); background: var(--card); transition: all .2s var(--ease);
}
.task:hover { box-shadow: var(--shadow-sm); transform: translateX(-3px); }
.task__check {
  width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); flex: 0 0 auto;
  display: grid; place-items: center; transition: all .2s; cursor: pointer; color: transparent;
}
.task__check:hover { border-color: var(--primary); }
.task.done .task__check { background: var(--success); border-color: var(--success); color: #fff; }
.task__body { flex: 1; min-width: 0; }
.task__title { font-weight: 600; font-size: 14.5px; transition: all .2s; }
.task.done .task__title { text-decoration: line-through; color: var(--ink-3); }
.task__meta { display: flex; gap: 10px; align-items: center; margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.task__tag { background: var(--line-2); padding: 2px 9px; border-radius: 20px; font-weight: 600; color: var(--ink-2); }
.prio { width: 4px; align-self: stretch; border-radius: 6px; flex: 0 0 auto; }
.prio.גבוהה { background: var(--error); }
.prio.בינונית { background: var(--warning); }
.prio.נמוכה { background: var(--secondary); }
.prio-dot { width: 9px; height: 9px; border-radius: 50%; }

/* =====================================================================
   SCHOLARSHIP / STAT CARDS
   ===================================================================== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  padding: 20px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 16px; transition: transform .25s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat__icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.stat__val { font-size: 26px; font-weight: 800; line-height: 1; }
.stat__label { font-size: 13px; color: var(--ink-2); margin-top: 4px; font-weight: 600; }

/* =====================================================================
   PERSON PROFILE
   ===================================================================== */
.profile-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.pf-card { padding: 26px 24px; text-align: center; }
.pf-av { width: 92px; height: 92px; border-radius: 28px; margin: 0 auto 14px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 32px; box-shadow: var(--shadow); }
.pf-name { font-size: 21px; font-weight: 800; }
.pf-sub { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.pf-quick { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.pf-list { text-align: start; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 6px; }
.pf-row { display: flex; align-items: center; gap: 11px; padding: 11px 2px; border-bottom: 1px solid var(--line-2); }
.pf-row:last-child { border-bottom: none; }
.pf-row .ic { color: var(--ink-3); width: 18px; height: 18px; }
.pf-row .k { font-size: 12.5px; color: var(--ink-3); }
.pf-row .v { font-weight: 600; font-size: 14px; margin-inline-start: auto; text-align: end; }
.section { padding: 22px 24px; margin-bottom: 18px; }
.section h4 { font-size: 15px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section h4 .ic { color: var(--primary); width: 18px; height: 18px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.info-cell .k { font-size: 12px; color: var(--ink-3); }
.info-cell .v { font-weight: 600; font-size: 14.5px; margin-top: 2px; }

.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ''; position: absolute; inset-inline-start: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ''; position: absolute; inset-inline-start: -21px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--primary); }
.tl-item:last-child { padding-bottom: 0; }
.tl-action { font-weight: 600; font-size: 14px; }
.tl-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.doc-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.doc-row:last-child { border-bottom: none; }
.doc-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.doc-ic.ok { background: rgba(39,174,96,.12); color: var(--success); }
.doc-ic.no { background: rgba(235,87,87,.1); color: var(--error); }
.doc-row .name { font-weight: 600; font-size: 14px; }

/* =====================================================================
   CALENDAR
   ===================================================================== */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-month { font-size: 19px; font-weight: 800; min-width: 150px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 6px 0; }
.cal-cell { min-height: 104px; border: 1px solid var(--line); border-radius: 13px; padding: 8px; background: var(--card); transition: all .2s; display: flex; flex-direction: column; gap: 4px; }
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell:not(.empty):hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59,167,240,.2); }
.cal-num { font-size: 13px; font-weight: 700; color: var(--ink-2); align-self: flex-end; }
.cal-cell.today .cal-num { background: var(--primary); color: #fff; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; }
.cal-ev { font-size: 11px; font-weight: 600; padding: 4px 7px; border-radius: 7px; cursor: pointer; line-height: 1.25; transition: transform .15s; }
.cal-ev:hover { transform: scale(1.02); }
.cal-ev.registration { background: rgba(59,167,240,.14); color: var(--accent); }
.cal-ev.deadline { background: rgba(235,87,87,.12); color: var(--error); }
.cal-ev.followup { background: rgba(242,201,76,.18); color: #B8860B; }
.cal-ev.committee { background: rgba(111,207,151,.18); color: var(--success); }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.cal-leg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.cal-leg span { width: 12px; height: 12px; border-radius: 4px; }

/* =====================================================================
   WHATSAPP / MESSAGES
   ===================================================================== */
.wa-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
.tpl-list { display: flex; flex-direction: column; gap: 11px; }
.tpl {
  padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; transition: all .2s var(--ease);
}
.tpl:hover, .tpl.active { border-color: #25D366; box-shadow: 0 6px 18px rgba(37,211,102,.15); }
.tpl.active { background: rgba(37,211,102,.05); }
.tpl__top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tpl__title { font-weight: 800; font-size: 15px; }
.tpl__tag { margin-inline-start: auto; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--line-2); color: var(--ink-2); }
.tpl__body { font-size: 13px; color: var(--ink-2); white-space: pre-line; line-height: 1.6; }
.wa-phone {
  background: #0b141a; border-radius: 30px; padding: 14px; box-shadow: var(--shadow-lg);
  border: 8px solid #1f2c34; position: sticky; top: 0;
}
.wa-screen { background: #0b141a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23ffffff08'/%3E%3C/svg%3E"); border-radius: 20px; overflow: hidden; min-height: 460px; display: flex; flex-direction: column; }
.wa-top { background: #1f2c34; padding: 13px 16px; display: flex; align-items: center; gap: 11px; color: #e9edef; }
.wa-top .wa-ava { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,var(--secondary),#25D366); display: grid; place-items: center; color: #fff; }
.wa-top .nm { font-weight: 700; font-size: 14px; }
.wa-top .st { font-size: 11px; color: #8696a0; }
.wa-body { flex: 1; padding: 18px 14px; display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; }
.wa-bubble {
  align-self: flex-end; background: #005c4b; color: #e9edef; padding: 9px 12px 7px; border-radius: 12px 12px 2px 12px;
  max-width: 80%; font-size: 13.5px; white-space: pre-line; line-height: 1.55; box-shadow: 0 1px 1px rgba(0,0,0,.2); position: relative;
}
.wa-bubble .tick { font-size: 10px; color: #53bdeb; text-align: end; margin-top: 3px; }
.wa-foot { padding: 10px 14px; background: #1f2c34; display: flex; gap: 8px; align-items: center; }
.wa-foot .fake-inp { flex: 1; background: #2a3942; border-radius: 22px; padding: 9px 14px; color: #8696a0; font-size: 13px; }
.wa-foot .snd { width: 40px; height: 40px; border-radius: 50%; background: #25D366; display: grid; place-items: center; color: #fff; }

/* =====================================================================
   REPORTS
   ===================================================================== */
.report-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.rtile {
  padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: all .25s var(--ease);
}
.rtile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary); }
.rtile__ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; margin-bottom: 14px; }
.rtile h4 { font-size: 16px; font-weight: 800; }
.rtile p { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* =====================================================================
   SETTINGS
   ===================================================================== */
.set-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line-2); }
.set-row:last-child { border-bottom: none; }
.set-row .txt { flex: 1; }
.set-row .txt b { font-size: 14.5px; }
.set-row .txt p { font-size: 12.5px; color: var(--ink-3); }
.switch { width: 48px; height: 28px; border-radius: 20px; background: var(--line); position: relative; transition: background .25s; flex: 0 0 auto; cursor: pointer; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-end: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: all .25s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--primary); }
.switch.on::after { inset-inline-end: 23px; }

/* =====================================================================
   EMPTY STATE / SKELETON
   ===================================================================== */
.empty { text-align: center; padding: 56px 20px; }
.empty__ic { width: 72px; height: 72px; border-radius: 22px; background: var(--line-2); display: grid; place-items: center; margin: 0 auto 16px; color: var(--ink-3); }
.empty__ic .ic { width: 34px; height: 34px; }
.empty h3 { font-size: 17px; font-weight: 800; }
.empty p { color: var(--ink-3); font-size: 14px; margin-top: 6px; }

.skel { background: linear-gradient(100deg, var(--line-2) 30%, var(--line) 50%, var(--line-2) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-line { height: 14px; margin: 8px 0; }

/* =====================================================================
   TOAST / MODAL
   ===================================================================== */
.toast-host { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  min-width: 280px; animation: toastIn .3s var(--ease);
}
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-30px); } }
.toast__ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.toast.ok .toast__ic { background: var(--success); }
.toast.err .toast__ic { background: var(--error); }
.toast.info .toast__ic { background: var(--primary); }
.toast__txt b { font-size: 14px; font-weight: 700; display: block; }
.toast__txt span { font-size: 12.5px; color: var(--ink-3); }

.modal-host { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(10,22,34,.5); backdrop-filter: blur(4px); animation: pop .2s var(--ease); }
.modal-host[hidden] { display: none; }
.modal { background: var(--card); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; animation: modalIn .3s var(--ease); }
.modal--lg { max-width: 920px; }
.modal--wide { max-width: 760px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal__head h3 { font-size: 18px; font-weight: 800; flex: 1; }
.modal__body { padding: 22px 24px; overflow-y: auto; }
.modal__foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-start; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  padding: 0 14px; font-size: 14px; color: var(--ink); transition: all .2s;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 88px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 4px rgba(59,167,240,.12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.confirm-ic { width: 64px; height: 64px; border-radius: 20px; background: rgba(235,87,87,.12); color: var(--error); display: grid; place-items: center; margin: 0 auto 14px; }
.confirm-ic .ic { width: 32px; height: 32px; }

/* popover (notifications) */
.popover { position: fixed; top: 70px; inset-inline-end: 24px; width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); z-index: 120; overflow: hidden; animation: pop .2s var(--ease); }
.popover__head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.popover__head b { font-size: 15px; font-weight: 800; }
.po-item { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); transition: background .15s; cursor: pointer; }
.po-item:hover { background: var(--line-2); }
.po-item:last-child { border-bottom: none; }
.po-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.po-ic.warn { background: rgba(242,201,76,.16); color: #B8860B; }
.po-ic.info { background: rgba(59,167,240,.12); color: var(--accent); }
.po-ic.ok { background: rgba(39,174,96,.12); color: var(--success); }
.po-item .t { font-size: 13.5px; font-weight: 600; }
.po-item .tm { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* progress bars */
.pbar { height: 8px; border-radius: 20px; background: var(--line-2); overflow: hidden; }
.pbar > span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width .8s var(--ease); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-charts-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1080px) {
  .dash-charts, .dash-bottom, .grid-2, .profile-grid, .wa-grid { grid-template-columns: 1fr; }
  .stat-cards, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .ai-recs { grid-template-columns: 1fr; }
  .report-tiles, .grid-3, .info-grid { grid-template-columns: 1fr 1fr; }
  .set-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .analytics-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(86vw, 300px); flex-basis: auto; transform: translateX(100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar.open + .sidebar__scrim { display: block; }
  .sidebar__close { display: grid; }
  .topbar__burger { display: grid; }
  .avatar__meta { display: none; }
  .topbar__date { display: none; }
  .view { padding: 18px 16px 100px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .urgent-strip { grid-template-columns: 1fr; }
  .search__results { display: none !important; } /* mobile uses the full-screen overlay instead */
  .fab {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    right: calc(18px + env(safe-area-inset-right, 0px));
    height: 50px; padding: 0 18px; font-size: 14px;
  }
  .kpi-grid, .stat-cards, .dash-charts-2 { grid-template-columns: 1fr 1fr; }
  .report-tiles, .grid-3, .info-grid { grid-template-columns: 1fr; }
  .hero { padding: 24px 22px; }
  .hero h1 { font-size: 23px; }
  .page-title { font-size: 22px; }
  .popover { inset-inline: 12px auto; width: calc(100vw - 24px); inset-inline-end: 12px; }
}
/* ---- responsive data tables → stacked cards ---- */
@media (max-width: 720px) {
  .table-wrap { overflow-x: visible; }
  table.tbl { min-width: 0; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--line); border-radius: 16px; padding: 4px 15px 8px; margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow-sm); }
  .tbl tbody tr:hover { background: var(--card); }
  .tbl tbody tr:last-child { margin-bottom: 0; }
  .tbl td { border: none; border-bottom: 1px solid var(--line-2); padding: 11px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: end; }
  .tbl td:last-child { border-bottom: none; }
  .tbl td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--ink-3); flex: 0 0 auto; text-align: start; }
  .tbl td.td-name { padding: 12px 0 10px; display: block; }
  .tbl td.td-name::before { display: none; }
  .tbl td.td-actions::before { display: none; }
  .tbl td.td-actions { justify-content: flex-start; padding-top: 12px; }
  .tbl td.td-wrap { display: block; }
  .tbl td.td-wrap::before { display: block; margin-bottom: 7px; }
  .tbl td .docpips, .tbl td .row-actions { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .kpi-grid, .stat-cards, .dash-charts-2, .grid-4 { grid-template-columns: 1fr 1fr; }
  .report-tiles, .grid-3 { grid-template-columns: 1fr; }
  .search { flex: 1; }
  .field-row { grid-template-columns: 1fr; }
  .page-title { font-size: 20px; }
  .kpi__val { font-size: 26px; }
  .toolbar .inp { flex: 1 1 100%; }
  .cal-cell { min-height: 64px; padding: 5px; }
  .cal-ev { font-size: 0; padding: 3px; height: 7px; border-radius: 4px; }
  .cal-num { font-size: 11px; }
}
@media (max-width: 380px) {
  .kpi-grid, .stat-cards, .dash-charts-2, .grid-4 { grid-template-columns: 1fr; }
}
