/* Lishka inquiries — crm-fixmedia design language (Petrol Blue + Heebo) */

:root {
  --primary: #0d6577;
  --primary-hover: #0a5262;
  --primary-light: #e6f3f5;
  --accent: #10b981;
  --destructive: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --success: #22c55e;
  --muted: #f1f5f9;
  --muted-fg: #64748b;
  --bg: #f8fafc;
  --fg: #0f172a;
  --card: #ffffff;
  --border: #e2e8f0;
  --sidebar: #0d6577;
  --sidebar-hover: #0a5262;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 14px rgba(15,23,42,.10);
  --r-md: .5rem; --r-lg: .75rem; --r-xl: 1rem;
}
.dark {
  --bg: #0f172a;
  --fg: #f8fafc;
  --card: #1e293b;
  --border: #334155;
  --muted: #334155;
  --muted-fg: #94a3b8;
  --primary-light: #1a4d5a;
  --sidebar: #0a4a58;
  --sidebar-hover: #085463;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0;
    transition: background-color .2s ease-in-out, border-color .2s ease-in-out; }
html { direction: rtl; }
body { font-family: 'Heebo', system-ui, sans-serif; background: var(--bg); color: var(--fg); min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--muted); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
svg.ico { width: 20px; height: 20px; stroke: currentColor; fill: none;
          stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ===== Layout: fixed right sidebar ===== */
.sidebar { position: fixed; top: 0; right: 0; bottom: 0; width: 16rem;
           background: var(--sidebar); color: #fff; display: flex; flex-direction: column; z-index: 30; }
.main { margin-right: 16rem; min-height: 100vh; }
.page { padding: 1.5rem; max-width: 1400px; }
.mobile-header { display: none; }
.drawer, .drawer-overlay { display: none; }

.sb-logo { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,.1);
           display: flex; align-items: center; gap: .75rem; }
.sb-logo .logo-box { width: 2.5rem; height: 2.5rem; border-radius: var(--r-md);
                     background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.sb-logo h1 { font-size: 1.1rem; font-weight: 700; color: #fff; }
.sb-logo p { font-size: .72rem; color: rgba(255,255,255,.6); }
.sb-user { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,.1);
           display: flex; align-items: center; gap: .75rem; }
.sb-user .avatar { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: rgba(255,255,255,.2);
                   display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sb-user .who { flex: 1; min-width: 0; }
.sb-user .who b { display: block; color: #fff; font-weight: 500; }
.sb-user .who span { font-size: .8rem; color: rgba(255,255,255,.6); }
.theme-btn { background: none; border: none; color: rgba(255,255,255,.75); cursor: pointer;
             padding: .45rem; border-radius: var(--r-md); }
.theme-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.sb-nav { flex: 1; overflow-y: auto; padding: .5rem; }
.sb-nav a { display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem;
            border-radius: var(--r-md); color: rgba(255,255,255,.7); margin-bottom: .25rem; }
.sb-nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.sb-nav a.active { background: rgba(255,255,255,.2); color: #fff; font-weight: 500; }
.sb-foot { padding: 1rem; border-top: 1px solid rgba(255,255,255,.1); }
.sb-foot a { display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem;
             border-radius: var(--r-md); color: rgba(255,255,255,.7); }
.sb-foot a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent);
          backdrop-filter: blur(6px); border-bottom: 1px solid var(--border);
          display: flex; align-items: center; justify-content: space-between; gap: 1rem;
          padding: .7rem 1.5rem; }
.topbar h2 { font-size: 1.15rem; font-weight: 700; }
.topbar form { display: flex; gap: .5rem; }

/* ===== Cards ===== */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl);
        box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; overflow: hidden; }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
               display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-title { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.card-content { padding: 1rem 1.5rem; }
.card.danger { border-color: color-mix(in srgb, var(--destructive) 45%, var(--border)); }
.card.danger .card-title { color: var(--destructive); }

/* KPI stat cards */
.grid-kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.grid-kpi > * { min-width: 0; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl);
             box-shadow: var(--shadow-sm); padding: 1.25rem; display: flex;
             align-items: flex-start; justify-content: space-between; gap: .75rem; min-width: 0; }
.stat-card > div:first-child { min-width: 0; }
.stat-card .t { font-size: .85rem; color: var(--muted-fg); margin-bottom: .3rem; }
.stat-card .v { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-card .s { font-size: .78rem; color: var(--muted-fg); margin-top: .35rem; }
.icon-box { padding: .7rem; border-radius: var(--r-lg); display: flex; }
.ib-primary { background: var(--primary-light); color: var(--primary); }
.ib-info    { background: color-mix(in srgb, var(--info) 14%, var(--card)); color: var(--info); }
.ib-success { background: color-mix(in srgb, var(--success) 14%, var(--card)); color: var(--success); }
.ib-warning { background: color-mix(in srgb, var(--warning) 16%, var(--card)); color: var(--warning); }
.ib-danger  { background: color-mix(in srgb, var(--destructive) 13%, var(--card)); color: var(--destructive); }
.ib-muted   { background: var(--muted); color: var(--muted-fg); }

/* Charts */
.grid-charts { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.grid-charts > * { min-width: 0; }
.chart-wrap { position: relative; height: 290px; }
.chart-wrap.chart-side { height: 290px; }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; padding: .18rem .65rem; border-radius: 999px;
         font-size: .76rem; font-weight: 600; white-space: nowrap; }
.bg-open     { background: color-mix(in srgb, var(--warning) 18%, var(--card)); color: var(--warning); }
.bg-answered { background: color-mix(in srgb, var(--success) 16%, var(--card)); color: var(--success); }
.bg-noise    { background: var(--muted); color: var(--muted-fg); }
.bg-cont     { background: color-mix(in srgb, var(--info) 15%, var(--card)); color: var(--info); }
.bg-new      { background: color-mix(in srgb, var(--warning) 18%, var(--card)); color: var(--warning); }
.bg-approved { background: color-mix(in srgb, var(--success) 16%, var(--card)); color: var(--success); }
.bg-primary  { background: var(--primary-light); color: var(--primary); }

/* ===== Tables ===== */
.tbl-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th { text-align: right; padding: .6rem .75rem; color: var(--muted-fg); font-weight: 600;
          font-size: .8rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: .65rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--muted) 55%, var(--card)); }
.tbl tbody tr:last-child td { border-bottom: none; }
.muted { color: var(--muted-fg); }
.small { font-size: .84rem; }

/* ===== Forms & buttons ===== */
.input, .select, .textarea {
  background: var(--card); color: var(--fg); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: .5rem .75rem; font-family: inherit; font-size: .92rem;
  min-height: 42px; width: 100%;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.field label { display: block; font-size: .8rem; color: var(--muted-fg); margin-bottom: .3rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
       border-radius: var(--r-md); padding: .5rem 1rem; font-family: inherit; font-size: .92rem;
       font-weight: 500; cursor: pointer; border: 1px solid transparent; min-height: 42px;
       white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--muted-fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--muted); }
.btn-sm { min-height: 36px; padding: .3rem .7rem; font-size: .85rem; }

.filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.filters .span-2 { grid-column: span 2; }

/* Flash alerts */
.alert { border-radius: var(--r-lg); padding: .8rem 1rem; margin-bottom: 1rem; font-size: .92rem;
         border: 1px solid; }
.alert-success { background: color-mix(in srgb, var(--success) 10%, var(--card));
                 border-color: color-mix(in srgb, var(--success) 40%, var(--border)); color: var(--success); }
.alert-error { background: color-mix(in srgb, var(--destructive) 10%, var(--card));
               border-color: color-mix(in srgb, var(--destructive) 40%, var(--border)); color: var(--destructive); }

/* Message thread bubbles */
.bubble { border: 1px solid var(--border); border-radius: var(--r-lg); padding: .7rem .9rem;
          margin-bottom: .6rem; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.bubble .meta { font-size: .78rem; color: var(--muted-fg); margin-bottom: .25rem;
                display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.bubble-in    { background: var(--primary-light); border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.bubble-out   { background: color-mix(in srgb, var(--success) 10%, var(--card));
                border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.bubble-dup   { background: var(--muted); opacity: .8; }

/* CRM profile spoiler (inquiry page) */
.crm-spoiler { border: 2px solid var(--primary); border-radius: var(--r-xl);
  background: var(--card); margin-bottom: 1.25rem; box-shadow: var(--shadow-sm); overflow: hidden; }
.crm-spoiler.crm-high { border-color: var(--success); }
.crm-spoiler.crm-notfound, .crm-spoiler.crm-none { border-color: var(--border); }
.crm-spoiler summary { list-style: none; cursor: pointer; padding: .9rem 1.25rem;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; user-select: none; }
.crm-spoiler summary::-webkit-details-marker { display: none; }
.crm-spoiler summary:hover { background: var(--muted); }
.crm-sum-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.crm-sum-facts { margin-right: auto; }
.crm-chev { color: var(--muted-fg); transition: transform .2s; }
.crm-spoiler[open] .crm-chev { transform: rotate(180deg); }
.crm-body { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--border); }
.crm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem 1.25rem; }
.crm-grid .k { display: block; font-size: .76rem; color: var(--muted-fg); }
.crm-grid .v { font-weight: 600; }
.crm-sect { font-weight: 700; margin: 1rem 0 .5rem; font-size: .92rem; }
.crm-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.crm-badge-high { background: color-mix(in srgb, var(--success) 18%, var(--card)); color: var(--success); }
.crm-badge-mid { background: var(--primary-light); color: var(--primary); }
.crm-badge-low { background: color-mix(in srgb, var(--info) 15%, var(--card)); color: var(--info); }
.crm-badge-none { background: var(--muted); color: var(--muted-fg); }
@media (max-width: 1023.98px) {
  .crm-sum-facts { margin-right: 0; flex-basis: 100%; }
  .crm-grid { grid-template-columns: 1fr 1fr; }
}

/* Insights strip */
.insights { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.insight-chip { background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: .45rem 1rem; font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-sm); }

/* Clickable stat cards + deltas */
a.stat-card { color: inherit; }
a.stat-card:hover { text-decoration: none; box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.delta { font-weight: 700; }
.delta.up { color: var(--success); }
.delta.down { color: var(--destructive); }

/* Primary KPI row (4 cards) */
.grid-kpi-4 { grid-template-columns: repeat(2, 1fr) !important; }
@media (min-width: 1024px) { .grid-kpi.grid-kpi-4 { grid-template-columns: repeat(4, 1fr) !important; } }
.app-zoom .grid-kpi-4 { grid-template-columns: 1fr 1fr !important; }

/* Secondary KPI row (3 cards) */
.grid-kpi-3 { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 640px) { .grid-kpi-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid-kpi.grid-kpi-3 { grid-template-columns: repeat(3, 1fr); } }
.app-zoom .grid-kpi-3 { grid-template-columns: 1fr !important; }

/* Heatmap (days x 2-hour buckets) */
.hm-scroll { overflow-x: auto; }
.heatmap { display: grid; grid-template-columns: auto repeat(12, 1fr); gap: 3px; min-width: 340px; }
.hm-h { font-size: .68rem; color: var(--muted-fg); text-align: center; align-self: end;
        white-space: nowrap; direction: ltr; }
.hm-d { font-size: .8rem; color: var(--muted-fg); font-weight: 600; display: flex;
        align-items: center; padding-left: .35rem; }
.hm-c { aspect-ratio: 1; border-radius: 5px; background: var(--muted);
        display: flex; align-items: center; justify-content: center;
        font-size: .72rem; font-weight: 600; color: #fff; min-width: 0; }
.hm-c.hm-light { color: var(--fg); }
@media (max-width: 1023.98px) {
  .hm-h { font-size: .58rem; }
  .hm-c { font-size: .62rem; border-radius: 3px; }
}

/* Topics management rows */
.topic-row { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
.topic-row:last-child { border-bottom: none; }
.topic-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.topic-name { font-size: 1.05rem; font-weight: 700; }
.topic-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .7rem; }
.topic-act { display: flex; gap: .4rem; flex: 1 1 240px; min-width: 0; }
.topic-act .input, .topic-act .select { flex: 1; min-width: 0; }
.topic-act .btn { flex-shrink: 0; }
@media (max-width: 1023.98px) {
  .topic-row { padding: 1rem; }
  .topic-act { flex: 1 1 100%; }
}

/* Period filter bar (dashboard) */
.period-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.period-btns { display: flex; gap: .35rem; flex-wrap: nowrap; background: var(--muted);
               padding: .3rem; border-radius: var(--r-lg); max-width: 100%; overflow-x: auto;
               scrollbar-width: none; }
.period-btns::-webkit-scrollbar { display: none; }
.pbtn { padding: .4rem .9rem; border-radius: var(--r-md); color: var(--muted-fg);
        font-size: .9rem; font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.pbtn:hover { color: var(--fg); text-decoration: none; }
.pbtn.active { background: var(--primary); color: #fff; }
.period-bar > .small { margin-right: auto; }
@media (max-width: 1023.98px) {
  .period-bar > .small { margin-right: 0; }
  .pbtn { padding: .4rem .55rem; font-size: .84rem; }
}
.app-zoom .pbtn { padding: .4rem .5rem; font-size: .82rem; }

/* WhatsApp-style draft preview */
.wa-preview { background: #e7f8ef; border: 1px solid #b8e6cc; border-radius: var(--r-lg);
  border-top-left-radius: .25rem; padding: .8rem 1rem; white-space: pre-wrap;
  font-size: .95rem; line-height: 1.65; color: #103a26;
  overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.dark .wa-preview { background: #14382a; border-color: #1f5c42; color: #d9f2e4; }
.wa-preview a { word-break: break-all; }

/* ===== WhatsApp-style conversation view ===== */
.wa-chat { background: #efeae2;
  background-image: radial-gradient(rgba(0,0,0,.028) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  padding: 1rem; display: flex; flex-direction: column; gap: .35rem;
  max-height: 560px; overflow-y: auto; }
.dark .wa-chat { background: #0b141a;
  background-image: radial-gradient(rgba(255,255,255,.03) 1.5px, transparent 1.5px); }
.wa-row { display: flex; }
.wa-row.in { justify-content: flex-start; }   /* RTL: הפונה מימין */
.wa-row.out { justify-content: flex-end; }    /* RTL: הלשכה משמאל */
.wa-bubble { max-width: 78%; padding: .45rem .7rem .3rem; border-radius: 9px;
  box-shadow: 0 1px 1px rgba(0,0,0,.13); position: relative;
  overflow-wrap: anywhere; word-break: break-word; }
.wa-msg-in { background: #ffffff; color: #111b21; border-top-right-radius: 2px; }
.wa-msg-out { background: #d9fdd3; color: #111b21; border-top-left-radius: 2px; }
.dark .wa-msg-in { background: #202c33; color: #e9edef; }
.dark .wa-msg-out { background: #005c4b; color: #e9edef; }
.wa-msg-out.wa-auto { background: #f0f0f0; color: #54656f; }
.dark .wa-msg-out.wa-auto { background: #1d282f; color: #8696a0; }
.wa-msg-in.wa-dup { opacity: .65; }
.wa-msg-in.wa-spam { border: 1px solid #e57373; background: #fdecec; }
.dark .wa-msg-in.wa-spam { border-color: #7f3b3b; background: #2a1616; }
.wa-tag-spam { color: #c0392b; }
.dark .wa-tag-spam { color: #e57373; }
.wa-text { white-space: pre-wrap; font-size: .95rem; line-height: 1.5; }
.wa-time { font-size: .68rem; color: #667781; text-align: left; margin-top: .15rem;
  direction: ltr; }
.dark .wa-time { color: #8696a0; }
.wa-tag { font-size: .7rem; font-weight: 600; color: #8696a0; margin-bottom: .15rem; }
.wa-media { margin-top: .3rem; font-size: .85rem; }
.wa-media a { color: #027eb5; }
@media (max-width: 1023.98px) { .wa-chat { max-height: 460px; padding: .7rem; }
  .wa-bubble { max-width: 88%; } }

/* WhatsApp composer */
.wa-composer { background: #f0f2f5; padding: .6rem .75rem; border-top: 1px solid var(--border); }
.dark .wa-composer { background: #202c33; }
.wa-templates { margin-bottom: .5rem; }
.wa-pin { margin-bottom: .5rem; max-width: 240px; }
.wa-inputrow { display: flex; gap: .5rem; align-items: flex-end; }
.wa-inputrow .textarea { flex: 1; border-radius: 1.2rem; padding: .6rem 1rem;
  resize: none; min-height: 46px; background: var(--card); }
.wa-sendbtn { width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: #00a884; color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; }
.wa-sendbtn:hover { background: #008f72; }

/* Pagination */
.pager { display: flex; gap: .35rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.pager a, .pager span { min-width: 2.2rem; height: 2.2rem; display: inline-flex; align-items: center;
  justify-content: center; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--card); color: var(--fg); font-size: .88rem; padding: 0 .4rem; }
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Login */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
             background: linear-gradient(135deg, var(--primary) 0%, #063d4a 100%); padding: 1rem; }
.auth-card { background: var(--card); border-radius: var(--r-xl); box-shadow: var(--shadow-md);
             padding: 2rem; width: 100%; max-width: 380px; text-align: center; }
.auth-card .logo-box { width: 3.5rem; height: 3.5rem; border-radius: var(--r-lg); margin: 0 auto 1rem;
                       background: var(--primary-light); color: var(--primary);
                       display: flex; align-items: center; justify-content: center; }

/* ===== Responsive (sidebar collapses below 1024px — covers phone "desktop mode" at 980px too) ===== */
.hide-sm { }
@media (max-width: 1023.98px) {
  html { font-size: 18px; }
  .btn, .input, .select, .textarea { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .tbl { font-size: .97rem; }
  .sidebar { display: none; }
  .main { margin-right: 0; }
  .mobile-header { display: flex; position: fixed; top: 0; right: 0; left: 0; z-index: 40;
                   background: var(--sidebar); height: 4rem; align-items: center;
                   justify-content: space-between; padding: 0 1rem; }
  .mobile-header .brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; }
  .mobile-header .brand .logo-box { width: 2rem; height: 2rem; border-radius: var(--r-md);
    background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
  .burger { background: none; border: none; color: #fff; padding: .5rem; border-radius: var(--r-md); cursor: pointer; }
  .burger:hover { background: rgba(255,255,255,.1); }
  .main-inner { padding-top: 4rem; }
  .drawer-overlay { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.5); display: none; }
  .drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: 18rem; max-width: 85vw;
            background: var(--sidebar); color: #fff; display: none; flex-direction: column;
            animation: slideIn .25s ease-out; }
  body.drawer-open .drawer { display: flex; }
  body.drawer-open .drawer-overlay { display: block; }
  .page { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .grid-charts { grid-template-columns: 1fr; }
  .stat-card .v { font-size: 1.65rem; }
  .chart-wrap { height: 240px; }
  .chart-wrap.chart-side { height: 300px; }
  .hide-sm { display: none !important; }
}
@media (min-width: 1024px) {
  .main-inner { padding-top: 0; }
  .grid-kpi { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .grid-kpi { grid-template-columns: repeat(6, 1fr); }
  .filters { display: flex; flex-wrap: wrap; align-items: end; }
  .filters > div { min-width: 150px; }
}
@keyframes slideIn { from { transform: translateX(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== app-zoom: touch phone forced to a wide (desktop-mode) viewport =====
   The JS in base.html scales the UI (zoom = viewport/430), so the effective
   layout width is ~430px. Media queries still see the wide viewport, so the
   small-screen rules are mirrored here explicitly. */
html.app-zoom { font-size: 18px; }
.app-zoom .tbl { font-size: .97rem; }
.app-zoom .btn, .app-zoom .input, .app-zoom .select, .app-zoom .textarea { min-height: 44px; }
.app-zoom .btn-sm { min-height: 40px; }
.app-zoom .hide-sm { display: none !important; }
.app-zoom .grid-kpi { grid-template-columns: repeat(2, 1fr); }
.app-zoom .grid-charts { grid-template-columns: 1fr; }
.app-zoom .filters { display: grid; grid-template-columns: repeat(2, 1fr); }
.app-zoom .chart-wrap { height: 235px; }
.app-zoom .chart-wrap.chart-side { height: 300px; }
.app-zoom .page { padding: .9rem; }
.app-zoom .topbar { padding: .6rem .9rem; flex-wrap: wrap; }
.app-zoom .topbar form { flex: 1 1 100%; }
.app-zoom .topbar form .input { max-width: none !important; flex: 1; }
.app-zoom .stat-card .v { font-size: 1.6rem; }
.app-zoom .card-header, .app-zoom .card-content { padding-left: 1rem; padding-right: 1rem; }
.animate-fadeIn { animation: fadeIn .3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
