/* =========================================================================
   DESIGN TOKENS — Maroska calm red (replaces the old bright #E30613)
   ========================================================================= */
:root {
  --brand: #B23A3F;
  --brand-hover: #962F34;
  --brand-strong: #7A2629;
  --brand-soft: #F8ECEC;
  --brand-tint: rgba(178, 58, 63, 0.08);
  --brand-ring: rgba(178, 58, 63, 0.22);
  --brand-grad: linear-gradient(150deg, #B23A3F 0%, #8E2F33 55%, #5E1F22 100%);

  --bg-page: #F6F6F8;
  --surface: #FFFFFF;
  --surface-alt: #FAFAFB;
  --surface-muted: #F2F2F5;
  --border: #E4E4E9;
  --border-soft: #EDEDF1;
  --text-primary: #1D1B20;
  --text-secondary: #6B6870;
  --text-muted: #9C99A2;

  --success: #2F7D4F; --success-soft: #E4F3EA;
  --warning: #A86512; --warning-soft: #FBF0DF;
  --danger:  #B23A3F; --danger-soft:  #F8E6E7;
  --info:    #3B5B8C; --info-soft:    #E6EDF7;
  --neutral: #5E5B63; --neutral-soft: #EFEFF2;

  --cad-bg: #FFFFFF; --cad-wall: #2B2A30; --cad-text: #1D1B20;
  --shadow-xs: 0 1px 2px rgba(29, 27, 32, 0.05);
  --shadow-sm: 0 2px 10px rgba(29, 27, 32, 0.06);
  --shadow-md: 0 14px 32px rgba(29, 27, 32, 0.12);
  --radius-card: 16px;
  --radius-pill: 999px;
}
[data-theme="dark"] {
  --brand: #D7686C; --brand-hover: #E3878A; --brand-strong: #F0A9AB;
  --brand-soft: rgba(215, 104, 108, 0.14); --brand-tint: rgba(215, 104, 108, 0.10); --brand-ring: rgba(215, 104, 108, 0.30);
  --brand-grad: linear-gradient(150deg, #7A2629 0%, #4A1A1C 60%, #1A1214 100%);
  --bg-page: #121014; --surface: #1B191E; --surface-alt: #211F25; --surface-muted: #28252C;
  --border: #34313A; --border-soft: #2B2830; --text-primary: #F4F2F5; --text-secondary: #A9A5AE; --text-muted: #75717B;
  --success: #6BC08F; --success-soft: rgba(107,192,143,0.14);
  --warning: #E0A659; --warning-soft: rgba(224,166,89,0.15);
  --danger:  #E58A8D; --danger-soft:  rgba(229,138,141,0.15);
  --info:    #8FB0E0; --info-soft:    rgba(143,176,224,0.14);
  --neutral: #B3AFB8; --neutral-soft: #2B2830;
  --cad-bg: #17151A; --cad-wall: #E9E6EC; --cad-text: #F4F2F5;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.35); --shadow-sm: 0 2px 10px rgba(0,0,0,0.45); --shadow-md: 0 14px 32px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Cairo', system-ui, sans-serif; background: var(--bg-page); color: var(--text-primary); min-height: 100vh; line-height: 1.55; overflow-x: hidden; }
html[lang="en"] body { font-family: 'Inter', system-ui, sans-serif; }
button, input, select, textarea { font-family: inherit; }
.ico { width: 18px; height: 18px; display: inline-block; flex-shrink: 0; fill: currentColor; vertical-align: middle; }
.ico-xs { width: 14px; height: 14px; } .ico-sm { width: 16px; height: 16px; } .ico-lg { width: 24px; height: 24px; } .ico-xl { width: 34px; height: 34px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--text-secondary); }
.logo-light { display: block; } .logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; } [data-theme="dark"] .logo-dark { display: block; }

/* B1 buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13.5px; font-weight: 700; height: 40px; padding: 0 18px; border-radius: var(--radius-pill); border: 1px solid transparent; cursor: pointer; transition: background .15s, box-shadow .15s, border-color .15s, color .15s; white-space: nowrap; text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 2px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 6px 16px var(--brand-ring); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); box-shadow: var(--shadow-sm); }
.btn-secondary.is-on { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.btn-tertiary { background: transparent; color: var(--brand); padding: 0 8px; height: 32px; }
.btn-tertiary:hover { background: var(--brand-tint); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { background: var(--surface-muted); color: var(--text-muted); box-shadow: none; cursor: not-allowed; }

/* B4 icon buttons */
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--surface-muted); color: var(--text-secondary); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { color: var(--brand); background: var(--brand-tint); }
.icon-btn .dot { position: absolute; top: 9px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface-muted); }
.icon-btn .count { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.nodot::before { display: none; }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.pill-danger  { background: var(--danger-soft);  color: var(--danger); }
.pill-info    { background: var(--info-soft);    color: var(--info); }
.pill-neutral { background: var(--neutral-soft); color: var(--neutral); }
.pill-brand   { background: var(--brand-soft);   color: var(--brand); }

.root-page { display: none; min-height: 100vh; }
.root-page.active { display: block; }
#appWrap.active, #ownerWrap.active { display: flex; }

/* =========================================================================
   LANDING
   ========================================================================= */
#landingPage { background: radial-gradient(circle at 10% 10%, var(--brand-tint) 0%, transparent 38%), radial-gradient(circle at 90% 30%, rgba(178,58,63,0.05) 0%, transparent 40%), var(--bg-page); }
.land-nav { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-soft); padding: 10px 32px; display: flex; align-items: center; justify-content: space-between; gap: 14px; position: sticky; top: 0; z-index: 35; }
.land-nav img { height: 40px; width: auto; }
.land-links { display: flex; gap: 24px; }
.land-links a { text-decoration: none; color: var(--text-secondary); font-size: 13.5px; font-weight: 700; }
.land-links a:hover { color: var(--brand); }
@media (max-width: 860px) { .land-links { display: none; } .land-nav { padding: 10px 14px; } .land-nav img { height: 32px; } }
.land-container { max-width: 1160px; margin: 0 auto; padding: 46px 24px 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; margin-bottom: 64px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .land-container { padding: 26px 16px 56px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-soft); padding: 6px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--brand); box-shadow: var(--shadow-xs); }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.hero-title { font-size: 44px; font-weight: 800; line-height: 1.18; margin: 18px 0 16px; letter-spacing: -0.3px; }
.hero-title .accent { color: var(--brand); }
@media (max-width: 600px) { .hero-title { font-size: 30px; } }
.hero-desc { font-size: 15.5px; color: var(--text-secondary); margin-bottom: 26px; max-width: 540px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 18px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust .ico { color: var(--success); }


.sec-head { text-align: center; max-width: 620px; margin: 0 auto 26px; }
.sec-head .tag { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--brand); }
.sec-head h2 { font-size: 30px; font-weight: 800; margin: 4px 0 6px; }
.sec-head p { color: var(--text-secondary); font-size: 14px; }

.support-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; }
@media (max-width: 820px) { .support-grid { grid-template-columns: 1fr; } }
.support-card { background: var(--surface); border-radius: 22px; padding: 26px; border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); }
.contact-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; text-decoration: none; color: var(--text-primary); }
.contact-row:hover { border-color: var(--brand); background: var(--brand-tint); }
.contact-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.trial-card { background: var(--brand-grad); color: #fff; border-radius: 22px; padding: 28px 26px; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 18px 40px rgba(122,38,41,0.25); }
.trial-ring { width: 108px; height: 108px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.85); display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 16px 0; }
.trial-ring strong { font-size: 32px; line-height: 1; font-weight: 800; }
.trial-list { list-style: none; text-align: start; width: 100%; max-width: 320px; margin-bottom: 20px; font-size: 13px; }
.trial-list li { display: flex; gap: 8px; margin-bottom: 8px; opacity: .95; }
.btn-white { background: #fff; color: var(--brand-strong); }
.btn-white:hover { background: #F7EDEE; }
[data-theme="dark"] .btn-white { color: #7A2629; }

/* =========================================================================
   LOGIN
   ========================================================================= */
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-brand { background: var(--brand-grad); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; position: relative; overflow: hidden; }
.login-brand::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.10); inset-inline-end: -180px; bottom: -200px; box-shadow: 0 0 0 60px rgba(255,255,255,0.03), 0 0 0 130px rgba(255,255,255,0.02); }
.login-brand img.lb-logo { height: 54px; width: auto; align-self: flex-start; }
.login-brand h1 { font-size: 32px; font-weight: 800; line-height: 1.3; margin-bottom: 12px; max-width: 480px; }
.login-brand p { font-size: 14.5px; opacity: .85; max-width: 470px; }
.lb-points { display: grid; gap: 12px; margin-top: 26px; max-width: 460px; position: relative; z-index: 1; }
.lb-point { display: flex; gap: 12px; align-items: flex-start; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); border-radius: 14px; padding: 12px 14px; }
.lb-point .lb-ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,0.14); display: grid; place-items: center; flex-shrink: 0; }
.lb-point strong { display: block; font-size: 13.5px; }
.lb-point span { font-size: 12px; opacity: .8; }
.lb-foot { font-size: 12px; opacity: .7; position: relative; z-index: 1; }
.login-form-pane { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 76px 24px 32px; position: relative; background: var(--bg-page); }
.login-top { position: absolute; top: 18px; inset-inline: 22px; display: flex; justify-content: space-between; align-items: center; }
.login-card { width: 100%; max-width: 420px; }
.login-card .lc-logo { height: 46px; margin: 0 auto 20px; display: none; }
.login-card h2 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.login-card > p { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-secondary); font-weight: 600; margin-bottom: 6px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .lead { position: absolute; inset-inline-start: 14px; color: var(--text-muted); pointer-events: none; }
.input-wrap .f2-input { padding-inline-start: 42px; }
.input-wrap .trail { position: absolute; inset-inline-end: 6px; width: 34px; height: 34px; border: none; background: none; color: var(--text-muted); border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.input-wrap .trail:hover { color: var(--brand); }
.f2-input { width: 100%; height: 44px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid transparent; background: var(--surface-muted); font-size: 14px; color: var(--text-primary); outline: none; transition: border-color .15s, background .15s; }
textarea.f2-input { height: auto; min-height: 84px; padding: 12px 16px; border-radius: 12px; resize: vertical; }
select.f2-input { cursor: pointer; }
.f2-input:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-secondary); font-weight: 600; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 12px; margin: 20px 0 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card .lc-logo.logo-light { display: block; }
  [data-theme="dark"] .login-card .lc-logo.logo-light { display: none; }
  [data-theme="dark"] .login-card .lc-logo.logo-dark { display: block; }
  .login-card h2, .login-card > p { text-align: center; }
}

/* =========================================================================
   APP SHELL — sidebar, top bar
   ========================================================================= */
.sidebar { width: 252px; background: var(--surface); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: fixed; top: 0; bottom: 0; z-index: 50; transition: transform .24s ease; inset-inline-start: 0; border-inline-end: 1px solid var(--border-soft); overflow-y: auto; }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-inline-start: 252px; }
.sb-brand { padding: 2px 8px 14px; border-bottom: 1px solid var(--border-soft); margin-bottom: 10px; }
.sb-brand img { height: 38px; width: auto; }
.sb-tenant { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-alt); border: 1px solid var(--border-soft); margin-bottom: 10px; }
.sb-tenant .t-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.sb-tenant .t-logo img { width: 100%; height: 100%; object-fit: contain; }
.sb-tenant strong { display: block; font-size: 12.5px; line-height: 1.3; }
.sb-tenant span { font-size: 11px; color: var(--text-secondary); }
.sb-label { font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 10px 12px 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: none; background: transparent; width: 100%; font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer; text-align: start; }
.nav-item:hover { background: var(--surface-muted); color: var(--text-primary); }
.nav-item.active { background: var(--brand-tint); color: var(--brand); font-weight: 700; }
.sb-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); display: grid; gap: 6px; }
.drawer-backdrop { display: none; position: fixed; inset: 0; background: rgba(20, 16, 18, 0.5); z-index: 45; }
.drawer-backdrop.open { display: block; }
@media (max-width: 960px) {
  .sidebar { width: 84%; max-width: 320px; transform: translateX(-100%); box-shadow: var(--shadow-md); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open, html[dir="rtl"] .sidebar.open { transform: translateX(0); }
  .main-area { margin: 0; }
}

.topbar { background: var(--surface); border-bottom: 1px solid var(--border-soft); padding: 10px 22px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 30; }
.hamburger { display: none; }
@media (max-width: 960px) { .hamburger { display: inline-grid; } }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.crumbs span { color: var(--text-muted); }
.crumbs strong { font-weight: 700; }
html[dir="rtl"] .crumbs .ico { transform: scaleX(-1); }
.search-pill { flex: 1; max-width: 380px; height: 40px; background: var(--surface-muted); border-radius: var(--radius-pill); display: flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--text-muted); margin-inline-start: auto; }
.search-pill input { border: none; outline: none; background: transparent; width: 100%; font-size: 13.5px; color: var(--text-primary); }
.profile-wrap { position: relative; }
.profile-chip { display: flex; align-items: center; gap: 10px; padding: 4px; padding-inline-end: 10px; background: transparent; border: none; border-radius: var(--radius-pill); cursor: pointer; color: var(--text-primary); }
.profile-chip:hover { background: var(--surface-muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.profile-meta { text-align: start; line-height: 1.25; }
.profile-meta strong { display: block; font-size: 13px; }
.profile-meta span { font-size: 11px; color: var(--text-secondary); }
@media (max-width: 760px) { .profile-meta, .profile-chip > .ico, .crumbs { display: none; } .topbar { padding: 10px 12px; gap: 8px; } .search-pill { margin-inline-start: 0; } }
.profile-menu { position: absolute; top: 50px; inset-inline-end: 0; width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-md); padding: 8px; display: none; z-index: 60; }
.profile-menu.open { display: block; }
.pm-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: pointer; }
.pm-item:hover { background: var(--surface-muted); }
.pm-item.danger { color: var(--danger); }
.switch { width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; flex-shrink: 0; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; }
.switch.on { background: var(--brand); }
.switch.on::after { inset-inline-start: 19px; }

.page-body { padding: 22px 24px 48px; width: 100%; max-width: 1320px; margin: 0 auto; }
@media (max-width: 640px) { .page-body { padding: 16px 12px 40px; } }
.view, .oview { display: none; }
.view.active, .oview.active { display: block; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-title { font-size: 24px; font-weight: 800; line-height: 1.25; }
.page-sub { font-size: 13.5px; color: var(--text-secondary); margin-top: 2px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.surface-card { background: var(--surface); border-radius: var(--radius-card); border: 1px solid var(--border-soft); box-shadow: var(--shadow-xs); padding: 18px; }
.card-title { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.stack { display: grid; gap: 16px; }

/* =========================================================================
   DASHBOARD — company profile card, interactive KPI cards, filters
   ========================================================================= */
.dash-layout { display: flex; gap: 18px; align-items: flex-start; }
.dash-main { flex: 1; min-width: 0; display: grid; gap: 16px; }

.company-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 18px; box-shadow: var(--shadow-xs); display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 18px 20px; }
.company-card::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--brand); }
.cc-logo { width: 72px; height: 72px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; overflow: hidden; font-weight: 800; font-size: 22px; }
.cc-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.cc-tag { font-size: 11.5px; font-weight: 700; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.cc-name { font-size: 18px; font-weight: 800; line-height: 1.3; margin: 2px 0 8px; }
.cc-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text-secondary); }
.cc-facts span { display: inline-flex; align-items: center; gap: 6px; }
.cc-facts b { color: var(--text-primary); font-weight: 700; }
.cc-actions { display: grid; gap: 8px; justify-items: end; }
.cc-note { font-size: 11.5px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 860px) { .company-card { grid-template-columns: auto 1fr; } .cc-actions { grid-column: 1 / -1; justify-items: stretch; grid-template-columns: 1fr 1fr; } .cc-note { grid-column: 1 / -1; } }
@media (max-width: 480px) { .cc-logo { width: 56px; height: 56px; } .cc-name { font-size: 16px; } }

.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi { position: relative; text-align: start; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 16px; padding: 16px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; color: var(--text-primary); display: flex; flex-direction: column; gap: 10px; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.kpi-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.kpi-value small { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.kpi-bar { height: 6px; border-radius: 6px; background: var(--surface-muted); overflow: hidden; }
.kpi-bar i { display: block; height: 100%; border-radius: 6px; background: var(--brand); transition: width .4s ease; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }
.kpi-foot .more { color: var(--brand); font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
html[dir="rtl"] .kpi-foot .more .ico { transform: scaleX(-1); }
.tone-brand   .kpi-ico { background: var(--brand-soft);   color: var(--brand); }
.tone-success .kpi-ico { background: var(--success-soft); color: var(--success); }  .tone-success .kpi-bar i { background: var(--success); }
.tone-warning .kpi-ico { background: var(--warning-soft); color: var(--warning); }  .tone-warning .kpi-bar i { background: var(--warning); }
.tone-info    .kpi-ico { background: var(--info-soft);    color: var(--info); }     .tone-info .kpi-bar i { background: var(--info); }
.tone-danger  .kpi-ico { background: var(--danger-soft);  color: var(--danger); }   .tone-danger .kpi-bar i { background: var(--danger); }

.drill { display: none; }
.drill.open { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.dash-two { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .dash-two { grid-template-columns: minmax(0, 1fr); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--text-primary); cursor: pointer; }
.legend button i { width: 9px; height: 9px; border-radius: 50%; }
.legend button.off { opacity: .45; text-decoration: line-through; }
.visit-list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.visit-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; cursor: pointer; }
.visit-row:hover { border-color: var(--brand); background: var(--brand-tint); }
.visit-date { width: 46px; text-align: center; border-radius: 10px; background: var(--surface-muted); padding: 4px 0; flex-shrink: 0; }
.visit-date strong { display: block; font-size: 16px; line-height: 1.1; }
.visit-date span { font-size: 10.5px; color: var(--text-secondary); }
.visit-row .grow { flex: 1; min-width: 0; }
.visit-row .grow strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-row .grow span { font-size: 11.5px; color: var(--text-secondary); }

.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.info-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; text-align: start; color: var(--text-primary); }
.info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.info-card-head { background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-align: center; padding: 7px 10px; }
.info-card-head.alt { background: #5E5B63; }
.info-card-body { padding: 14px 16px 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; flex: 1; }
.info-card-body .ico { color: var(--brand); width: 38px; height: 38px; grid-row: span 2; }
.info-card-head.alt + .info-card-body .ico { color: #5E5B63; }
[data-theme="dark"] .info-card-head.alt + .info-card-body .ico { color: var(--neutral); }
.info-card-body h3 { font-size: 14.5px; font-weight: 800; line-height: 1.3; }
.info-card-body p { font-size: 12px; color: var(--text-secondary); grid-column: 2; }

/* FL5 filter trigger + chips */
.chip-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.chip-row::-webkit-scrollbar { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-size: 12px; font-weight: 700; white-space: nowrap; border: none; cursor: pointer; }
html[dir="rtl"] .fchip { padding: 5px 12px 5px 8px; }
.fchip .x { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,0.06); }
.filters-bar { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.filters-bar .chip-row { flex: 1; }

/* FL5 panel: desktop side panel, mobile bottom sheet */
.filter-panel { width: 300px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 16px; box-shadow: var(--shadow-sm); display: none; flex-direction: column; position: sticky; top: 76px; max-height: calc(100vh - 96px); }
.filter-panel.open { display: flex; }
.fp-handle { display: none; width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 10px auto 0; }
.fp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border-soft); }
.fp-head strong { font-size: 15px; }
.fp-body { overflow-y: auto; flex: 1; }
.fgroup { border-bottom: 1px solid var(--border-soft); }
.fgroup-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: none; border: none; cursor: pointer; text-align: start; color: var(--text-primary); }
.fgroup-btn strong { display: block; font-size: 13.5px; font-weight: 700; }
.fgroup-btn span { font-size: 12px; color: var(--brand); font-weight: 600; }
.fgroup-btn .ico { color: var(--text-muted); transition: transform .2s; }
.fgroup.open .fgroup-btn .ico { transform: rotate(180deg); }
.fgroup-opts { display: none; padding: 0 16px 12px; gap: 4px; }
.fgroup.open .fgroup-opts { display: grid; }
.fopt { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.fopt:hover { background: var(--surface-muted); }
.fopt input { accent-color: var(--brand); width: 16px; height: 16px; }
.fp-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border-soft); }
.fp-backdrop { display: none; }
@media (max-width: 960px) {
  .filter-panel { position: fixed; inset: auto 0 0 0; width: 100%; max-height: 82vh; border-radius: 22px 22px 0 0; z-index: 80; box-shadow: var(--shadow-md); transform: translateY(100%); transition: transform .25s ease, visibility .25s; display: flex; top: auto; visibility: hidden; }
  .filter-panel.open { transform: translateY(0); visibility: visible; }
  .fp-handle { display: block; }
  .fp-head { justify-content: center; position: relative; }
  .fp-head .icon-btn { position: absolute; inset-inline-end: 12px; }
  .fp-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(20,16,18,0.45); z-index: 75; }
}

/* T1 table */
.t1-wrap { overflow-x: auto; }
table.t1 { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t1 th { text-align: start; padding: 10px 12px; color: var(--text-secondary); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t1 td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; color: var(--text-secondary); }
table.t1 td.name { color: var(--text-primary); font-weight: 700; }
table.t1 tr:last-child td { border-bottom: none; }
table.t1 tbody tr:hover td { background: var(--surface-alt); }
.empty { text-align: center; padding: 26px 12px; color: var(--text-muted); font-size: 13px; }

/* Company profile page (F2) */
.f2-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .f2-layout { grid-template-columns: 1fr; } }
.f2-section { border: 1px solid var(--border-soft); border-radius: 12px; padding: 16px; background: var(--surface); }
.f2-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.f2-section h3 .ico { color: var(--brand); }
.f2-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .f2-grid { grid-template-columns: 1fr; } }
.req { color: var(--danger); }
.logo-drop { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1.5px dashed var(--border); border-radius: 14px; }
.logo-drop .cc-logo { width: 64px; height: 64px; }
.summary { position: sticky; top: 76px; display: grid; gap: 14px; }
.kv { background: var(--surface-alt); border-radius: 12px; padding: 6px 14px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-row span { color: var(--text-secondary); display: inline-flex; gap: 6px; align-items: center; }
.kv-row b { text-align: end; font-weight: 700; word-break: break-word; }
.tip { display: flex; gap: 12px; background: var(--brand-tint); border-radius: 12px; padding: 12px; font-size: 12.5px; }
.tip .ti { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.tip strong { display: block; font-size: 13px; }
@media (max-width: 1100px) { .summary { position: static; } }

/* Report header (shared by all client reports) */
.report-head { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; color: #1D1B20; }
.rh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 3px solid #B23A3F; }
.rh-top img { height: 40px; max-width: 120px; object-fit: contain; }
.rh-top .rh-logo-txt { width: 40px; height: 40px; border-radius: 10px; background: #F8ECEC; color: #B23A3F; display: grid; place-items: center; font-weight: 800; }
.rh-name { font-weight: 800; font-size: 13.5px; line-height: 1.3; }
.rh-meta { font-size: 10.5px; color: #6B6870; }
.rh-body { padding: 10px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 11px; color: #6B6870; }
.rh-body b { color: #1D1B20; }
.rh-foot { background: #FAFAFB; padding: 7px 14px; font-size: 10.5px; color: #6B6870; border-top: 1px solid #EDEDF1; }

/* Clients */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.client-card { background: var(--surface); border-radius: var(--radius-card); border: 1px solid var(--border-soft); box-shadow: var(--shadow-xs); overflow: hidden; display: flex; flex-direction: column; }
.client-card-top { padding: 14px 16px 12px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.client-card-top strong { font-size: 14.5px; line-height: 1.35; }
.client-card-mid { padding: 12px 16px; flex: 1; font-size: 12.5px; color: var(--text-secondary); display: grid; gap: 8px; }
.scope-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.client-card-foot { padding: 10px 16px; background: var(--surface-alt); border-top: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { background: none; border: none; padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.sub-view { display: none; }
.sub-view.active { display: block; }

.stations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.qr-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-card); padding: 14px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 10px; }
.qr-label { background: #fff; color: #1D1B20; border: 1.5px dashed #D9D6DD; border-radius: 12px; padding: 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qr-label .ql-brand { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; color: #B23A3F; }
.qr-label .ql-brand img { width: 18px; height: 18px; object-fit: contain; }

.cad-shell { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--cad-bg); }
.cad-toolbar { background: var(--surface-alt); border-bottom: 1px solid var(--border); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.cad-selbar { background: var(--brand-tint); border-bottom: 1px solid var(--border); padding: 8px 12px; display: none; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cad-selbar.show { display: flex; }
.tchip { height: 32px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); font-size: 12px; font-weight: 700; color: var(--text-primary); cursor: pointer; }
.tchip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
svg#cadSvg { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 600; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.perm-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-alt); font-size: 12.5px; font-weight: 600; cursor: pointer; }

/* Dialogs: D1 center modal desktop, D4 full screen mobile */
.dlg-backdrop { display: none; position: fixed; inset: 0; background: rgba(20,16,18,0.55); z-index: 90; align-items: center; justify-content: center; padding: 16px; }
.dlg-backdrop.open { display: flex; }
.dlg { width: 100%; max-width: 520px; max-height: 92vh; background: var(--surface); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-md); }
.dlg-head { padding: 16px 20px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dlg-head strong { font-size: 16px; }
.dlg-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.dlg-foot { padding: 12px 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 10px; }
.dlg-m-cancel, .dlg-m-save { display: none; background: none; border: none; font-size: 15px; font-weight: 700; cursor: pointer; }
.dlg-m-cancel { color: var(--text-secondary); } .dlg-m-save { color: var(--brand); }
@media (max-width: 600px) {
  .dlg-backdrop { padding: 0; }
  .dlg { max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; background: var(--bg-page); }
  .dlg-head { background: var(--surface); }
  .dlg-head .icon-btn, .dlg-foot { display: none; }
  .dlg-m-cancel, .dlg-m-save { display: inline-block; }
  .dlg-head strong { flex: 1; text-align: center; }
}
.scanner-box { background: #1D1B20; border-radius: 16px; padding: 20px 14px; text-align: center; color: #fff; margin-bottom: 12px; }
.scanner-frame { width: 150px; height: 150px; margin: 0 auto 10px; position: relative; border: 2px solid rgba(215,104,108,0.6); border-radius: 14px; }
.scanner-laser { position: absolute; left: 8px; right: 8px; height: 2px; background: #D7686C; box-shadow: 0 0 12px #D7686C; animation: scanLine 1.8s infinite ease-in-out; }
@keyframes scanLine { 0%,100% { top: 12px; } 50% { top: 134px; } }
.opt-list { display: grid; gap: 8px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1D1B20; color: #fff; padding: 11px 20px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; z-index: 150; display: none; box-shadow: var(--shadow-md); max-width: calc(100% - 32px); text-align: center; }
.toast.success { background: var(--success); } .toast.danger { background: #8E2F33; }
[data-theme="dark"] .toast.success { background: #2F7D4F; }
/* =========================================================================
   LANDING — vector illustration, animations, feature list, flow
   ========================================================================= */
.hero-art { position: relative; }
.hero-svg { width: 100%; max-width: 540px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.hero-svg * { transform-box: fill-box; transform-origin: center; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dashMove { to { stroke-dashoffset: -60; } }
@keyframes scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(54px); } }
@keyframes ring { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes pop { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.18); } }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.anim-float { animation: floatY 5s ease-in-out infinite; }
.anim-float.d2 { animation-delay: -1.2s; } .anim-float.d3 { animation-delay: -2.4s; animation-duration: 6s; } .anim-float.d4 { animation-delay: -3.3s; animation-duration: 4.4s; }
.anim-breathe { animation: breathe 7s ease-in-out infinite; } .anim-breathe.d2 { animation-delay: -3s; }
.anim-spin { animation: spin 80s linear infinite; }
.anim-dash { animation: dashMove 2.4s linear infinite; }
.anim-scan { animation: scan 2.6s ease-in-out infinite; transform-box: view-box !important; }
.anim-ring { animation: ring 2.4s ease-out infinite; }
.anim-pop { animation: pop 3.2s ease-in-out infinite; } .anim-pop.d3 { animation-delay: -1.6s; }
.anim-twinkle { animation: twinkle 3s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .hero-svg *, .reveal { animation: none !important; transition: none !important; } }

.land-sec { margin-bottom: 72px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.feat-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 40px; max-width: 1040px; margin: 0 auto; }
@media (max-width: 900px) { .feat-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feat-list { grid-template-columns: 1fr; gap: 24px; } }
.feat { display: flex; gap: 16px; align-items: flex-start; }
.feat-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; position: relative; transition: transform .25s ease; }
.feat-ico::after { content: ''; position: absolute; inset: -6px; border-radius: 22px; border: 1.5px dashed var(--brand-ring); opacity: 0; transition: opacity .25s; }
.feat:hover .feat-ico { transform: translateY(-4px) rotate(-6deg); }
.feat:hover .feat-ico::after { opacity: 1; }
.feat h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.feat p { font-size: 13.5px; color: var(--text-secondary); }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; position: relative; max-width: 1040px; margin: 0 auto; }
.flow::before { content: ''; position: absolute; top: 36px; inset-inline: 12%; height: 2px; background-image: linear-gradient(90deg, var(--brand) 50%, transparent 50%); background-size: 14px 2px; animation: flowLine 1.2s linear infinite; opacity: .5; }
@keyframes flowLine { to { background-position: 14px 0; } }
.flow-step { text-align: center; position: relative; padding: 0 6px; }
.flow-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; position: relative; box-shadow: 0 0 0 8px var(--bg-page); }
.flow-ico b { position: absolute; top: -4px; inset-inline-end: -4px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; display: grid; place-items: center; }
.flow-step h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.flow-step p { font-size: 12.5px; color: var(--text-secondary); }
@media (max-width: 820px) { .flow { grid-template-columns: 1fr 1fr; gap: 26px 14px; } .flow::before { display: none; } }

/* =========================================================================
   VISIT WORKFLOW (technician) + CLIENT PORTAL + EMAIL PREVIEW
   ========================================================================= */
.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 18px; }
.step:not(:last-child)::before { content: ''; position: absolute; top: 40px; bottom: 0; inset-inline-start: 19px; width: 2px; background: var(--border); }
.step.done:not(:last-child)::before { background: var(--success); }
.step-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-muted); color: var(--text-muted); font-weight: 800; z-index: 1; }
.step.done .step-dot { background: var(--success); color: #fff; }
.step.current .step-dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 6px var(--brand-tint); }
.step.blocked .step-dot { background: var(--danger-soft); color: var(--danger); }
.step h4 { font-size: 14.5px; font-weight: 700; margin-top: 2px; }
.step p { font-size: 12.5px; color: var(--text-secondary); overflow-wrap: anywhere; }
.step .step-body { display: grid; gap: 8px; }
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; }
.notice .ico { margin-top: 1px; }
.notice.warn { background: var(--warning-soft); color: var(--warning); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--success-soft); color: var(--success); }
.notice.info { background: var(--info-soft); color: var(--info); }
.notice b { color: inherit; }
.progress { height: 8px; border-radius: 8px; background: var(--surface-muted); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--success); border-radius: 8px; transition: width .4s; }

#clientWrap.active { display: block; }
.portal-top { background: var(--surface); border-bottom: 1px solid var(--border-soft); padding: 10px 24px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; }
.portal-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.portal-brand .cc-logo { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }
.portal-brand strong { display: block; font-size: 14px; line-height: 1.3; }
.portal-brand span { font-size: 11.5px; color: var(--text-secondary); }
.portal-body { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; display: grid; gap: 16px; }
@media (max-width: 640px) { .portal-top { padding: 10px 12px; } .portal-body { padding: 16px 12px 48px; } }
.ack-card { border: 1.5px solid var(--brand); background: var(--surface); border-radius: 18px; padding: 18px; box-shadow: 0 0 0 4px var(--brand-tint); display: grid; gap: 14px; }
.ack-card.ok { border-color: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.ack-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ack-actions .btn { flex: 1; min-width: 200px; }
.visit-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 720px) { .visit-meta { grid-template-columns: 1fr 1fr; } }
.visit-meta div { background: var(--surface-alt); border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 12px; }
.visit-meta small { display: block; font-size: 11.5px; color: var(--text-secondary); }
.visit-meta b { font-size: 13.5px; }

.email-mock { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.em-head { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; display: grid; gap: 4px; background: var(--surface-alt); }
.em-head span { color: var(--text-secondary); }
.em-body { padding: 14px; display: grid; gap: 12px; font-size: 13px; }
.portal-body, .ack-card, .stack, .dash-main, .em-body, .step-body { grid-template-columns: minmax(0, 1fr); }
.rh-meta, .em-head { overflow-wrap: anywhere; }
