/* Heebo (SIL OFL 1.1) is self-hosted because the app's own CSP is
   `style-src 'self'` and would block a font CDN. It replaces Inter for one
   decisive reason: Inter ships no Hebrew glyphs, and this dashboard is Hebrew
   by default, so the primary UI was falling back to an undesigned system font
   while still carrying letter-spacing tuned for Inter. One variable family now
   covers both scripts, so the Hebrew and English UIs are the same design. */
@font-face {
  font-family: "Heebo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/heebo-hebrew.woff2") format("woff2");
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Heebo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/heebo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --canvas: #f3f3f0;
  --surface: #ffffff;
  --surface-subtle: #f8f8f6;
  --ink: #111214;
  --ink-soft: #383b42;
  --muted: #676c76;
  --line: #e3e3df;
  --line-strong: #d1d2ce;
  --nav: #111214;
  --nav-hover: #202226;
  --accent: #315bea;
  --accent-hover: #244ad0;
  --accent-soft: #edf1ff;
  --green: #087f5b;
  --green-soft: #e8f6f1;
  --amber: #ad6500;
  --amber-soft: #fff3df;
  --red: #c13747;
  --red-soft: #fff0f2;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 14px;
  /* Barely there. Elevation is carried by the hairline border instead. */
  --shadow: 0 1px 2px rgba(16, 18, 20, .04);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Heebo", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
::selection { background: #dce4ff; }

/* Shell */
.app-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 22px 22px;
  color: #a9adb6;
  background: var(--nav);
}
.brand { display: inline-flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-copy { min-width: 0; display: flex; flex-direction: column; }
.brand-copy strong { color: #fff; font-size: 14px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy small { margin-top: 2px; color: #686d77; font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.side-nav { margin-top: 54px; display: flex; flex-direction: column; gap: 8px; }
.side-link {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: #888d97;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.side-link:hover { color: #fff; background: var(--nav-hover); }
.side-link.active { color: #fff; background: #292b30; }
.side-link.active::after { content: ""; width: 6px; height: 6px; margin-inline-start: auto; border-radius: 50%; background: #fff; }
.side-link svg { width: 19px; height: 19px; }
.sidebar-spacer { flex: 1; }
.system-card { display: flex; align-items: flex-start; gap: 11px; padding: 15px; margin-bottom: 10px; border: 1px solid #2c2f34; border-radius: 12px; background: #181a1d; }
.system-card div { min-width: 0; display: flex; flex-direction: column; }
.system-card strong { color: #f2f3f4; font-size: 13px; }
.system-card small { margin-top: 3px; color: #747983; font-size: 12px; line-height: 1.4; }
.live-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 5px; border-radius: 50%; background: #38c793; box-shadow: 0 0 0 4px rgba(56,199,147,.12); }
.logout-form { margin: 0; }
.side-button { font-family: inherit; }
.app-frame { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 0 44px;
  background: rgba(243,243,240,.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(211,211,207,.75);
}
.mobile-brand { display: none; margin-inline-end: auto; }
.topbar-date { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 13px; }
.topbar-date strong { color: var(--ink); font-size: 13px; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: #eaeaE6; }
.lang { padding: 6px 11px; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.lang:hover { color: var(--ink); }
.lang.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(16,18,20,.08); }
.content { width: min(100%, 1560px); margin: 0 auto; padding: 52px 48px 84px; }

/* Type and actions */
.page-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.page-hero.compact { align-items: center; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(28px, 2.6vw, 36px); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; }
h2 { margin: 0; font-size: 16px; line-height: 1.3; letter-spacing: -.01em; font-weight: 700; }
h3 { margin: 0; font-size: 14px; font-weight: 600; }
.page-lede { max-width: 670px; margin: 11px 0 0; color: var(--muted); font-size: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 22px; color: var(--muted); font-size: 13px; font-weight: 600; }
.back-link:hover { color: var(--accent); }
.back-link svg { width: 15px; transform: rotate(180deg); }
[dir="rtl"] .back-link svg { transform: none; }
.title-row { display: flex; align-items: center; gap: 15px; }
.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { color: #fff; background: var(--accent); box-shadow: 0 8px 20px rgba(49,91,234,.18); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 10px 25px rgba(49,91,234,.24); }
.btn-secondary { color: var(--ink); border-color: var(--line-strong); background: #fff; }
.btn-secondary:hover { border-color: #b5b6b2; background: var(--surface-subtle); }
.btn-danger { color: var(--red); border-color: #efc7cd; background: var(--red-soft); }
.btn-block { width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Metrics
   One hairline-divided strip instead of six floating cards. The old block
   spent ~330px of vertical space and five competing icon colours before any
   real content appeared; chrome shrinks so the work surface starts higher and
   colour is freed up to mean something. */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.metric { min-width: 0; padding: 16px 20px 17px; border-inline-start: 1px solid var(--line); }
.metric:first-child { border-inline-start: 0; }
.metric-label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-value {
  display: block;
  margin: 8px 0 3px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
[dir="rtl"] .metric-value { letter-spacing: normal; }
.metric-value.is-money { font-size: 25px; }
/* Colour carries meaning here and nowhere else on this strip: amber only when
   something is actually open, red only when money is actually owed. */
.metric-value.is-attention { color: var(--amber); }
.metric-value.is-alert { color: var(--red); }
.metric-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Panels */
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 24px; align-items: start; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: none; }
.panel-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-head > div { min-width: 0; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.count-pill { min-width: 32px; height: 32px; display: grid; place-items: center; padding: 0 10px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-size: 13px; font-weight: 700; }
.client-tools { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 20px; border-bottom: 1px solid var(--line); background: #fbfbf9; }
.search-box { min-width: 250px; max-width: 370px; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.search-box:focus-within { border-color: #9aabea; box-shadow: 0 0 0 3px rgba(49,91,234,.09); }
.search-box svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--muted); }
.search-box input { min-width: 0; width: 100%; min-height: 0; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; font-size: 13px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #ededE9; }
.segment { min-height: 31px; padding: 0 11px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; }
.segment.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(16,18,20,.08); }
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; text-align: start; }
table.data th { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--muted); background: #f7f7f4; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-align: start; text-transform: uppercase; white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; vertical-align: middle; }
table.data tbody tr { transition: background .15s ease; }
table.data tbody tr:hover { background: #fafaf8; }
table.data tbody tr:last-child td { border-bottom: 0; }
.client-table { min-width: 900px; }
.client-identity { min-width: 175px; display: flex; align-items: center; gap: 11px; }
.client-identity > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.client-identity strong { color: var(--ink); font-size: 13px; }
.client-identity small { max-width: 215px; margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--ink); font-size: 13px; font-weight: 700; }
.avatar-lg { width: 54px; height: 54px; flex-basis: 54px; border-radius: 16px; font-size: 18px; }
.contact-stack { display: flex; flex-direction: column; gap: 4px; }
.contact-stack span { max-width: 190px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-stack svg { width: 12px; height: 12px; flex: 0 0 12px; }
.number-pair { display: flex; flex-direction: column; align-items: flex-end; text-align: end; }
.number-pair strong { color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.number-pair span { color: var(--muted); font-size: 11px; }
.status-badge { width: max-content; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.active { color: var(--green); background: var(--green-soft); }
.status-badge.paused { color: var(--muted); background: #ededed; }
.status-badge.large { padding: 8px 13px; font-size: 12px; }
.status-badge.pending { color: var(--amber); background: var(--amber-soft); }
.status-badge.failed { color: var(--red); background: var(--red-soft); }
.status-badge.unavailable { color: var(--amber); background: var(--amber-soft); }
.row-action { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; transition: .15s ease; }
.row-action:hover { color: #fff; border-color: var(--ink); background: var(--ink); }
.row-action svg { width: 14px; height: 14px; }
[dir="rtl"] .row-action svg { transform: rotate(180deg); }
.filter-empty { padding: 48px; color: var(--muted); text-align: center; }
.filter-empty svg { width: 24px; height: 24px; }
.filter-empty p { margin: 9px 0 0; font-size: 13px; }

/* Activity */
.pulse-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--ink); }
.pulse-icon svg { width: 17px; }
.activity-list { padding: 5px 20px 12px; }
.activity-item { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 13px; padding: 17px 3px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-item:hover .activity-copy strong { color: var(--accent); }
.activity-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.activity-dot.closed { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.activity-copy { min-width: 0; display: flex; flex-direction: column; }
.activity-copy strong { color: var(--ink); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.activity-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-copy time { margin-top: 7px; color: #9a9ea6; font-size: 11px; }
.activity-empty, .inline-empty { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.activity-empty svg, .inline-empty svg { width: 28px; height: 28px; color: #b5b7ba; }
.activity-empty p, .inline-empty p { margin: 10px 0 0; font-size: 13px; }
.empty-state { min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 38px; text-align: center; }
.empty-state.small { min-height: 220px; }
.empty-state h3 { max-width: 380px; margin: 15px 0 21px; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.empty-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: var(--ink); }
.empty-icon svg { width: 26px; height: 26px; }

/* Forms */
.form-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; align-items: start; }
.form-panel { padding: 0 24px 26px; }
.form-panel > .panel-head { margin: 0 -24px 24px; }
.form-panel .panel-head > div { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.form-panel .panel-head p { flex-basis: 100%; margin-inline-start: 43px; }
.step-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--ink); font-size: 11px; font-weight: 800; }
.full-span { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label, .field-label, .form-stack > label { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.field small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="search"], textarea { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; outline: none; color: var(--ink); background: #fff; font-size: 13px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 125px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #a0a3a9; }
input:focus, textarea:focus { border-color: #8da3f0; box-shadow: 0 0 0 3px rgba(49,91,234,.09); }
.option-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.channel-option { position: relative; min-height: 86px; display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; transition: .15s ease; }
.channel-option:hover { border-color: #abb9ec; }
.channel-option:has(input:checked) { border-color: var(--accent); background: #f8f9ff; box-shadow: inset 0 0 0 1px var(--accent); }
.channel-option input { position: absolute; opacity: 0; pointer-events: none; }
.channel-option > span:nth-of-type(2) { min-width: 0; display: flex; flex-direction: column; }
.channel-option strong { font-size: 13px; }
.channel-option small { color: var(--muted); font-size: 11px; }
.channel-option > i { width: 17px; height: 17px; margin-inline-start: auto; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.channel-option:has(input:checked) > i { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #fff; }
.channel-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--ink); }
.channel-icon.whatsapp { background: var(--green); }
.channel-icon svg { width: 17px; }
.validation-row { display: flex; align-items: flex-start; gap: 15px; }
.validation-row .addr-checks { flex: 1; }
.addr-checks { display: grid; gap: 8px; }
.addr-checks.wide { margin-top: 13px; }
.addr-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid; border-radius: 10px; font-size: 12px; }
.addr-check > span { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; }
.addr-check div { min-width: 0; display: flex; flex-direction: column; }
.addr-check strong { overflow-wrap: anywhere; }
.addr-check small { margin-top: 2px; opacity: .8; }
.addr-check.ok { color: #086b4c; border-color: #bfe4d7; background: var(--green-soft); }
.addr-check.ok > span { background: var(--green); }
.addr-check.bad { color: #a92939; border-color: #efc7cd; background: var(--red-soft); }
.addr-check.bad > span { background: var(--red); }
.addr-check.warn { color: #8a5100; border-color: #f0dcb8; background: var(--amber-soft); }
.addr-check.warn > span { background: var(--amber); }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-stack .field { margin: 0; }
.check-row { display: flex; gap: 9px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 9px 11px; margin: 0; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.check input { accent-color: var(--accent); }
.check span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row > span { display: flex; flex-direction: column; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row i { width: 39px; height: 22px; flex: 0 0 39px; position: relative; border-radius: 99px; background: #c8c9c7; transition: .2s; }
.toggle-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s; }
.toggle-row input:checked + i { background: var(--accent); }
.toggle-row input:checked + i::after { transform: translateX(17px); }
[dir="rtl"] .toggle-row input:checked + i::after { transform: translateX(-17px); }

/* Detail */
.detail-grid { display: grid; grid-template-columns: 330px minmax(0,1fr); gap: 24px; align-items: start; }
/* Column two stacks the monitored-subject panels (addresses, vehicles).
   Without this wrapper a third grid child wraps into the 330px column. */
.detail-main { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.detail-sidebar { display: flex; flex-direction: column; gap: 20px; }
.danger-panel { padding: 21px; border-color: #efdadd; }
.danger-panel h2 { color: var(--red); }
.danger-panel p { margin: 7px 0 17px; color: var(--muted); font-size: 12px; }
.addresses-panel { padding-bottom: 22px; }
.address-add { display: flex; align-items: center; gap: 9px; padding: 19px 24px; border-bottom: 1px solid var(--line); background: #fbfbf9; }
.address-input { flex: 1; max-width: none; }
.address-input input { min-height: 0; border: 0; box-shadow: none; background: transparent; }
.address-list { padding: 20px 24px 0; display: flex; flex-direction: column; gap: 15px; }
.address-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.address-head { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.address-head > div { min-width: 0; flex: 1; }
.address-head h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.address-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.address-pin { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--ink); }
.address-pin svg { width: 17px; }
.text-button { padding: 6px; border: 0; background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.text-button.danger { color: var(--red); }
.complaint-table { min-width: 750px; }
.complaint-table td:first-child { max-width: 270px; }
.complaint-table td strong { display: block; color: var(--ink); font-size: 12px; }
.complaint-table td small { display: block; margin-top: 5px; }
.mini-badge { display: inline-block; padding: 3px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 700; }
.mini-badge.sent { color: var(--green); background: var(--green-soft); }
.mini-badge.history { color: var(--amber); background: var(--amber-soft); }
.mini-badge.warn { color: var(--amber); background: var(--amber-soft); }
.mini-badge.danger { color: var(--red); background: var(--red-soft); }
.lag-note { display: flex; gap: 9px; margin: 0; padding: 13px 24px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fbfbf9; font-size: 12px; line-height: 1.55; }
.lag-note svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; }
.check-note { display: flex; gap: 9px; margin: 0; padding: 12px 17px; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.check-note svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; }
.check-note em { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-style: normal; }
.check-note.ok { color: #086b4c; background: var(--green-soft); }
.check-note.warn { color: #8a5100; background: var(--amber-soft); }
/* A verified address with nothing on it is a clean result, not a caution. */
.check-note.neutral { color: var(--ink-soft); background: var(--surface-subtle); }
.status-text { color: var(--amber); font-weight: 600; }
.status-text.closed { color: var(--green); }
.mono { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px !important; }
.muted { color: var(--muted) !important; }

/* Login */
.auth-shell { min-height: 100vh; background: var(--canvas); }
.auth-topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; padding: 0 38px; }
.auth-topbar .brand-mark { color: #fff; background: var(--ink); }
.auth-topbar .brand-copy strong { color: var(--ink); }
.auth-content { width: min(100% - 32px, 450px); margin: 6vh auto 50px; }
.login-card { position: relative; overflow: hidden; padding: 42px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 28px 70px rgba(16,18,20,.1); }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--ink); }
.login-visual { position: relative; width: 90px; height: 90px; display: grid; place-items: center; margin: 2px auto 28px; }
.radar-ring { position: absolute; border: 1px solid #d6d7d3; border-radius: 50%; }
.ring-one { inset: 0; }
.ring-two { inset: 14px; }
.radar-core { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); }
.radar-core svg { width: 19px; }
.login-copy { margin-bottom: 29px; text-align: center; }
.login-copy h1 { font-size: 34px; }
.login-copy > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.login-card .btn svg { margin-inline-start: auto; }

/* Feedback */
.flashes { display: flex; flex-direction: column; gap: 9px; margin-bottom: 22px; }
.flash { padding: 12px 15px; border: 1px solid; border-radius: 12px; font-size: 13px; font-weight: 700; }
.flash-success { color: #086b4c; border-color: #bfe4d7; background: var(--green-soft); }
.flash-error { color: #a92939; border-color: #efc7cd; background: var(--red-soft); }

@media (prefers-reduced-motion: no-preference) {
  .metric-strip, .panel { animation: enter .35s ease both; }
  .dashboard-grid > .panel { animation-delay: .05s; }
  .activity-panel { animation-delay: .09s; }
  @keyframes enter { from { opacity: 0; transform: translateY(7px); } }
}

@media (max-width: 1220px) {
  .metric-strip { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .metric:nth-child(3n+1) { border-inline-start: 0; }
  .metric:nth-child(n+4) { border-top: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .activity-panel { order: -1; }
  .activity-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 20px; }
  .activity-item:nth-child(n+4) { display: none; }
}

@media (max-width: 940px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 70px; flex-direction: row; align-items: center; padding: 8px 15px; box-shadow: 0 -12px 32px rgba(16,18,20,.2); }
  .sidebar > .brand, .sidebar-spacer, .system-card { display: none; }
  .side-nav { flex: 1; flex-direction: row; justify-content: center; gap: 7px; margin: 0; }
  .side-link { width: auto; min-width: 96px; justify-content: center; }
  .side-link.active::after { display: none; }
  .logout-form .side-link { min-width: 46px; }
  .logout-form .side-link span { display: none; }
  .topbar { padding: 0 26px; }
  .mobile-brand { display: block; }
  .mobile-brand .brand-mark { width: 40px; height: 40px; flex-basis: 40px; color: #fff; background: var(--ink); }
  .content { padding: 40px 26px 105px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-sidebar { display: grid; grid-template-columns: minmax(0,1fr) minmax(250px,.65fr); align-items: start; }
}

@media (max-width: 700px) {
  .topbar { height: 66px; padding: 0 16px; gap: 12px; }
  .topbar-date { display: none; }
  .content { padding: 30px 16px 96px; }
  .page-hero { align-items: flex-start; flex-direction: column; gap: 19px; }
  .page-hero .btn { width: 100%; }
  .client-hero > .status-badge { margin-inline-start: 69px; }
  .metric { padding: 14px 16px 15px; }
  .metric-value { font-size: 24px; }
  .metric-value.is-money { font-size: 22px; }
  .metric-note { font-size: 11.5px; }
  .panel-head { padding: 19px; }
  .client-tools { align-items: stretch; flex-direction: column; padding: 14px 19px; }
  .search-box { max-width: none; }
  .segmented { align-self: flex-start; }
  .activity-list { display: block; }
  .activity-item:nth-child(n+4) { display: grid; }
  .form-layout, .form-grid { grid-template-columns: 1fr; }
  .form-panel { padding-inline: 19px; }
  .form-panel > .panel-head { margin-inline: -19px; }
  .option-grid { grid-template-columns: 1fr; }
  .validation-row, .address-add { align-items: stretch; flex-direction: column; }
  .validation-row .btn, .address-add .btn { width: 100%; }
  .address-list { padding-inline: 13px; }
  .detail-sidebar { display: flex; }
  .auth-topbar { height: 70px; padding: 0 17px; }
  .auth-topbar .brand-copy { display: none; }
  .auth-content { margin-top: 4vh; }
  .login-card { padding: 32px 25px; }
}

@media (max-width: 450px) {
  .metric-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric:nth-child(n) { border-inline-start: 1px solid var(--line); border-top: 1px solid var(--line); }
  .metric:nth-child(2n+1) { border-inline-start: 0; }
  .metric:nth-child(-n+2) { border-top: 0; }
  .side-link { min-width: 74px; padding: 0 9px; font-size: 12px; }
  .lang { padding-inline: 8px; }
}

/* Hebrew is the default language here, and it takes neither the negative
   tracking nor the uppercasing that the Latin display styles rely on. */
[dir="rtl"] .eyebrow,
[dir="rtl"] .brand-copy small,
[dir="rtl"] table.data th { letter-spacing: normal; text-transform: none; }
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] .metric-value { letter-spacing: normal; }

/* -------------------------------------------------------------------------
   2026 dashboard command-center redesign

   The dashboard intentionally gets its own visual system: a restrained dark
   command surface, quiet data cards, and one dominant portfolio work area.
   Detail and form views continue to use the shared primitives above.
   ---------------------------------------------------------------------- */

:root {
  --canvas: #f5f6f8;
  --surface-subtle: #f8f9fb;
  --ink: #15171a;
  --ink-soft: #3f444c;
  --muted: #747a84;
  --line: #e8e9ed;
  --line-strong: #d9dce2;
  --nav: #0c1017;
  --nav-hover: #171c25;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eeedff;
  --radius: 18px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 8px 28px rgba(15, 23, 42, .045);
}

body { background: var(--canvas); }
.app-shell { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  padding: 26px 18px 20px;
  border-inline-end: 1px solid rgba(255,255,255,.055);
  background:
    radial-gradient(circle at 20% 0%, rgba(79,70,229,.12), transparent 31%),
    var(--nav);
}
.sidebar .brand { padding: 0 8px; }
.brand-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #6d63f2, #3d35bf);
  box-shadow: 0 9px 24px rgba(49,46,129,.35), inset 0 1px rgba(255,255,255,.28);
  font-size: 12px;
  letter-spacing: .02em;
}
.brand-copy strong { font-size: 13px; letter-spacing: .01em; }
.brand-copy small { color: #656d7c; font-size: 10px; }
.side-nav { margin-top: 45px; gap: 5px; }
.side-link {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: #7d8594;
  font-size: 12.5px;
}
.side-link:hover { background: rgba(255,255,255,.055); }
.side-link.active {
  color: #f8fafc;
  background: linear-gradient(90deg, rgba(99,102,241,.19), rgba(99,102,241,.07));
  box-shadow: inset 1px 0 rgba(129,140,248,.65);
}
.side-link.active::after { width: 5px; height: 5px; background: #818cf8; }
.system-card {
  padding: 14px;
  border-color: rgba(255,255,255,.075);
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.system-card strong { font-size: 12.5px; }
.live-dot { background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.11), 0 0 16px rgba(74,222,128,.32); }
.topbar {
  height: 72px;
  padding: 0 38px;
  background: rgba(245,246,248,.84);
  border-bottom-color: rgba(217,220,226,.75);
  backdrop-filter: blur(22px) saturate(1.2);
}
.topbar-date span { color: #959aa3; }
.topbar-date strong { font-weight: 600; }
.lang-switch { border-color: #dfe1e5; background: #eceef2; }
.lang.active { box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.content { width: min(100%, 1640px); padding: 36px 38px 76px; }

/* Hero command surface */
.dashboard-page { min-width: 0; }
.command-hero {
  position: relative;
  isolation: isolate;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(330px,.8fr);
  align-items: stretch;
  gap: clamp(32px,5vw,76px);
  overflow: hidden;
  padding: clamp(32px,4vw,54px);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 26px;
  color: #fff;
  background:
    linear-gradient(125deg, rgba(14,20,31,.99), rgba(18,25,41,.97) 58%, rgba(25,30,53,.98));
  box-shadow: 0 24px 60px rgba(15,23,42,.14), inset 0 1px rgba(255,255,255,.07);
}
.command-grid {
  position: absolute;
  z-index: -2;
  inset: 0;
  opacity: .36;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, #000, transparent 72%);
}
.command-glow { position: absolute; z-index: -1; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.command-glow-one { width: 430px; height: 430px; inset: -250px auto auto -120px; background: radial-gradient(circle, rgba(79,70,229,.34), transparent 68%); }
.command-glow-two { width: 380px; height: 380px; inset: auto -110px -250px auto; background: radial-gradient(circle, rgba(14,165,233,.18), transparent 68%); }
.command-copy { align-self: center; max-width: 720px; }
.command-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; color: #8f98a9; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
[dir="rtl"] .command-kicker { letter-spacing: normal; text-transform: none; }
.command-live { display: inline-flex; align-items: center; gap: 7px; color: #a7f3d0; }
.command-live i, .snapshot-status i { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.11), 0 0 12px rgba(74,222,128,.38); }
.command-divider { width: 24px; height: 1px; background: rgba(255,255,255,.18); }
.command-copy h1 { max-width: 650px; font-size: clamp(38px,4.5vw,62px); font-weight: 650; line-height: .98; letter-spacing: -.045em; }
[dir="rtl"] .command-copy h1 { letter-spacing: normal; }
.command-copy > p { max-width: 630px; margin: 18px 0 0; color: #9ca4b3; font-size: 15px; line-height: 1.75; }
.command-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 29px; }
.command-actions .btn { min-height: 45px; border-radius: 11px; }
.command-primary { color: #111827; background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.command-primary:hover { background: #f4f4f6; }
.command-secondary { color: #c9ced7; border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.045); }
.command-secondary:hover { border-color: rgba(255,255,255,.26); background: rgba(255,255,255,.08); }

.command-snapshot {
  align-self: center;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 19px;
  background: rgba(255,255,255,.055);
  box-shadow: 0 18px 50px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
}
.snapshot-head { display: flex; align-items: center; gap: 11px; padding: 16px 17px; border-bottom: 1px solid rgba(255,255,255,.09); }
.snapshot-head > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.snapshot-head strong { color: #f8fafc; font-size: 12px; }
.snapshot-head small { margin-top: 2px; color: #717b8d; font-size: 10.5px; }
.snapshot-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(129,140,248,.24); border-radius: 10px; color: #a5b4fc; background: rgba(99,102,241,.12); }
.snapshot-icon svg { width: 15px; }
.snapshot-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid rgba(74,222,128,.13); border-radius: 99px; color: #86efac; background: rgba(34,197,94,.08); font-size: 10px; font-weight: 700; }
.snapshot-status i { width: 5px; height: 5px; box-shadow: none; }
.snapshot-total { padding: 23px 20px 20px; }
.snapshot-total > span { display: block; color: #7f899b; font-size: 11px; font-weight: 600; }
.snapshot-total > strong { display: block; margin: 6px 0 3px; color: #fff; font-size: 46px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.snapshot-total > small { color: #7e8798; font-size: 11px; }
.snapshot-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid rgba(255,255,255,.09); }
.snapshot-grid > div { min-width: 0; padding: 15px 19px 17px; }
.snapshot-grid > div + div { border-inline-start: 1px solid rgba(255,255,255,.09); }
.snapshot-grid span { display: block; color: #717b8d; font-size: 10px; }
.snapshot-grid strong { display: block; margin-top: 3px; color: #e5e7eb; font-size: 19px; font-weight: 600; }
.snapshot-grid strong.attention { color: #fbbf24; }
.snapshot-grid strong.danger { color: #fb7185; }

/* Compact metric cards */
.overview-metrics { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.overview-card {
  position: relative;
  min-width: 0;
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.025);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.overview-card:hover { z-index: 2; transform: translateY(-2px); border-color: #d9dce3; box-shadow: 0 12px 28px rgba(15,23,42,.07); }
.overview-card::after { content: ""; position: absolute; inset: 0 0 auto; height: 2px; opacity: 0; background: var(--accent); transition: opacity .18s; }
.overview-card:hover::after, .overview-card.has-attention::after, .overview-card.has-danger::after { opacity: 1; }
.overview-card.has-attention::after { background: #f59e0b; }
.overview-card.has-danger::after { background: #e11d48; }
.overview-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 12px; }
.overview-icon svg { width: 17px; height: 17px; }
.icon-clients { color: #4f46e5; background: #eeedff; }
.icon-address { color: #0369a1; background: #eaf7ff; }
.icon-plate { color: #047857; background: #e9f8f2; }
.icon-cases { color: #b45309; background: #fff6e6; }
.icon-due { color: #be123c; background: #fff0f3; }
.overview-copy { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; column-gap: 8px; }
.overview-copy > span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overview-copy > strong { margin-top: 6px; color: var(--ink); font-size: 28px; font-weight: 650; line-height: 1; letter-spacing: -.03em; }
.overview-copy > small { grid-column: 1 / -1; margin-top: 6px; color: #9a9fa8; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Portfolio work surface */
.redesigned-grid { grid-template-columns: minmax(0,1fr) 356px; gap: 18px; }
.dashboard-rail { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.redesigned-panel { border-color: var(--line); border-radius: 19px; box-shadow: var(--shadow); }
.redesigned-panel .panel-head { min-height: 80px; padding: 17px 20px; background: #fff; }
.section-heading { min-width: 0; display: flex; align-items: center; gap: 12px; }
.section-heading > div { min-width: 0; }
.section-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; color: #4f46e5; background: #f0efff; }
.section-icon svg { width: 16px; }
.activity-section-icon { color: #047857; background: #ebf9f3; }
.panel-head h2 { font-size: 15px; }
.panel-head p { margin-top: 3px; color: #91969f; font-size: 11.5px; }
.count-pill { min-width: 31px; height: 31px; border: 1px solid #e3e2ff; border-radius: 10px; color: #4f46e5; background: #f5f4ff; font-size: 12px; }
.redesigned-tools { padding: 12px 20px; background: #fafbfc; }
.redesigned-tools .search-box { height: 40px; border-color: #e0e2e7; border-radius: 9px; box-shadow: 0 1px 1px rgba(15,23,42,.02); }
.redesigned-tools .segmented { border-color: #e1e3e7; border-radius: 9px; background: #eff0f3; }
.redesigned-tools .segment { min-height: 29px; border-radius: 6px; font-size: 11px; }
.redesigned-table thead th { height: 42px; padding-inline: 14px; color: #9298a2; background: #fff; font-size: 9.5px; letter-spacing: .085em; }
.redesigned-table td { height: 67px; padding: 11px 14px; }
.redesigned-table tbody tr:hover { background: #f9faff; }
.redesigned-table .avatar { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; color: #3730a3; background: linear-gradient(145deg,#eeedff,#dddafe); box-shadow: inset 0 0 0 1px rgba(79,70,229,.08); }
.redesigned-table .client-identity strong { font-weight: 650; }
.redesigned-table .number-pair strong { font-size: 14px; }
.redesigned-table .status-badge { border: 1px solid rgba(8,127,91,.08); }
.redesigned-table .row-action { width: 31px; height: 31px; border-radius: 9px; }
.redesigned-table .row-action:hover { border-color: #4f46e5; background: #4f46e5; }

/* Activity rail */
.redesigned-activity { padding: 4px 16px 10px; }
.redesigned-activity .activity-item { grid-template-columns: 18px minmax(0,1fr) 18px; gap: 10px; padding: 15px 2px; }
.activity-marker { position: relative; align-self: stretch; display: flex; justify-content: center; }
.activity-marker::after { content: ""; position: absolute; top: 18px; bottom: -16px; width: 1px; background: #eceef1; }
.activity-item:last-child .activity-marker::after { display: none; }
.activity-marker .activity-dot { position: relative; z-index: 1; width: 7px; height: 7px; margin-top: 5px; box-shadow: 0 0 0 4px var(--amber-soft), 0 0 0 5px #fff; }
.activity-copy strong { font-size: 12.5px; font-weight: 650; }
.activity-copy small { margin-top: 3px; }
.activity-copy time { margin-top: 5px; color: #a1a6af; font-size: 10px; }
.activity-arrow { align-self: center; width: 13px; height: 13px; color: #c2c5cb; transition: transform .15s,color .15s; }
.activity-item:hover .activity-arrow { color: #4f46e5; transform: translateX(2px); }
[dir="rtl"] .activity-item:hover .activity-arrow { transform: translateX(-2px) rotate(180deg); }
[dir="rtl"] .activity-arrow { transform: rotate(180deg); }
.confidence-card {
  position: relative;
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid #dcefe7;
  border-radius: 17px;
  background: linear-gradient(135deg,#f4fcf8,#edf9f3);
}
.confidence-card > div:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.confidence-card span { color: #4d7d69; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
[dir="rtl"] .confidence-card span { text-transform: none; letter-spacing: normal; }
.confidence-card strong { margin-top: 2px; color: #075c42; font-size: 13px; }
.confidence-card small { margin-top: 3px; color: #6b8f80; font-size: 10.5px; }
.confidence-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #0b8f66; box-shadow: 0 8px 20px rgba(11,143,102,.2); }
.confidence-icon svg { width: 17px; }
.confidence-pulse { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #20b982; box-shadow: 0 0 0 5px rgba(32,185,130,.12); }

@media (prefers-reduced-motion: no-preference) {
  .command-hero { animation: dashboard-rise .45s cubic-bezier(.2,.75,.25,1) both; }
  .overview-card { animation: dashboard-rise .38s cubic-bezier(.2,.75,.25,1) both; }
  .overview-card:nth-child(2) { animation-delay: .035s; }
  .overview-card:nth-child(3) { animation-delay: .07s; }
  .overview-card:nth-child(4) { animation-delay: .105s; }
  .overview-card:nth-child(5) { animation-delay: .14s; }
  @keyframes dashboard-rise { from { opacity: 0; transform: translateY(9px); } }
}

@media (max-width: 1340px) {
  .overview-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .overview-card:nth-child(n+4) { min-height: 100px; }
  .redesigned-grid { grid-template-columns: minmax(0,1fr) 320px; }
}

@media (max-width: 1120px) {
  .command-hero { grid-template-columns: minmax(0,1fr) 330px; gap: 28px; }
  .command-copy h1 { font-size: clamp(36px,5vw,50px); }
  .redesigned-grid { grid-template-columns: 1fr; }
  .dashboard-rail { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.55fr); align-items: start; }
  .redesigned-activity { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
  .redesigned-activity .activity-item:nth-child(n+5) { display: none; }
  .activity-marker::after { display: none; }
}

@media (max-width: 940px) {
  .app-shell { display: block; }
  .content { padding: 28px 24px 104px; }
  .command-hero { min-height: auto; }
}

@media (max-width: 760px) {
  .command-hero { grid-template-columns: 1fr; gap: 28px; padding: 28px; border-radius: 21px; }
  .command-copy h1 { font-size: 38px; }
  .command-copy > p { font-size: 13px; }
  .command-snapshot { width: 100%; }
  .overview-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-card { min-height: 102px; }
  .overview-card:last-child { grid-column: 1 / -1; }
  .dashboard-rail { display: flex; }
  .redesigned-activity { display: block; }
  .redesigned-activity .activity-item:nth-child(n) { display: grid; }
}

@media (max-width: 520px) {
  .content { padding-inline: 14px; }
  .command-hero { padding: 24px 20px; }
  .command-kicker { gap: 8px; }
  .command-copy h1 { font-size: 34px; }
  .command-actions { display: grid; grid-template-columns: 1fr; }
  .command-actions .btn { width: 100%; }
  .snapshot-total > strong { font-size: 39px; }
  .overview-metrics { gap: 9px; }
  .overview-card { align-items: flex-start; gap: 10px; min-height: 126px; padding: 14px; }
  .overview-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .overview-copy { display: flex; flex-direction: column; align-items: flex-start; }
  .overview-copy > strong { font-size: 24px; }
  .redesigned-panel .panel-head { padding-inline: 15px; }
  .redesigned-tools { padding-inline: 15px; }
}

/* -------------------------------------------------------------------------
   Studio workspace — second-generation full redesign.
   This replaces the sidebar/hero composition with a horizontal product shell
   and an editorial bento dashboard. The older rules remain as fallbacks for
   cached templates during a rolling Gunicorn restart.
   ---------------------------------------------------------------------- */

:root {
  --canvas: #f4f4f1;
  --surface: #ffffff;
  --ink: #171816;
  --ink-soft: #444640;
  --muted: #7b7e76;
  --line: #e5e6e0;
  --line-strong: #d8dad2;
  --accent: #5b50e6;
  --accent-hover: #473ccf;
  --accent-soft: #efedff;
  --shadow: 0 1px 1px rgba(20,22,18,.03), 0 12px 34px rgba(20,22,18,.045);
}

body { background: var(--canvas); }
.app-shell { display: block; min-height: 100vh; }
.app-frame { min-width: 0; }
.global-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(219,220,214,.9);
  background: rgba(250,250,248,.9);
  box-shadow: 0 1px rgba(255,255,255,.7);
  backdrop-filter: blur(22px) saturate(1.3);
}
.global-nav .brand { flex: 0 0 auto; }
.global-nav .brand-mark {
  width: 39px;
  height: 39px;
  flex-basis: 39px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: #171816;
  box-shadow: 0 7px 16px rgba(23,24,22,.16);
}
.global-nav .brand-copy strong { color: #171816; font-size: 12.5px; }
.global-nav .brand-copy small { color: #999c94; font-size: 9px; }
.global-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e3e4de;
  border-radius: 12px;
  background: #f0f1ed;
}
.global-tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 8px;
  color: #7a7d75;
  font-size: 11.5px;
  font-weight: 650;
  transition: .16s ease;
}
.global-tab svg { width: 14px; height: 14px; }
.global-tab:hover { color: #171816; }
.global-tab.active { color: #171816; background: #fff; box-shadow: 0 1px 3px rgba(18,20,16,.09); }
.global-actions { min-width: 0; display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.nav-date { display: flex; flex-direction: column; align-items: flex-end; margin-inline-end: 4px; }
[dir="rtl"] .nav-date { align-items: flex-start; }
.nav-date span { color: #a1a49c; font-size: 9px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.nav-date strong { margin-top: 1px; color: #555851; font-size: 10.5px; font-weight: 600; }
.nav-system { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid #dce9e1; border-radius: 99px; color: #287153; background: #f3faf6; }
.nav-system strong { font-size: 10px; }
.nav-system .live-dot { width: 6px; height: 6px; flex-basis: 6px; margin: 0; background: #36b37e; box-shadow: 0 0 0 3px rgba(54,179,126,.1); }
.global-nav .lang-switch { border-color: #e0e1dc; border-radius: 10px; background: #f0f1ed; }
.global-nav .lang { padding: 5px 9px; font-size: 10.5px; }
.nav-create {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 10px;
  color: #fff;
  background: #171816;
  box-shadow: 0 6px 16px rgba(23,24,22,.13);
  font-size: 11px;
  font-weight: 700;
  transition: transform .15s ease, background .15s ease;
}
.nav-create:hover { transform: translateY(-1px); background: #2b2d29; }
.nav-create svg, .nav-logout svg { width: 14px; height: 14px; }
.global-nav .logout-form { display: flex; }
.nav-logout {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e0e1dc;
  border-radius: 10px;
  color: #7c7f77;
  background: #fff;
  cursor: pointer;
}
.nav-logout:hover { color: #171816; border-color: #cfd1ca; }
.content { width: min(100%, 1580px); margin: 0 auto; padding: 46px 42px 82px; }

/* Editorial workspace heading */
.studio-dashboard { min-width: 0; }
.workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.workspace-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: #8f928a; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
[dir="rtl"] .workspace-kicker { letter-spacing: normal; text-transform: none; }
.workspace-kicker span { width: 18px; height: 1px; background: #a6a9a1; }
.workspace-head h1 { font-size: clamp(36px,4vw,52px); font-weight: 570; line-height: 1; letter-spacing: -.04em; }
[dir="rtl"] .workspace-head h1 { letter-spacing: normal; }
.workspace-intro { max-width: 690px; margin: 13px 0 0; color: #7e8179; font-size: 13px; line-height: 1.65; }
.workspace-head-actions { display: flex; align-items: center; gap: 10px; }
.workspace-live { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #dfe1da; border-radius: 11px; color: #666a62; background: #fafaf8; font-size: 10.5px; font-weight: 700; }
.workspace-live i { width: 7px; height: 7px; border-radius: 50%; background: #31af77; box-shadow: 0 0 0 4px rgba(49,175,119,.1); }
.workspace-add { min-height: 42px; border-radius: 11px; color: #fff; background: #5b50e6; box-shadow: 0 8px 18px rgba(91,80,230,.18); }
.workspace-add:hover { background: #473ccf; }

/* Bento briefing */
.briefing-grid { display: grid; grid-template-columns: minmax(0,1.48fr) minmax(220px,.62fr) minmax(220px,.62fr); gap: 14px; }
.brief-card { position: relative; min-width: 0; min-height: 300px; overflow: hidden; border-radius: 23px; }
.portfolio-brief { display: flex; flex-direction: column; padding: 25px 27px 0; border: 1px solid #e1e2dc; background: #fff; box-shadow: var(--shadow); }
.brief-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.brief-topline > div { min-width: 0; display: flex; flex-direction: column; }
.brief-topline span { color: #898c84; font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
[dir="rtl"] .brief-topline span { letter-spacing: normal; text-transform: none; }
.brief-topline strong { margin-top: 3px; color: #31332f; font-size: 12px; font-weight: 650; }
.brief-period { flex: 0 0 auto; padding: 6px 9px; border: 1px solid #e8e9e3; border-radius: 8px; background: #fafaf8; font-size: 9px !important; letter-spacing: 0 !important; text-transform: none !important; }
.portfolio-number { display: flex; align-items: baseline; gap: 11px; margin-top: 16px; }
.portfolio-number strong { font-size: clamp(46px,5vw,68px); font-weight: 560; line-height: 1; letter-spacing: -.05em; }
.portfolio-number span { color: #8b8e86; font-size: 11px; font-weight: 650; }
.portfolio-chart { width: 100%; height: 92px; margin-top: auto; overflow: visible; }
.chart-area { fill: url(#areaGradient); }
.chart-line { fill: none; stroke: #6f63f0; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.portfolio-breakdown { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0 -27px; border-top: 1px solid #e9eae5; background: #fbfbf9; }
.portfolio-breakdown > div { display: flex; align-items: center; gap: 10px; padding: 13px 27px; }
.portfolio-breakdown > div + div { border-inline-start: 1px solid #e9eae5; }
.breakdown-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 9px; }
.breakdown-icon svg { width: 13px; height: 13px; }
.breakdown-icon.address { color: #2563eb; background: #eaf1ff; }
.breakdown-icon.plate { color: #08765a; background: #e8f6f0; }
.portfolio-breakdown p { min-width: 0; display: flex; flex-direction: column; margin: 0; }
.portfolio-breakdown small { color: #92958d; font-size: 9.5px; }
.portfolio-breakdown strong { color: #292b27; font-size: 15px; font-weight: 700; }

.attention-brief { display: flex; flex-direction: column; padding: 23px; color: #fff; background: #191a18; box-shadow: 0 18px 40px rgba(20,22,18,.13); }
.attention-brief::before { content: ""; position: absolute; width: 220px; height: 220px; inset: -125px -100px auto auto; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.025), 0 0 0 68px rgba(255,255,255,.018); }
.brief-card-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #ffb4a3; background: rgba(255,111,77,.12); }
.brief-card-icon svg { width: 16px; height: 16px; }
.attention-copy { position: relative; display: flex; flex-direction: column; margin-top: 26px; }
.attention-copy span { color: #8f938a; font-size: 10px; font-weight: 700; }
.attention-copy strong { margin-top: 3px; font-size: 50px; font-weight: 560; line-height: 1; letter-spacing: -.04em; }
.attention-copy small { margin-top: 5px; color: #777b73; font-size: 10px; }
.attention-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: auto -23px -23px; padding: 16px 23px 18px; border-top: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.025); }
.attention-footer span { color: #858980; font-size: 9.5px; }
.attention-footer strong { color: #ff8065; font-size: 20px; font-weight: 650; }

.clients-brief { display: flex; flex-direction: column; padding: 23px; color: #292751; background: #dedaff; box-shadow: 0 12px 30px rgba(87,75,190,.09); }
.clients-brief .brief-topline span { color: #706aa5; }
.clients-brief .brief-topline strong { color: #3b376f; }
.brief-card-icon.light { color: #5148be; background: rgba(255,255,255,.46); }
.clients-number { display: flex; align-items: baseline; gap: 9px; margin-top: 30px; }
.clients-number strong { font-size: 50px; font-weight: 560; line-height: 1; letter-spacing: -.04em; }
.clients-number span { color: #716ca2; font-size: 10px; font-weight: 700; }
.client-avatar-stack { display: flex; margin-top: 24px; padding-inline-start: 7px; }
.client-avatar-stack span { width: 32px; height: 32px; display: grid; place-items: center; margin-inline-start: -7px; border: 2px solid #dedaff; border-radius: 50%; color: #fff; background: #5952a5; font-size: 10px; font-weight: 750; }
.client-avatar-stack span:nth-child(2) { background: #7b74c7; }
.client-avatar-stack span:nth-child(3) { background: #3e397f; }
.client-avatar-stack span:nth-child(4) { background: #918be0; }
.brief-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: auto -23px -23px; padding: 16px 23px 18px; border-top: 1px solid rgba(60,54,120,.12); color: #4a4589; font-size: 10px; font-weight: 750; }
.brief-link svg { width: 14px; height: 14px; }
[dir="rtl"] .brief-link svg { transform: rotate(180deg); }

/* Facts and records */
.quick-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin: 15px 0; overflow: hidden; border: 1px solid #e2e3dd; border-radius: 16px; background: #e2e3dd; }
.quick-facts article { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 15px 18px; background: #fff; }
.quick-facts article > div { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 9px; }
.quick-facts article div > span { grid-column: 1 / -1; color: #91948c; font-size: 9.5px; font-weight: 650; }
.quick-facts article strong { color: #292b27; font-size: 18px; font-weight: 680; }
.quick-facts article small { color: #9a9d95; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; color: #5b50e6; background: #efedff; }
.fact-icon.success { color: #177656; background: #eaf7f1; }
.fact-icon svg { width: 14px; height: 14px; }

.studio-workbench { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 15px; align-items: start; }
.studio-panel { min-width: 0; overflow: hidden; border: 1px solid #e1e2dc; border-radius: 19px; background: #fff; box-shadow: var(--shadow); }
.studio-panel-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 19px; border-bottom: 1px solid #e8e9e4; }
.studio-panel-head > div { min-width: 0; }
.panel-kicker { margin: 0; color: #242621; font-size: 13px; font-weight: 730; }
.studio-panel-head h2 { margin-top: 4px; color: #969990; font-size: 10.5px; font-weight: 500; }
.record-count { min-width: 29px; height: 29px; display: grid; place-items: center; padding: 0 8px; border: 1px solid #e0defd; border-radius: 9px; color: #5b50e6; background: #f4f2ff; font-size: 10px; font-weight: 750; }
.studio-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 19px; border-bottom: 1px solid #e9eae5; background: #fafaf8; }
.studio-search { width: min(100%,380px); height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid #dedfd9; border-radius: 9px; background: #fff; }
.studio-search svg { width: 14px; height: 14px; color: #969990; }
.studio-search input { min-width: 0; width: 100%; min-height: 0; padding: 0; border: 0; outline: 0; box-shadow: none; background: transparent; font-size: 11px; }
.studio-search:focus-within { border-color: #aca7ea; box-shadow: 0 0 0 3px rgba(91,80,230,.08); }
.studio-segments { display: flex; gap: 3px; padding: 3px; border: 1px solid #e1e2dc; border-radius: 9px; background: #eff0ec; }
.studio-segments button { min-height: 28px; padding: 0 10px; border: 0; border-radius: 6px; color: #888b83; background: transparent; font-size: 10px; font-weight: 650; cursor: pointer; }
.studio-segments button.active { color: #22241f; background: #fff; box-shadow: 0 1px 3px rgba(20,22,18,.09); }
.studio-table thead th { height: 40px; padding-inline: 13px; color: #9a9d95; background: #fff; font-size: 9px; letter-spacing: .075em; }
.studio-table-wrap { max-width: 100%; overflow-x: auto; direction: ltr; contain: inline-size; }
[dir="rtl"] .studio-table { direction: rtl; }
.studio-table td { height: 66px; padding: 10px 13px; }
.studio-table tbody tr:hover { background: #fafaff; }
.studio-avatar { width: 35px; height: 35px; flex-basis: 35px; border-radius: 50%; color: #5147bd; background: #e9e6ff; }
.studio-table .client-identity strong { font-size: 12px; font-weight: 700; }
.studio-table .client-identity small { font-size: 9.5px; }
.studio-table .number-pair strong { font-size: 14px; }
.studio-table .number-pair span, .studio-table .contact-stack span { font-size: 10px; }
.studio-row-action { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #e2e3de; border-radius: 50%; color: #868980; background: #fff; }
.studio-row-action:hover { color: #fff; border-color: #5b50e6; background: #5b50e6; }
.studio-row-action svg { width: 12px; height: 12px; }
[dir="rtl"] .studio-row-action svg { transform: rotate(180deg); }

.activity-studio-panel { box-shadow: none; }
.activity-live { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #edf8f2; }
.activity-live i { width: 7px; height: 7px; border-radius: 50%; background: #32ad78; box-shadow: 0 0 0 4px rgba(50,173,120,.1); }
.studio-activity-list { padding: 5px 16px 10px; }
.studio-activity-item { display: grid; grid-template-columns: 34px minmax(0,1fr) 14px; align-items: center; gap: 10px; padding: 13px 1px; border-bottom: 1px solid #ecece7; }
.studio-activity-item:last-child { border-bottom: 0; }
.studio-activity-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #b76714; background: #fff3e5; }
.studio-activity-icon.closed { color: #147151; background: #eaf7f1; }
.studio-activity-icon svg { width: 13px; height: 13px; }
.studio-activity-item > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.studio-activity-item strong { color: #30322d; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-activity-item small { margin-top: 2px; color: #95988f; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-activity-item time { margin-top: 3px; color: #b1b3ad; font-size: 9px; }
.studio-activity-arrow { width: 12px; height: 12px; color: #c0c2bc; }
[dir="rtl"] .studio-activity-arrow { transform: rotate(180deg); }
.studio-activity-item:hover strong { color: #5b50e6; }
.studio-activity-item:hover .studio-activity-arrow { color: #5b50e6; }

@media (prefers-reduced-motion: no-preference) {
  .brief-card { animation: studio-enter .42s cubic-bezier(.2,.75,.25,1) both; }
  .brief-card:nth-child(2) { animation-delay: .05s; }
  .brief-card:nth-child(3) { animation-delay: .1s; }
  @keyframes studio-enter { from { opacity: 0; transform: translateY(8px); } }
}

@media (max-width: 1180px) {
  .nav-date, .nav-system { display: none; }
  .briefing-grid { grid-template-columns: minmax(0,1.35fr) repeat(2,minmax(190px,.65fr)); }
  .studio-workbench { grid-template-columns: minmax(0,1fr) 300px; }
}

@media (max-width: 940px) {
  .global-nav { height: 66px; padding: 0 18px; gap: 14px; background: #fafaf8; backdrop-filter: none; }
  .global-nav .brand-copy { display: none; }
  .global-tabs {
    position: fixed;
    z-index: 100;
    inset: auto 50% 12px auto;
    min-width: 220px;
    justify-content: center;
    padding: 5px;
    border-color: rgba(255,255,255,.1);
    background: rgba(22,23,21,.94);
    box-shadow: 0 14px 38px rgba(20,22,18,.28);
    transform: translateX(50%);
    backdrop-filter: blur(18px);
  }
  .global-tab { flex: 1; justify-content: center; color: #8f938a; }
  .global-tab:hover { color: #fff; }
  .global-tab.active { color: #fff; background: rgba(255,255,255,.1); box-shadow: none; }
  .content { padding: 34px 24px 104px; }
  .briefing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .portfolio-brief { grid-column: 1 / -1; }
  .studio-workbench { grid-template-columns: 1fr; }
  .activity-studio-panel { order: -1; }
  .studio-activity-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
}

@media (max-width: 680px) {
  .global-nav .lang-switch { margin-inline-start: auto; }
  .nav-create { width: 38px; padding: 0; justify-content: center; }
  .nav-create span, .nav-logout { display: none; }
  .workspace-head { align-items: flex-start; flex-direction: column; gap: 18px; }
  .workspace-head-actions { width: 100%; }
  .workspace-live { flex: 1; }
  .workspace-add { flex: 1; }
  .briefing-grid { grid-template-columns: 1fr; }
  .portfolio-brief { grid-column: auto; min-height: 320px; }
  .attention-brief, .clients-brief { min-height: 250px; }
  .quick-facts { grid-template-columns: 1fr; }
  .studio-tools { align-items: stretch; flex-direction: column; }
  .studio-search { width: 100%; }
  .studio-segments { align-self: flex-start; }
  .studio-activity-list { display: block; }
}

@media (max-width: 430px) {
  .global-nav { padding-inline: 12px; }
  .global-nav .lang { padding-inline: 7px; }
  .content { padding: 28px 13px 98px; }
  .workspace-head h1 { font-size: 37px; }
  .workspace-head-actions { display: grid; grid-template-columns: 1fr; }
  .workspace-add { width: 100%; }
  .portfolio-brief { padding-inline: 20px; }
  .portfolio-breakdown { margin-inline: -20px; }
  .portfolio-breakdown > div { padding-inline: 17px; }
}

/* -------------------------------------------------------------------------
   Premium client workspace
   ---------------------------------------------------------------------- */
.client-studio { min-width: 0; }
.client-breadcrumb { width: max-content; display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; color: #8a8d85; font-size: 10.5px; font-weight: 700; }
.client-breadcrumb:hover { color: #5b50e6; }
.client-breadcrumb svg { width: 13px; height: 13px; transform: rotate(180deg); }
[dir="rtl"] .client-breadcrumb svg { transform: none; }

.client-profile-hero {
  position: relative;
  min-height: 164px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: 27px 30px;
  border: 1px solid #dedfd9;
  border-radius: 23px;
  background:
    radial-gradient(circle at 8% 8%, rgba(91,80,230,.1), transparent 24%),
    linear-gradient(120deg,#fff,#fbfbf8);
  box-shadow: var(--shadow);
}
.client-profile-hero::after { content: ""; position: absolute; width: 230px; height: 230px; inset: auto -130px -160px auto; border: 1px solid rgba(91,80,230,.08); border-radius: 50%; box-shadow: 0 0 0 34px rgba(91,80,230,.025), 0 0 0 68px rgba(91,80,230,.015); pointer-events: none; }
.client-profile-main { min-width: 0; display: flex; align-items: center; gap: 18px; }
.client-profile-avatar { width: 72px; height: 72px; flex: 0 0 72px; display: grid; place-items: center; border-radius: 21px; color: #fff; background: linear-gradient(145deg,#6f64ec,#4d42ca); box-shadow: 0 14px 28px rgba(77,66,202,.2), inset 0 1px rgba(255,255,255,.25); font-size: 24px; font-weight: 720; }
.client-profile-main > div { min-width: 0; }
.client-profile-kicker { margin: 0 0 7px !important; color: #8e9189 !important; font-size: 9.5px !important; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
[dir="rtl"] .client-profile-kicker { letter-spacing: normal; text-transform: none; }
.client-profile-main h1 { max-width: 720px; font-size: clamp(30px,3.5vw,44px); font-weight: 590; letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[dir="rtl"] .client-profile-main h1 { letter-spacing: normal; }
.client-profile-main > div > p:last-child { margin: 8px 0 0; color: #898c84; font-size: 11.5px; }
.client-profile-meta { position: relative; z-index: 1; min-width: 240px; display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.client-profile-meta > span { max-width: 290px; display: flex; align-items: center; gap: 7px; color: #74776f; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-profile-meta svg { width: 13px; height: 13px; color: #a0a39b; }
.profile-status { width: max-content; display: inline-flex; align-items: center; gap: 7px; margin-top: 3px; padding: 6px 10px; border-radius: 99px; font-size: 10px; }
.profile-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.profile-status.active { color: #197050; background: #eaf7f1; }
.profile-status.paused { color: #777b73; background: #eceee9; }

.client-stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; margin: 14px 0; overflow: hidden; border: 1px solid #e0e1db; border-radius: 17px; background: #e0e1db; }
.client-stat-grid article { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: #fff; }
.client-stat-grid article > div { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 1px 9px; }
.client-stat-grid small { grid-column: 1 / -1; color: #93968e; font-size: 9.5px; font-weight: 650; }
.client-stat-grid strong { color: #282a26; font-size: 22px; font-weight: 670; letter-spacing: -.02em; }
.client-stat-grid article > div > span { color: #a0a39b; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-stat-icon { width: 37px; height: 37px; flex: 0 0 37px; display: grid; place-items: center; border-radius: 11px; }
.client-stat-icon svg { width: 15px; height: 15px; }
.client-stat-icon.address { color: #2563eb; background: #eaf1ff; }
.client-stat-icon.plate { color: #0b7659; background: #e9f7f1; }
.client-stat-icon.complaint { color: #6a55c8; background: #f0edff; }
.client-stat-icon.due { color: #b42343; background: #fff0f3; }
.client-stat-alert { box-shadow: inset 0 2px #e84f6d; }
.client-stat-alert strong { color: #b42343; }

.client-workspace-grid { display: grid; grid-template-columns: minmax(0,1fr) 318px; gap: 15px; align-items: start; }
.subjects-column { min-width: 0; display: flex; flex-direction: column; gap: 15px; }
.subject-section { min-width: 0; overflow: hidden; border: 1px solid #e0e1db; border-radius: 19px; background: #fff; box-shadow: var(--shadow); }
.subject-section-head { min-height: 79px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 19px; border-bottom: 1px solid #e7e8e2; }
.subject-section-head > div { min-width: 0; display: flex; align-items: center; gap: 12px; }
.subject-section-head > div > div { min-width: 0; }
.subject-section-head p { margin: 0 0 2px; color: #9a9d95; font-size: 8.5px; font-weight: 720; letter-spacing: .08em; text-transform: uppercase; }
[dir="rtl"] .subject-section-head p { letter-spacing: normal; text-transform: none; }
.subject-section-head h2 { color: #2b2d28; font-size: 14px; font-weight: 720; }
.subject-section-head small { display: block; margin-top: 2px; color: #9a9d95; font-size: 9.5px; }
.subject-heading-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 12px; color: #2463db; background: #edf3ff; }
.subject-heading-icon.plate { color: #087054; background: #ebf7f2; }
.subject-heading-icon svg { width: 16px; height: 16px; }
.subject-count { min-width: 30px; height: 30px; display: grid; place-items: center; padding: 0 8px; border: 1px solid #e1defd; border-radius: 9px; color: #5b50e6; background: #f4f2ff; font-size: 10px; font-weight: 750; }
.client-notice { display: flex; align-items: center; gap: 8px; padding: 11px 19px; border-bottom: 1px solid #d9eee4; color: #227354; background: #f0faf5; font-size: 10.5px; font-weight: 650; }
.client-notice svg { width: 14px; height: 14px; }

.subject-add { display: flex; align-items: center; gap: 8px; padding: 12px 19px; border-bottom: 1px solid #e9eae5; background: #fafaf8; }
.subject-input { min-width: 170px; height: 40px; display: flex; flex: 1; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid #dfe0da; border-radius: 9px; background: #fff; }
.subject-input:focus-within { border-color: #aaa5ea; box-shadow: 0 0 0 3px rgba(91,80,230,.08); }
.subject-input svg { width: 14px; height: 14px; color: #989b93; }
.subject-input input { min-width: 0; width: 100%; min-height: 0; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; font-size: 11px; }
.subject-input textarea { min-width: 0; width: 100%; min-height: 32px; padding: 8px 0; border: 0; outline: 0; resize: vertical; background: transparent; box-shadow: none; font: inherit; font-size: 11px; }
.subject-input.multi-address { height: auto; min-height: 46px; align-items: flex-start; }
.subject-input.multi-address svg { margin-top: 10px; }
.subject-add .btn { min-height: 40px; border-radius: 9px; font-size: 10.5px; }
.subject-add-button { color: #fff; background: #5b50e6; box-shadow: 0 6px 16px rgba(91,80,230,.15); }
.subject-add-button:hover { background: #493ed0; }
.subject-checks { padding: 0 19px; }
.subject-checks:not(:empty) { padding-block: 13px; border-bottom: 1px solid #e9eae5; }
.subject-lag-note { display: flex; gap: 8px; margin: 0; padding: 10px 19px; border-bottom: 1px solid #f0e5cf; color: #8a6225; background: #fffaf0; font-size: 10px; line-height: 1.5; }
.subject-lag-note svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 1px; }

.subject-list { display: flex; flex-direction: column; gap: 12px; padding: 15px; background: #f7f8f5; }
.subject-card { min-width: 0; overflow: hidden; border: 1px solid #e1e2dc; border-radius: 15px; background: #fff; box-shadow: 0 1px 2px rgba(20,22,18,.025); }
.subject-card-head { min-height: 68px; display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid #ebebe7; }
.subject-card-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 11px; }
.subject-card-icon.address { color: #2563eb; background: #eaf1ff; }
.subject-card-icon.plate { color: #087054; background: #e9f6f0; }
.subject-card-icon svg { width: 15px; height: 15px; }
.subject-card-title { min-width: 0; flex: 1; }
.subject-card-title h3 { color: #30322d; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-card-title p { margin: 3px 0 0; color: #979a92; font-size: 9.5px; }
.subject-card-title .status-badge { margin-top: 4px; padding: 4px 7px; font-size: 9px; }
.subject-plate-number { display: flex; align-items: center; gap: 7px; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .05em; }
.subject-plate-number i { width: 3px; height: 3px; border-radius: 50%; background: #a8aba4; }
.subject-actions { display: flex; align-items: center; gap: 4px; }
.subject-actions form { margin: 0; }
.subject-text-action { min-height: 29px; padding: 0 9px; border: 1px solid #e3e4de; border-radius: 8px; color: #74776f; background: #fff; font-size: 9.5px; font-weight: 700; cursor: pointer; }
.subject-text-action:hover { color: #282a26; border-color: #ced0c8; }
.subject-text-action.danger { color: #b52e49; border-color: #f0dbe0; background: #fff8f9; }
.subject-check-note { display: flex; gap: 8px; margin: 0; padding: 9px 14px; border-bottom: 1px solid; font-size: 9.5px; line-height: 1.5; }
.subject-check-note svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 1px; }
.subject-check-note em { display: block; margin-top: 1px; opacity: .72; font-size: 9px; font-style: normal; }
.subject-check-note.ok { color: #166b4c; border-color: #d8eee4; background: #f0faf5; }
.subject-check-note.neutral { color: #656961; border-color: #e8e9e4; background: #fafaf8; }
.subject-check-note.warn { color: #8c6424; border-color: #f0e4ca; background: #fff9ed; }
.subject-empty { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; color: #999c94; text-align: center; }
.subject-empty.large { min-height: 190px; }
.subject-empty > svg { width: 23px; height: 23px; color: #bec1b9; }
.subject-empty p { margin: 8px 0 0; font-size: 10.5px; }
.coverage-unavailable { align-items: stretch; color: #72500d; background: var(--amber-soft); text-align: start; }
.coverage-unavailable > svg { align-self: center; }
.coverage-unavailable > p { align-self: center; max-width: 620px; text-align: center; }
.coverage-sources { width: 100%; display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.coverage-sources li { display: flex; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid #ead4a5; border-radius: 9px; background: rgba(255,255,255,.62); }
.coverage-sources div { display: grid; gap: 3px; }
.coverage-sources strong { color: var(--ink); font-size: 11px; }
.coverage-sources small { color: #72500d; font-size: 10px; line-height: 1.45; }
.coverage-sources a { align-self: center; white-space: nowrap; color: var(--accent); font-size: 10px; font-weight: 800; }
.subject-table-wrap { max-width: 100%; overflow-x: auto; direction: ltr; contain: inline-size; }
[dir="rtl"] .subject-table { direction: rtl; }
.subject-table { min-width: 720px; }
.subject-table thead th { height: 37px; padding-inline: 12px; color: #9a9d95; background: #fafaf8; font-size: 8.5px; letter-spacing: .06em; }
.subject-table td { height: 58px; padding: 9px 12px; font-size: 10.5px; }
.subject-table tbody tr:hover { background: #fafaff; }
.subject-table td strong { font-size: 10.5px; }
.subject-table td small { margin-top: 3px; }
.subject-table .mini-badge { padding: 2px 6px; font-size: 8.5px; }
.violation-table { min-width: 820px; }

.client-control-rail { position: sticky; top: 91px; display: flex; flex-direction: column; gap: 12px; }
.client-control-card { overflow: hidden; border: 1px solid #dedfd9; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.client-control-card > header { min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 15px 17px; border-bottom: 1px solid #e8e9e3; }
.control-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 11px; color: #5b50e6; background: #eeecff; }
.control-icon svg { width: 15px; height: 15px; }
.client-control-card header h2 { color: #30322d; font-size: 13px; }
.client-control-card header p { margin: 3px 0 0; color: #999c94; font-size: 9.5px; }
.client-control-form { display: flex; flex-direction: column; gap: 13px; padding: 17px; }
.client-control-form .field { margin: 0; }
.client-control-form label, .client-control-form .field-label { margin-bottom: 5px; color: #777a72; font-size: 9.5px; }
.client-control-form input[type="text"], .client-control-form input[type="email"], .client-control-form input[type="tel"] { min-height: 39px; padding: 8px 10px; border-color: #dedfd9; border-radius: 9px; background: #fbfbf9; font-size: 10.5px; }
.client-control-form .field > small { margin-top: 4px; font-size: 8.5px; }
.control-checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.control-checks label { position: relative; margin: 0; cursor: pointer; }
.control-checks input { position: absolute; opacity: 0; }
.control-checks span { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 7px; border: 1px solid #e0e1db; border-radius: 9px; color: #82857d; background: #fafaf8; font-size: 9.5px; font-weight: 650; }
.control-checks svg { width: 12px; height: 12px; }
.control-checks input:checked + span { color: #4f45c7; border-color: #cbc6fb; background: #f2f0ff; box-shadow: inset 0 0 0 1px #ddd9ff; }
.control-toggle { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; margin: 0; border-top: 1px solid #ecece7; border-bottom: 1px solid #ecece7; cursor: pointer; }
.control-toggle > span { display: flex; flex-direction: column; }
.control-toggle strong { color: #454842; font-size: 10.5px; }
.control-toggle small { margin-top: 2px; color: #9a9d95; font-size: 8.5px; }
.control-toggle input { position: absolute; opacity: 0; }
.control-toggle i { width: 35px; height: 20px; flex: 0 0 35px; position: relative; border-radius: 99px; background: #cfd1ca; transition: .2s; }
.control-toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s; }
.control-toggle input:checked + i { background: #5b50e6; }
.control-toggle input:checked + i::after { transform: translateX(15px); }
[dir="rtl"] .control-toggle input:checked + i::after { transform: translateX(-15px); }
.client-save { width: 100%; min-height: 40px; border-radius: 9px; color: #fff; background: #171816; box-shadow: 0 6px 16px rgba(23,24,22,.12); font-size: 10.5px; }
.client-save:hover { background: #2c2e2a; }

.client-danger-card { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; padding: 15px; border: 1px solid #efdadd; border-radius: 16px; background: #fffafa; }
.danger-card-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #bd3651; background: #fff0f3; }
.danger-card-icon svg { width: 14px; height: 14px; }
.client-danger-card h2 { color: #a82d45; font-size: 11px; }
.client-danger-card p { margin: 3px 0 0; color: #a88b91; font-size: 8.5px; line-height: 1.45; }
.client-danger-card form { grid-column: 1 / -1; }
.client-danger-card button { width: 100%; min-height: 34px; border: 1px solid #efcfd6; border-radius: 8px; color: #b52f49; background: #fff; font-size: 9.5px; font-weight: 700; cursor: pointer; }
.client-danger-card button:hover { background: #fff1f4; }

@media (prefers-reduced-motion: no-preference) {
  .client-profile-hero, .client-stat-grid, .subject-section, .client-control-card { animation: client-enter .38s cubic-bezier(.2,.75,.25,1) both; }
  .client-stat-grid { animation-delay: .04s; }
  .client-workspace-grid > * { animation-delay: .08s; }
  @keyframes client-enter { from { opacity: 0; transform: translateY(7px); } }
}

@media (max-width: 1120px) {
  .client-workspace-grid { grid-template-columns: minmax(0,1fr) 285px; }
  .client-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .client-workspace-grid { grid-template-columns: 1fr; }
  .client-control-rail { position: static; display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,.55fr); align-items: start; order: -1; }
  .client-control-card { grid-row: span 2; }
}

@media (max-width: 680px) {
  .client-profile-hero { align-items: flex-start; flex-direction: column; padding: 23px; }
  .client-profile-avatar { width: 58px; height: 58px; flex-basis: 58px; border-radius: 17px; font-size: 20px; }
  .client-profile-main h1 { white-space: normal; }
  .client-profile-meta { width: 100%; min-width: 0; align-items: flex-start; padding-top: 14px; border-top: 1px solid #e8e9e3; }
  .client-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .client-stat-grid article { align-items: flex-start; padding: 14px; }
  .client-stat-grid article > div { display: flex; flex-direction: column; align-items: flex-start; }
  .subject-add { align-items: stretch; flex-direction: column; }
  .subject-add .btn { width: 100%; }
  .subject-card-head { align-items: flex-start; flex-wrap: wrap; }
  .subject-actions { width: 100%; justify-content: flex-end; padding-top: 7px; border-top: 1px solid #ecece7; }
  .client-control-rail { display: flex; align-items: stretch; order: 0; }
}

@media (max-width: 430px) {
  .client-profile-hero { padding: 19px; }
  .client-profile-main { align-items: flex-start; flex-direction: column; }
  .client-stat-grid article { min-height: 116px; flex-direction: column; }
  .subject-section-head, .subject-add { padding-inline: 14px; }
  .subject-list { padding: 10px; }
}
