/* ═══════════════════════════════════════════════
   LIGHT THEME
═══════════════════════════════════════════════ */
[data-theme="light"] {
  --page-bg:        #ebebeb;
  --sidebar-bg:     #ffffff;
  --sidebar-w:      220px;
  --topbar-bg:      #ffffff;
  --content-bg:     #ffffff;
  --border:         #e8e8e8;
  --border-light:   #f0f0f0;
  --text:           #111111;
  --text-2:         #6b6b6b;
  --text-3:         #aaaaaa;
  --active-bg:      #f2f2f2;
  --hover-bg:       #f7f7f7;
  --row-hover:      #fafafa;
  --input-bg:       #f5f5f5;
  --shadow:         0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);
  --shadow-popup:   0 4px 24px rgba(0,0,0,.14);
  --kbd-bg:         #f0f0f0;
  --stat-card-bg:   #ffffff;
  --pill-active-bg: #e6f4ea;  --pill-active-c: #2d7a3a;
  --pill-new-bg:    #e8f0fe;  --pill-new-c:    #1a56c4;
  --pill-vip-bg:    #fef9e7;  --pill-vip-c:    #a06000;
  --pill-none-bg:   #f2f2f2;  --pill-none-c:   #666666;
  --accent:         #111111;
  --accent-btn-bg:  #111111;  --accent-btn-c:  #ffffff;
  --section-lbl:    #999999;
  --chip-border:    #e0e0e0;
  --dt-pg-active:   #111111;  --dt-pg-active-c:#ffffff;
  --excel-bg:       #1d7145;  --excel-c:       #ffffff;
  --modal-overlay:  rgba(0,0,0,.35);
  --summary-bg:     #f0f3ff;
  --summary-border: #dde3f8;
  --tab-active-c:   #5b5fc7;
  --tab-active-border: #5b5fc7;
  --tbl-head-c:     #8a8fa8;
  --tbl-row-alt:    #f8f9fc;
  --type-invoice-bg:#e0f2f1; --type-invoice-c:#0d7a70;
  --type-hp-bg:     #e8f4fd;  --type-hp-c:    #0a6b9a;
  --action-btn-bg:  #eef0f6;  --action-btn-c: #5a6080;
}

/* ═══════════════════════════════════════════════
   DARK THEME
═══════════════════════════════════════════════ */
[data-theme="dark"] {
  --page-bg:        #0f1117;
  --sidebar-bg:     #161b27;
  --sidebar-w:      220px;
  --topbar-bg:      #161b27;
  --content-bg:     #1c2132;
  --border:         #2a3148;
  --border-light:   #222840;
  --text:           #e8eaf2;
  --text-2:         #8b92b0;
  --text-3:         #4a5070;
  --active-bg:      #1e2640;
  --hover-bg:       #1a2038;
  --row-hover:      #1e2540;
  --input-bg:       #1a1f30;
  --shadow:         0 2px 12px rgba(0,0,0,.3);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.45);
  --shadow-popup:   0 4px 24px rgba(0,0,0,.5);
  --kbd-bg:         #252d44;
  --stat-card-bg:   #1c2132;
  --pill-active-bg: #0d2e1a;  --pill-active-c: #4ade80;
  --pill-new-bg:    #0d1f3c;  --pill-new-c:    #60a5fa;
  --pill-vip-bg:    #2d1f00;  --pill-vip-c:    #fbbf24;
  --pill-none-bg:   #252d44;  --pill-none-c:   #8b92b0;
  --accent:         #3b82f6;
  --accent-btn-bg:  #2563eb;  --accent-btn-c:  #ffffff;
  --section-lbl:    #4a5070;
  --chip-border:    #2a3148;
  --dt-pg-active:   #3b82f6;  --dt-pg-active-c:#ffffff;
  --excel-bg:       #1d7145;  --excel-c:       #ffffff;
  --modal-overlay:  rgba(0,0,0,.6);
  --summary-bg:     #171e30;
  --summary-border: #2a3148;
  --tab-active-c:   #818cf8;
  --tab-active-border:#818cf8;
  --tbl-head-c:     #4a5070;
  --tbl-row-alt:    #1a1f30;
  --type-invoice-bg:#0d2e2a; --type-invoice-c:#4ade80;
  --type-hp-bg:     #0d2038;  --type-hp-c:    #60a5fa;
  --action-btn-bg:  #252d44;  --action-btn-c: #8b92b0;
}

/* ═══════════════════════════════════════════════
   LIGHT + DARK NAV THEME
═══════════════════════════════════════════════ */
[data-theme="light-dark-nav"] {
  --page-bg:        #ebebeb;
  --sidebar-bg:     #1a1f36;
  --sidebar-w:      220px;
  --topbar-bg:      #ffffff;
  --content-bg:     #ffffff;
  --border:         #e8e8e8;
  --border-light:   #f0f0f0;
  --text:           #111111;
  --text-2:         #6b6b6b;
  --text-3:         #aaaaaa;
  --active-bg:      #f2f2f2;
  --hover-bg:       #f7f7f7;
  --row-hover:      #fafafa;
  --input-bg:       #f5f5f5;
  --shadow:         0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);
  --shadow-popup:   0 4px 24px rgba(0,0,0,.14);
  --kbd-bg:         #f0f0f0;
  --stat-card-bg:   #ffffff;
  --pill-active-bg: #e6f4ea;  --pill-active-c: #2d7a3a;
  --pill-new-bg:    #e8f0fe;  --pill-new-c:    #1a56c4;
  --pill-vip-bg:    #fef9e7;  --pill-vip-c:    #a06000;
  --pill-none-bg:   #f2f2f2;  --pill-none-c:   #666666;
  --accent:         #111111;
  --accent-btn-bg:  #111111;  --accent-btn-c:  #ffffff;
  --section-lbl:    #999999;
  --chip-border:    #e0e0e0;
  --dt-pg-active:   #111111;  --dt-pg-active-c:#ffffff;
  --excel-bg:       #1d7145;  --excel-c:       #ffffff;
  --modal-overlay:  rgba(0,0,0,.35);
  --summary-bg:     #f0f3ff;
  --summary-border: #dde3f8;
  --tab-active-c:   #5b5fc7;
  --tab-active-border: #5b5fc7;
  --tbl-head-c:     #8a8fa8;
  --tbl-row-alt:    #f8f9fc;
  --type-invoice-bg:#e0f2f1; --type-invoice-c:#0d7a70;
  --type-hp-bg:     #e8f4fd;  --type-hp-c:    #0a6b9a;
  --action-btn-bg:  #eef0f6;  --action-btn-c: #5a6080;
}
/* Sidebar & topbar scoped overrides — dark blue gradient, bright text, no divider lines */
[data-theme="light-dark-nav"] #sidebar {
  background:
    radial-gradient(ellipse at 20% 12%, rgba(25, 49, 121, 0.55) 0%, transparent 48%),
    radial-gradient(ellipse at 65% 75%, rgba(0, 130, 200, 0.35) 0%, transparent 50%),
    linear-gradient(175deg, #04183a 0%, #03105c 55%, #020b2e 100%);
  border-right-color: #0a2050;
}
/* Topbar stays light (white bg, dark text) in this theme — only the sidebar is
   dark. It inherits the base #topbar styling, so no override here. */
[data-theme="light-dark-nav"] #sidebar .sb-brand { border-bottom: none; }
[data-theme="light-dark-nav"] #sidebar .sb-footer { border-top: none; }
[data-theme="light-dark-nav"] #sidebar .sb-brand-name { color: #f0f4ff; }
[data-theme="light-dark-nav"] #sidebar .sb-brand-icon { background: rgba(255,255,255,.12); color: #f0f4ff; }
[data-theme="light-dark-nav"] #sidebar .sb-logo-img { filter: brightness(0) invert(1); }
[data-theme="light-dark-nav"] #sidebar .sb-section-lbl { color: #4d6080; }
[data-theme="light-dark-nav"] #sidebar .sb-item { color: #dce6f5; }
[data-theme="light-dark-nav"] #sidebar .sb-item:hover { background: rgba(255,255,255,.07); color: #ffffff; }
[data-theme="light-dark-nav"] #sidebar .sb-item.active { background: rgba(255,255,255,.1); color: #ffffff; }
[data-theme="light-dark-nav"] #sidebar .sb-item.active::before { background: var(--brand); }
/* L2 (child) links — inherit --text-2 by default, which is a light-theme grey and
   unreadable on the dark nav; give them their own bright scale. */
[data-theme="light-dark-nav"] #sidebar .sb-sub-item { color: #c3d2e8; }
[data-theme="light-dark-nav"] #sidebar .sb-sub-item:hover { background: rgba(255,255,255,.07); color: #ffffff; }
[data-theme="light-dark-nav"] #sidebar .sb-sub-item.active { color: #ffffff; }
[data-theme="light-dark-nav"] #sidebar .sb-user-name { color: #dce8ff; }
[data-theme="light-dark-nav"] #sidebar .sb-user-role { color: #6880a0; }
[data-theme="light-dark-nav"] #sidebar .sb-user-avatar { background: rgba(255,255,255,.15); color: #f0f4ff; }
[data-theme="light-dark-nav"] #sidebar .sb-collapse-btn,
[data-theme="light-dark-nav"] #sidebar .sb-section-toggle { color: #6880a0; }
[data-theme="light-dark-nav"] #sidebar .sb-collapse-btn:hover,
[data-theme="light-dark-nav"] #sidebar .sb-section-toggle:hover { color: #f0f4ff; }

/* ═══════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13.5px; }
body { background: var(--page-bg); color: var(--text); transition: background .25s, color .25s; overflow: hidden; }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: 'Plus Jakarta Sans', sans-serif; }
button { cursor: pointer; }

/* ═══════════════════════════════════════════════
   PAGE LOADER
═══════════════════════════════════════════════ */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--page-bg);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px;
  transition: opacity .4s, visibility .4s;
}
#loader.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.ldr-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.ldr-icon { width: 32px; height: 32px; background: var(--accent-btn-bg); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--accent-btn-c); font-weight: 900; font-size: 16px; }
.ldr-track { width: 200px; height: 2px; background: var(--border); border-radius: 99px; overflow: hidden; }
.ldr-bar { width: 0; height: 100%; background: var(--accent); border-radius: 99px; animation: ldrgo 1.4s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes ldrgo { 0%{width:0} 60%{width:70%} 100%{width:100%} }

/* ═══════════════════════════════════════════════
   SHELL
═══════════════════════════════════════════════ */
#shell { display: flex; height: 100vh; overflow: hidden; }

/* ═══════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto; overflow-x: hidden;
  transition: width .22s ease, transform .22s ease, background .25s;
  position: relative; z-index: 200;
}
#sidebar::-webkit-scrollbar { width: 0; }
#sidebar.collapsed { width: 52px; }
#sidebar.collapsed .sb-label,
#sidebar.collapsed .sb-section-lbl,
#sidebar.collapsed .sb-badge,
#sidebar.collapsed .sb-arrow,
#sidebar.collapsed .sb-brand-name,
#sidebar.collapsed .sb-sub,
#sidebar.collapsed .sb-user-info,
#sidebar.collapsed .sb-quick { display: none !important; }
#sidebar.collapsed .sb-item { justify-content: center; padding: 8px; }
#sidebar.collapsed .sb-brand { justify-content: center; padding: 16px 8px; }

.sb-brand { display: flex; align-items: center; gap: 9px; padding: 18px 16px 16px; border-bottom: 1px solid var(--border-light); }
.sb-brand-icon { width: 30px; height: 30px; background: var(--accent-btn-bg); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--accent-btn-c); font-weight: 900; font-size: 14px; flex-shrink: 0; }
.sb-brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.3px; display: flex; align-items: center; gap: 5px; }
.sb-brand-name i { font-size: 11px; color: var(--text-2); }
.sb-collapse-btn { margin-left: auto; background: none; border: none; color: var(--text-3); font-size: 14px; cursor: pointer; padding: 2px; }

.sb-quick { margin: 10px 10px 4px; display: flex; align-items: center; gap: 8px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; cursor: pointer; transition: background .15s; }
.sb-quick:hover { background: var(--hover-bg); }
.sb-quick i { font-size: 13px; color: var(--text-2); }
.sb-quick span { font-size: 13px; color: var(--text-2); flex: 1; }
.sb-quick kbd { font-size: 10px; color: var(--text-3); background: var(--kbd-bg); padding: 1px 5px; border-radius: 3px; }

.sb-nav { padding: 6px 8px; flex: 1; }
.sb-section-lbl { font-size: 10.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--section-lbl); padding: 10px 8px 4px; display: block; }
.sb-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; font-weight: 400; cursor: pointer; transition: all .15s; user-select: none; position: relative; white-space: nowrap; }
.sb-item:hover { background: var(--hover-bg); color: var(--text); }
.sb-item.active { background: var(--active-bg); color: var(--text); font-weight: 500; }
.sb-item i.sb-icon { font-size: 14px; flex-shrink: 0; width: 16px; text-align: center; }
.sb-label { flex: 1; }
.sb-badge { font-size: 10px; font-weight: 600; background: var(--border); color: var(--text-2); padding: 1px 6px; border-radius: 99px; }
/* flex:0 0 auto cancels the flex:1 inherited from the .sb-label class the arrow
   also carries (for collapse-hiding); without this the arrow absorbs free space
   on short-label rows and the rotated chevron renders off-position. */
.sb-arrow { font-size: 10px; color: var(--text-3); transition: transform .18s; flex: 0 0 auto; }
.sb-arrow.open { transform: rotate(90deg); }

.sb-sub { overflow: hidden; max-height: 0; transition: max-height .22s ease; }
.sb-sub.open { max-height: 1000px; }
.sb-sub-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 34px; border-radius: 7px; color: var(--text-2); font-size: 13px; cursor: pointer; transition: all .15s; }
.sb-sub-item:hover { background: var(--hover-bg); color: var(--text); }
.sb-sub-item.active { color: var(--text); font-weight: 500; }

.sb-footer { padding: 10px 8px 14px; border-top: 1px solid var(--border-light); }
.sb-user { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; cursor: pointer; transition: background .15s; }
.sb-user:hover { background: var(--hover-bg); }
.sb-user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--active-bg); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 11px; color: var(--text-2); }

/* ═══════════════════════════════════════════════
   MAIN
═══════════════════════════════════════════════ */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ═══════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════ */
#topbar {
  height: 52px; flex-shrink: 0;
  background: var(--topbar-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 10px;
  transition: background .25s; z-index: 100; position: relative;
}
.tb-mob-toggle { display: none; background: none; border: none; font-size: 18px; color: var(--text-2); padding: 4px; }
.tb-search { display: flex; align-items: center; gap: 7px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; padding: 6px 12px; cursor: text; flex: 1; max-width: 320px; transition: border-color .15s; }
.tb-search:focus-within { border-color: var(--accent); }
.tb-search i { font-size: 13px; color: var(--text-3); }
.tb-search input { border: none; background: none; outline: none; font-size: 13px; color: var(--text); width: 100%; }
.tb-search input::placeholder { color: var(--text-3); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tb-icon-btn { width: 32px; height: 32px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--text-2); font-size: 16px; position: relative; transition: all .15s; }
.tb-icon-btn:hover { background: var(--hover-bg); color: var(--text); }
.tb-notif-dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: #ef4444; border: 1.5px solid var(--topbar-bg); }
.tb-divider { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.tb-theme-btn { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 7px; background: var(--input-bg); border: 1px solid var(--border); font-size: 12px; font-weight: 500; color: var(--text-2); transition: all .15s; }
.tb-theme-btn:hover { background: var(--hover-bg); color: var(--text); }
.tb-logout { display: flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 7px; background: none; border: 1px solid var(--border); font-size: 12.5px; font-weight: 500; color: var(--text-2); transition: all .15s; }
.tb-logout:hover { background: var(--hover-bg); color: var(--text); }

/* ═══════════════════════════════════════════════
   NOTIFICATION DROPDOWN
═══════════════════════════════════════════════ */
.notif-wrap { position: relative; }
#notif-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px; background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 500; overflow: hidden;
}
#notif-dropdown.open { display: block; }
.notif-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border-light); }
.notif-header span { font-size: 14px; font-weight: 600; }
.notif-mark-all { font-size: 12px; color: var(--accent); background: none; border: none; cursor: pointer; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border-light); transition: background .12s; cursor: pointer; }
.notif-item:hover { background: var(--hover-bg); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--active-bg); }
.notif-dot-wrap { padding-top: 4px; flex-shrink: 0; }
.notif-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notif-read-dot { width: 7px; height: 7px; }
.notif-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.notif-text { flex: 1; }
.notif-title { font-size: 13px; font-weight: 500; line-height: 1.35; }
.notif-sub { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.notif-footer { padding: 10px 16px; text-align: center; }
.notif-footer a { font-size: 12.5px; color: var(--accent); }

/* ═══════════════════════════════════════════════
   PAGE HEADLINE BAR (gray bg, very top of content)
═══════════════════════════════════════════════ */
#page-headline-bar {
  flex-shrink: 0;
  background: var(--page-bg);
  border-bottom: 1px solid var(--border);
  padding: 9px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
/* Title + subtitle share one line (the subtitle is supporting context, not a
   second heading), so the bar costs one row of vertical space instead of two.
   min-width:0 + ellipsis keeps a long subtitle from pushing the actions out. */
.ph-left { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }
.ph-left .ph-title { font-size: 18px; font-weight: 700; letter-spacing: -.3px; line-height: 1.25; white-space: nowrap; }
.ph-left .ph-sub {
  font-size: 12.5px; color: var(--text-2); line-height: 1.25;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Divider dot, only when a subtitle is actually present. */
.ph-left .ph-sub::before { content: '·'; margin-right: 10px; color: var(--text-3); }
.ph-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ph-link { display: flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); background: none; border: none; transition: all .15s; cursor: pointer; white-space: nowrap; }
.ph-link:hover { background: var(--border); color: var(--text); }
.ph-link i { font-size: 12px; }
.ph-link.disabled { opacity: .4; pointer-events: none; }
.ph-link.primary { background: var(--accent-btn-bg); color: var(--accent-btn-c); font-weight: 500; }
.ph-link.primary:hover { opacity: .88; }

/* ═══════════════════════════════════════════════
   SCROLL AREA
═══════════════════════════════════════════════ */
#content-area { flex: 1; overflow-y: auto; overflow-x: hidden; background: var(--page-bg); }
#content-area::-webkit-scrollbar { width: 6px; }
#content-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ═══════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════ */
.stat-cards { display: flex; gap: 10px; padding: 14px 14px 0; flex-wrap: wrap; }
.stat-card { background: var(--stat-card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; flex: 1; min-width: 130px; transition: box-shadow .15s, background .25s; }
.stat-card:hover { box-shadow: var(--shadow); }
.sc-label { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 4px; margin-bottom: 5px; }
.sc-label i { font-size: 10px; color: var(--accent); }
.sc-value { font-size: 24px; font-weight: 700; letter-spacing: -.8px; line-height: 1; display: flex; align-items: baseline; gap: 5px; }
.sc-value .sc-sub { font-size: 12px; font-weight: 400; color: var(--text-2); letter-spacing: 0; }
.sc-sparkline { margin-top: 8px; height: 28px; }
.sc-sparkline svg { width: 100%; height: 100%; }

/* ═══════════════════════════════════════════════
   CONTENT CARD
═══════════════════════════════════════════════ */
.content-inner { background: var(--content-bg); border-radius: 12px; margin: 12px 14px; overflow: hidden; box-shadow: var(--shadow); transition: background .25s; }

/* ═══════════════════════════════════════════════
   TABS (Default / Only important)
═══════════════════════════════════════════════ */
.content-tabs { display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--border-light); }
.c-tab { padding: 13px 0; margin-right: 20px; font-size: 13.5px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s; white-space: nowrap; }
.c-tab:hover { color: var(--text); }
.c-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.c-tab-add { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 16px; cursor: pointer; transition: all .15s; margin-left: 2px; }
.c-tab-add:hover { background: var(--hover-bg); color: var(--text); }
.c-tab-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dots-btn { width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--text-2); font-size: 16px; cursor: pointer; transition: background .15s; }
.dots-btn:hover { background: var(--hover-bg); }

/* ═══════════════════════════════════════════════
   INLINE STATS (inside white card)
═══════════════════════════════════════════════ */
.inline-stats { display: flex; padding: 16px 24px 14px; border-bottom: 1px solid var(--border-light); gap: 0; overflow-x: auto; }
.inline-stats::-webkit-scrollbar { height: 0; }
.is-cell { flex: 1; min-width: 110px; padding-right: 24px; border-right: 1px solid var(--border-light); margin-right: 24px; }
.is-cell:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.is-label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.is-label i { font-size: 10px; color: var(--accent); }
.is-value { font-size: 24px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; display: flex; align-items: baseline; gap: 6px; }
.is-value .is-pct { font-size: 12px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.is-spark { height: 26px; margin-top: 7px; }
.is-spark svg { width: 100%; height: 100%; }

/* ═══════════════════════════════════════════════
   ADVANCED SEARCH ROW
═══════════════════════════════════════════════ */
.adv-search { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.adv-input { display: flex; align-items: center; gap: 6px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; padding: 6px 11px; transition: border-color .15s; flex: 1; min-width: 140px; max-width: 220px; }
.adv-input:focus-within { border-color: var(--accent); }
.adv-input i { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.adv-input input { border: none; background: none; outline: none; font-size: 13px; color: var(--text); width: 100%; }
.adv-input input::placeholder { color: var(--text-3); }
.adv-date { display: flex; align-items: center; gap: 6px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; padding: 6px 11px; transition: border-color .15s; min-width: 130px; }
.adv-date:focus-within { border-color: var(--accent); }
.adv-date i { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.adv-date input { border: none; background: none; outline: none; font-size: 13px; color: var(--text); width: 110px; }
[data-theme="dark"] .adv-date input::-webkit-calendar-picker-indicator { filter: invert(1); }
.adv-sep { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.adv-select { background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; padding: 6px 28px 6px 11px; font-size: 13px; color: var(--text); outline: none; cursor: pointer; transition: border-color .15s; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; min-width: 120px; }
.adv-select:focus { border-color: var(--accent); }
.adv-search-btn { display: flex; align-items: center; gap: 5px; padding: 7px 16px; background: var(--accent-btn-bg); color: var(--accent-btn-c); border: none; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: opacity .15s; flex-shrink: 0; }
.adv-search-btn:hover { opacity: .88; }
.adv-clear { background: none; border: 1px solid var(--border); color: var(--text-2); border-radius: 7px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.adv-clear:hover { background: var(--hover-bg); }

/* ═══════════════════════════════════════════════
   FILTERS BAR
═══════════════════════════════════════════════ */
.filters-bar { display: flex; align-items: center; padding: 9px 20px; gap: 8px; border-bottom: 1px solid var(--border-light); }
.filter-btn { display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; border: 1px solid var(--chip-border); background: none; font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all .15s; white-space: nowrap; }
.filter-btn:hover { background: var(--hover-bg); color: var(--text); }
.filter-btn i { font-size: 12px; }
.filters-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.excel-btn { display: flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 7px; background: var(--excel-bg); color: var(--excel-c); border: none; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: opacity .15s; }
.excel-btn:hover { opacity: .88; }
.customize-btn { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 7px; border: none; background: none; font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all .15s; }
.customize-btn:hover { background: var(--hover-bg); }
#dt-global-wrap { display: flex; align-items: center; gap: 6px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; padding: 4px 10px; }
#dt-search, #dt-global-wrap .dt-q { border: none; background: none; outline: none; font-size: 12.5px; color: var(--text); width: 150px; }

/* ═══════════════════════════════════════════════
   CONTACTS TABLE
═══════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border-light); }
thead th { padding: 9px 14px; font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text-3); white-space: nowrap; cursor: pointer; user-select: none; transition: color .12s; text-align: left; }
thead th:hover { color: var(--text-2); }
thead th.sort-asc::after { content: ' ↑'; font-size: 9px; }
thead th.sort-desc::after { content: ' ↓'; font-size: 9px; }
thead th:first-child { padding-left: 20px; cursor: default; }
tbody tr { border-bottom: 1px solid var(--border-light); transition: background .12s; cursor: pointer; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--row-hover); }
tbody td { padding: 10px 14px; font-size: 13.5px; vertical-align: middle; white-space: nowrap; }
tbody td:first-child { padding-left: 20px; }
.cb { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--border); cursor: pointer; appearance: none; background: none; transition: all .12s; display: block; }
.cb:checked { background: var(--accent-btn-bg); border-color: var(--accent-btn-bg); }
.cb:checked::after { content: ''; display: block; width: 4px; height: 7px; border: 2px solid #fff; border-top: none; border-left: none; transform: rotate(45deg) translate(2px,-1px); }
.av-chip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; font-size: 9px; font-weight: 700; flex-shrink: 0; letter-spacing: .3px; }
.name-cell { display: flex; align-items: center; gap: 9px; }
.pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.pill-active { background: var(--pill-active-bg); color: var(--pill-active-c); }
.pill-new    { background: var(--pill-new-bg);    color: var(--pill-new-c); }
.pill-vip    { background: var(--pill-vip-bg);    color: var(--pill-vip-c); }
.pill-none   { background: var(--pill-none-bg);   color: var(--pill-none-c); }

/* ═══════════════════════════════════════════════
   INVOICE TABLE (from image 1)
═══════════════════════════════════════════════ */
.inv-table-wrap { overflow-x: auto; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table thead th {
  padding: 10px 16px; font-size: 11px; font-weight: 600; letter-spacing: .8px;
  text-transform: uppercase; color: var(--tbl-head-c); white-space: nowrap;
  border-bottom: 1px solid var(--border-light);
}
.inv-table thead th:first-child { padding-left: 24px; }
.inv-table tbody tr { border-bottom: 1px solid var(--border-light); transition: background .12s; }
.inv-table tbody tr:nth-child(even) { background: var(--tbl-row-alt); }
.inv-table tbody tr:hover { background: var(--row-hover); }
.inv-table tbody tr:last-child { border-bottom: none; }
.inv-table tbody td { padding: 14px 16px; font-size: 13.5px; vertical-align: middle; white-space: nowrap; }
.inv-table tbody td:first-child { padding-left: 24px; color: var(--text-2); font-size: 13px; }
.inv-ref { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 13px; color: var(--text); }
.inv-amount { font-size: 13.5px; font-weight: 600; }
.inv-type-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.inv-type-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.tag-invoice { background: var(--type-invoice-bg); color: var(--type-invoice-c); }
.tag-hp { background: var(--type-hp-bg); color: var(--type-hp-c); }
.inv-status-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.inv-status-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.ist-active  { background: var(--pill-active-bg); color: var(--pill-active-c); }
.ist-pending { background: var(--pill-vip-bg);    color: var(--pill-vip-c); }
.ist-overdue { background: #fde8e8;               color: #b91c1c; }
[data-theme="dark"] .ist-overdue { background: #2d0a0a; color: #f87171; }
.inv-actions { display: flex; align-items: center; gap: 6px; }
.inv-action-btn { width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--action-btn-bg); border: none; color: var(--action-btn-c); font-size: 13px; cursor: pointer; transition: all .15s; }
.inv-action-btn:hover { opacity: .75; }
.inv-action-btn.del:hover { background: #fee2e2; color: #dc2626; }
[data-theme="dark"] .inv-action-btn.del:hover { background: #2d0a0a; color: #f87171; }

/* ═══════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════ */
.dt-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-top: 1px solid var(--border-light); flex-wrap: wrap; gap: 8px; }
.dt-info { font-size: 12.5px; color: var(--text-2); }
.dt-pg { display: flex; align-items: center; gap: 4px; }
.pg-btn { min-width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); cursor: pointer; padding: 0 6px; transition: all .12s; }
.pg-btn:hover { background: var(--hover-bg); color: var(--text); }
.pg-btn.active { background: var(--dt-pg-active); color: var(--dt-pg-active-c); border-color: var(--dt-pg-active); }
.pg-btn:disabled { opacity: .35; cursor: not-allowed; }
.dt-page-size { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.dt-page-size select { background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px; padding: 3px 22px 3px 8px; font-size: 12.5px; color: var(--text); outline: none; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23aaa'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; cursor: pointer; }

/* ═══════════════════════════════════════════════
   CONTACT POPUP
═══════════════════════════════════════════════ */
#popup {
  position: fixed; z-index: 1500;
  background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: 12px; width: 310px;
  box-shadow: var(--shadow-popup);
  display: none; flex-direction: column; overflow: hidden;
  transition: background .25s, border-color .25s;
}
#popup.show { display: flex; }
.pop-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--border-light); }
.pop-avatar { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pop-name { font-size: 14px; font-weight: 600; flex: 1; }
.pop-close { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--text-3); font-size: 14px; cursor: pointer; transition: all .12s; }
.pop-close:hover { background: var(--hover-bg); color: var(--text); }
.pop-fields { padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.pop-row { display: flex; align-items: flex-start; gap: 8px; padding: 4px 14px; }
.pop-row i { font-size: 12px; color: var(--text-3); width: 14px; text-align: center; margin-top: 2px; flex-shrink: 0; }
.pop-row-label { font-size: 12px; color: var(--text-2); width: 68px; flex-shrink: 0; }
.pop-row-val { font-size: 12px; color: var(--text); word-break: break-all; }
.pop-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 500; }
.pop-msg-area { padding: 10px 12px 6px; border-bottom: 1px solid var(--border-light); }
.pop-msg-box { display: flex; align-items: flex-start; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--input-bg); }
.pop-msg-input { flex: 1; border: none; background: none; outline: none; padding: 8px 10px; font-size: 12.5px; color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif; resize: none; min-height: 38px; }
.pop-msg-input::placeholder { color: var(--text-3); }
.pop-msg-expand { padding: 5px; color: var(--text-3); background: none; border: none; cursor: pointer; font-size: 13px; align-self: flex-start; margin-top: 4px; }
.pop-msg-footer { display: flex; align-items: center; padding: 5px 10px; gap: 6px; }
.pop-msg-action { background: none; border: none; color: var(--text-3); font-size: 14px; cursor: pointer; padding: 3px; transition: color .12s; }
.pop-msg-action:hover { color: var(--text); }
.pop-send-btn { margin-left: auto; background: var(--accent-btn-bg); color: var(--accent-btn-c); border: none; border-radius: 7px; padding: 5px 12px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: opacity .15s; }
.pop-send-btn:hover { opacity: .88; }
.pop-bottom { display: flex; align-items: center; padding: 9px 14px; gap: 0; flex-wrap: wrap; }
.pop-action-link { font-size: 12px; color: var(--text-2); cursor: pointer; transition: color .12s; padding: 3px 7px; border-radius: 6px; }
.pop-action-link:hover { color: var(--text); background: var(--hover-bg); }
.pop-contact-btn { margin-left: auto; background: var(--accent-btn-bg); color: var(--accent-btn-c); border: none; border-radius: 7px; padding: 5px 14px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: opacity .15s; }
.pop-contact-btn:hover { opacity: .88; }

/* ═══════════════════════════════════════════════
   MODALS (New Contact + Delete Confirm)
═══════════════════════════════════════════════ */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: var(--modal-overlay);
  align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: var(--content-bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 520px; max-width: 95vw; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .2s ease;
}
.modal-box.sm { width: 400px; }
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(8px); } }
.modal-header { display: flex; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid var(--border-light); gap: 10px; flex-shrink: 0; }
.modal-header h3 { font-size: 16px; font-weight: 700; flex: 1; letter-spacing: -.2px; }
.modal-close { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--text-2); font-size: 16px; cursor: pointer; transition: all .12s; }
.modal-close:hover { background: var(--hover-bg); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border-light); flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; font-family: 'Plus Jakarta Sans', sans-serif; }
.btn-primary { background: var(--accent-btn-bg); color: var(--accent-btn-c); }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: var(--input-bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--hover-bg); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ═══════════════════════════════════════════════
   FORM COMPONENTS
═══════════════════════════════════════════════ */
.form-section { padding: 24px; border-top: 1px solid var(--border-light); }
.form-section-title { font-size: 14px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 7px; }
.form-section-title i { color: var(--text-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.form-label span { color: #ef4444; margin-left: 2px; }
.form-control {
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13.5px; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.form-control::placeholder { color: var(--text-3); }
textarea.form-control { resize: vertical; min-height: 80px; font-family: 'Plus Jakarta Sans', sans-serif; }
select.form-control { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type=checkbox] { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border); cursor: pointer; accent-color: var(--accent-btn-bg); }
.form-check input[type=radio] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent-btn-bg); }
.form-check-label { font-size: 13.5px; }
.form-hint { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { width: 40px; height: 22px; border-radius: 99px; background: var(--border); border: none; cursor: pointer; position: relative; transition: background .2s; flex-shrink: 0; }
.toggle.on { background: var(--accent-btn-bg); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle.on .toggle-thumb { transform: translateX(18px); }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.input-group { display: flex; }
.input-group .form-control { border-radius: 8px 0 0 8px; flex: 1; }
.input-group .input-addon { display: flex; align-items: center; padding: 8px 12px; background: var(--border); border: 1px solid var(--border); border-left: none; border-radius: 0 8px 8px 0; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.range-wrap { display: flex; flex-direction: column; gap: 4px; }
.range-wrap input[type=range] { width: 100%; accent-color: var(--accent-btn-bg); cursor: pointer; }
.range-val { font-size: 12px; color: var(--text-2); text-align: right; }
.badge-group { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-gray { background: #f1f2f6; color: #5b6478; }
[data-theme="dark"] .badge-blue   { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .badge-green  { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-amber  { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .badge-red    { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-purple { background: #2e1065; color: #d8b4fe; }
[data-theme="dark"] .badge-gray { background: #2a2f3a; color: #c3c9d6; }

/* ═══════════════════════════════════════════════
   COMPACT SUMMARY BAR (from image 2)
═══════════════════════════════════════════════ */
.summary-section { padding: 16px 14px 14px; }
.summary-tabs { display: flex; align-items: center; gap: 0; margin-bottom: 12px; border-bottom: 1px solid var(--border-light); }
.sum-tab { padding: 8px 18px; font-size: 13.5px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s; white-space: nowrap; }
.sum-tab:hover { color: var(--text); }
.sum-tab.active { color: var(--tab-active-c); border-bottom-color: var(--tab-active-border); font-weight: 500; }
.summary-bar { display: flex; background: var(--summary-bg); border: 1px solid var(--summary-border); border-radius: 10px; overflow: hidden; }
.sum-cell { flex: 1; min-width: 100px; padding: 14px 16px; border-right: 1px solid var(--summary-border); position: relative; transition: background .12s; }
.sum-cell:hover { background: var(--hover-bg); }
.sum-cell:last-child { border-right: none; }
.sum-cell-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: 6px; }
.sum-val { font-size: 20px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.sum-lbl { font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-2); margin: 3px 0 4px; }
.sum-sub { font-size: 11px; color: var(--text-2); }
.sum-sub.warn { color: #dc2626; }
[data-theme="dark"] .sum-sub.warn { color: #f87171; }
.sum-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 3px; }

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════ */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--content-bg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); min-width: 280px; max-width: 360px; pointer-events: all; animation: toastIn .3s ease; transition: opacity .3s, transform .3s; }
.toast.hide { opacity: 0; transform: translateX(20px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }
.toast-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 600; }
.toast-msg { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.toast-close { background: none; border: none; color: var(--text-3); font-size: 14px; cursor: pointer; padding: 0; flex-shrink: 0; margin-top: 1px; transition: color .12s; }
.toast-close:hover { color: var(--text); }
.toast-bar { position: absolute; bottom: 0; left: 0; height: 2px; border-radius: 0 0 10px 10px; animation: toastBar linear forwards; }
.toast { position: relative; overflow: hidden; }
@keyframes toastBar { from { width: 100%; } to { width: 0; } }
/* toast types */
.toast-success .toast-icon { background: #dcfce7; color: #15803d; }
.toast-success .toast-bar { background: #22c55e; }
[data-theme="dark"] .toast-success .toast-icon { background: #14532d; color: #86efac; }
.toast-error .toast-icon { background: #fee2e2; color: #b91c1c; }
.toast-error .toast-bar { background: #ef4444; }
[data-theme="dark"] .toast-error .toast-icon { background: #450a0a; color: #fca5a5; }
.toast-warning .toast-icon { background: #fef3c7; color: #92400e; }
.toast-warning .toast-bar { background: #f59e0b; }
[data-theme="dark"] .toast-warning .toast-icon { background: #451a03; color: #fcd34d; }
.toast-info .toast-icon { background: #dbeafe; color: #1d4ed8; }
.toast-info .toast-bar { background: #3b82f6; }
[data-theme="dark"] .toast-info .toast-icon { background: #1e3a5f; color: #93c5fd; }

/* ═══════════════════════════════════════════════
   SIDEBAR OVERLAY
═══════════════════════════════════════════════ */
#sb-overlay { display: none; position: fixed; inset: 0; z-index: 199; background: rgba(0,0,0,.4); }

/* ═══════════════════════════════════════════════
   MOBILE
═══════════════════════════════════════════════ */
@media(max-width: 768px) {
  #sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); z-index: 300; }
  #sidebar.mob-open { transform: translateX(0); }
  #sb-overlay.show { display: block; }
  .tb-mob-toggle { display: flex; }
  .stat-cards { gap: 8px; padding: 10px 10px 0; }
  .stat-card { min-width: 110px; }
  .content-inner { margin: 10px; }
  .inline-stats { padding: 12px 14px; }
  .is-cell { min-width: 95px; padding-right: 14px; margin-right: 14px; }
  .adv-search { gap: 6px; }
  .ph-right { display: none; }
  #popup { width: 280px; }
  .summary-bar { flex-wrap: wrap; }
  .sum-cell { min-width: 45%; }
  .modal-box { max-height: 95vh; }
}

/* ═══════════════════════════════════════════════
   FADE IN
═══════════════════════════════════════════════ */
.fade-in { opacity: 0; animation: fi .32s ease forwards; }
.fade-in:nth-child(1)  { animation-delay:.03s } .fade-in:nth-child(2)  { animation-delay:.06s }
.fade-in:nth-child(3)  { animation-delay:.09s } .fade-in:nth-child(4)  { animation-delay:.12s }
.fade-in:nth-child(5)  { animation-delay:.15s } .fade-in:nth-child(6)  { animation-delay:.18s }
.fade-in:nth-child(7)  { animation-delay:.21s } .fade-in:nth-child(8)  { animation-delay:.24s }
.fade-in:nth-child(9)  { animation-delay:.27s } .fade-in:nth-child(10) { animation-delay:.30s }
@keyframes fi { from { opacity:0; transform:translateY(5px) } to { opacity:1; transform:none } }

/* ═══════════════════════════════════════════════
   ═══════════════════════════════════════════════
   NEW COMPONENTS — ported from _admin2
   (theme color definitions intentionally NOT touched;
   these components consume the existing --var() palette)
   ═══════════════════════════════════════════════
═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; text-align: center; }
.es-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--input-bg); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--text-3); margin-bottom: 14px; }
.es-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.es-sub { font-size: 13px; color: var(--text-2); max-width: 280px; line-height: 1.5; margin-bottom: 18px; }

/* ═══════════════════════════════════════════════
   AUTOCOMPLETE / TYPEAHEAD
═══════════════════════════════════════════════ */
.ac-wrap { position: relative; }
.ac-input-wrap { display: flex; align-items: center; gap: 8px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; transition: border-color .15s; }
.ac-input-wrap:focus-within { border-color: var(--accent); }
.ac-icon { font-size: 13px; color: var(--text-3); flex-shrink: 0; }
.ac-input { flex: 1; border: none; background: none; outline: none; font-size: 13.5px; color: var(--text); padding: 8px 0; font-family: inherit; }
.ac-list { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--content-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 600; max-height: 220px; overflow-y: auto; padding: 4px; }
.ac-list.open { display: block; }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; color: var(--text); transition: background .12s; }
.ac-item:hover, .ac-item.focused { background: var(--hover-bg); }
.ac-item-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--active-bg); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.ac-item-sub { font-size: 11.5px; color: var(--text-3); }
.ac-highlight { font-weight: 700; color: var(--accent); }
.ac-empty { padding: 14px 12px; font-size: 13px; color: var(--text-3); text-align: center; }

/* ═══════════════════════════════════════════════
   MULTI-SELECT DROPDOWN
═══════════════════════════════════════════════ */
.ms-wrap { position: relative; display: inline-block; }
.ms-btn { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--input-bg); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; min-width: 180px; transition: all .15s; white-space: nowrap; }
.ms-btn:hover { border-color: var(--accent); color: var(--text); }
.ms-count { font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 6px; }
.ms-chevron { font-size: 11px; margin-left: auto; transition: transform .2s; }
.ms-chevron.open { transform: rotate(180deg); }
.ms-drop { display: none; position: absolute; top: calc(100% + 5px); left: 0; min-width: 220px; background: var(--content-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 600; padding: 6px 4px; }
.ms-drop.open { display: block; }
.ms-search { display: flex; align-items: center; gap: 6px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; margin: 0 6px 6px; padding: 5px 8px; }
.ms-search input { border: none; background: none; outline: none; font-size: 12.5px; color: var(--text); width: 100%; font-family: inherit; }
.ms-opt { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); transition: background .12s; }
.ms-opt:hover { background: var(--hover-bg); }
.ms-opt input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; flex-shrink: 0; }
.ms-divider { height: 1px; background: var(--border-light); margin: 4px 8px; }
.ms-footer { display: flex; justify-content: flex-end; gap: 6px; padding: 6px 8px 2px; }

/* ═══════════════════════════════════════════════
   RICH TEXT EDITOR (lightweight, no dependency)
═══════════════════════════════════════════════ */
.rte-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: border-color .15s; }
.rte-wrap:focus-within { border-color: var(--accent); }
.rte-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--input-bg); flex-wrap: wrap; }
.rte-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: none; background: none; border-radius: 6px; cursor: pointer; color: var(--text-2); font-size: 14px; transition: all .12s; }
.rte-btn:hover { background: var(--hover-bg); color: var(--text); }
.rte-btn.active { background: var(--active-bg); color: var(--accent); }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rte-body { min-height: 120px; padding: 12px 14px; font-size: 13.5px; line-height: 1.65; color: var(--text); outline: none; background: var(--content-bg); }
.rte-body:empty::before { content: attr(data-ph); color: var(--text-3); pointer-events: none; }

/* ═══════════════════════════════════════════════
   SIDE DRAWER
═══════════════════════════════════════════════ */
#sd-overlay { display: none; position: fixed; inset: 0; z-index: 700; background: rgba(0,0,0,.35); backdrop-filter: blur(1px); }
#sd-overlay.open { display: block; }
#sd-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 95vw; background: var(--content-bg); border-left: 1px solid var(--border); box-shadow: -8px 0 40px rgba(0,0,0,.14); z-index: 701; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1); }
#sd-panel.open { transform: translateX(0); }
.sd-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sd-title { font-size: 15px; font-weight: 700; flex: 1; }
.sd-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.sd-close { width: 30px; height: 30px; border-radius: 7px; border: none; background: var(--input-bg); color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all .12s; }
.sd-close:hover { background: var(--hover-bg); color: var(--text); }
.sd-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.sd-section { margin-bottom: 20px; }
.sd-section-title { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.sd-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border-light); font-size: 13.5px; }
.sd-row:last-child { border-bottom: none; }
.sd-label { color: var(--text-2); flex-shrink: 0; width: 130px; }
.sd-val { color: var(--text); font-weight: 500; text-align: right; }
.sd-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   BREADCRUMB
═══════════════════════════════════════════════ */
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; flex-wrap: wrap; }
.bc-item { color: var(--text-2); text-decoration: none; transition: color .12s; }
.bc-item:hover { color: var(--accent); }
.bc-item.active { color: var(--text); font-weight: 600; pointer-events: none; }
.bc-sep { color: var(--text-3); font-size: 11px; }

/* ═══════════════════════════════════════════════
   SKELETON LOADER — utility subclasses
   (base .skel + shimmer keyframes already defined in extra.css,
   theme-aware across light/dark/light-dark-nav — reused as-is)
═══════════════════════════════════════════════ */
.skel-title { height: 16px; width: 55%; margin-bottom: 10px; }
.skel-line  { height: 12px; width: 100%; margin-bottom: 8px; }
.skel-line.short { width: 70%; }
.skel-line.xshort { width: 40%; }
.skel-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.skel-badge { height: 20px; width: 60px; border-radius: 99px; }
.skel-col { flex: 1; }
.skel-btn { height: 32px; width: 90px; border-radius: 8px; }

/* ═══════════════════════════════════════════════
   INLINE PROCESS BANNERS
═══════════════════════════════════════════════ */
.proc-banners { display: flex; flex-direction: column; gap: 8px; padding: 0 14px; margin-bottom: 4px; }
.proc-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--content-bg); box-shadow: var(--shadow); font-size: 13px; position: relative; overflow: hidden; }
.proc-banner.ship  { border-left: 3px solid #3b82f6; }
.proc-banner.warn  { border-left: 3px solid #f59e0b; }
.proc-banner.error { border-left: 3px solid #ef4444; }
.proc-banner.ok    { border-left: 3px solid #22c55e; }
.proc-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.proc-banner.ship  .proc-icon { background: #dbeafe; color: #1d4ed8; }
.proc-banner.warn  .proc-icon { background: #fef3c7; color: #92400e; }
.proc-banner.error .proc-icon { background: #fee2e2; color: #b91c1c; }
.proc-banner.ok    .proc-icon { background: #dcfce7; color: #15803d; }
.proc-text { flex: 1; }
.proc-text b { display: block; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.proc-text span { color: var(--text-2); font-size: 12px; }
.proc-prog { width: 100px; height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; flex-shrink: 0; }
.proc-prog-bar { height: 100%; border-radius: 99px; background: #3b82f6; transition: width .4s; }
.proc-banner.warn  .proc-prog-bar { background: #f59e0b; }
.proc-banner.ok    .proc-prog-bar { background: #22c55e; }
.proc-close { background: none; border: none; color: var(--text-3); font-size: 15px; cursor: pointer; padding: 0 0 0 8px; flex-shrink: 0; transition: color .12s; }
.proc-close:hover { color: var(--text); }

/* ═══════════════════════════════════════════════
   CONFIRMATION POPOVER
   (uses the existing .btn / .btn-danger combo — no standalone
   .btn-danger redefinition, so button colors stay as-is)
═══════════════════════════════════════════════ */
#conf-pop { display: none; position: fixed; z-index: 800; background: var(--content-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 14px 16px; width: 210px; }
#conf-pop.open { display: block; }
#conf-pop::before { content: ''; position: absolute; top: -6px; left: 20px; width: 10px; height: 10px; background: var(--content-bg); border-left: 1px solid var(--border); border-top: 1px solid var(--border); transform: rotate(45deg); }
.conf-msg { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.conf-sub { font-size: 12px; color: var(--text-2); margin-bottom: 12px; line-height: 1.4; }
.conf-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ═══════════════════════════════════════════════
   PROFILE DROPDOWN
═══════════════════════════════════════════════ */
.prof-wrap { position: relative; }
.prof-btn { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 9px; transition: background .13s; }
.prof-btn:hover { background: var(--hover-bg); }
.prof-av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.prof-info { text-align: left; line-height: 1.25; }
.prof-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.prof-role { font-size: 11px; color: var(--text-3); }
.prof-chev { font-size: 11px; color: var(--text-3); transition: transform .2s; }
.prof-chev.open { transform: rotate(180deg); }
.prof-drop { display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 220px; background: var(--content-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 650; padding: 6px; }
.prof-drop.open { display: block; }
.prof-drop-header { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.prof-drop-av { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.prof-drop-divider { height: 1px; background: var(--border-light); margin: 2px 0; }
.prof-drop-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); transition: background .12s; }
.prof-drop-item:hover { background: var(--hover-bg); color: var(--text); }
.prof-drop-item.danger { color: #dc2626; }
.prof-drop-item.danger:hover { background: #fee2e2; }
.prof-drop-item i { font-size: 14px; width: 16px; }

/* notification count badge — additive; existing .tb-notif-dot is untouched */
.tb-notif-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; line-height: 1; pointer-events: none; }

/* ═══════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════ */
.tab-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tab-bar { display: flex; gap: 2px; padding: 8px 8px 0; background: var(--input-bg); border-bottom: 1px solid var(--border); }
.tab-btn { background: none; border: none; padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; border-radius: 7px 7px 0 0; transition: all .15s; display: flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; font-family: inherit; }
.tab-btn:hover { background: var(--hover-bg); color: var(--text); }
.tab-btn.active { background: var(--content-bg); color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-count { font-size: 11px; font-weight: 700; background: var(--active-bg); color: var(--accent); border-radius: 99px; padding: 1px 6px; }
.tab-btn.active .tab-count { background: var(--accent); color: #fff; }
.tab-body { padding: 16px; background: var(--content-bg); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
/* Vertical variant: for a tab set too long or too wordy for one horizontal row
   (a settings screen with nine sections). Same tokens, same .tab-count. */
.tab-rail { display: flex; flex-direction: column; gap: 2px; }
.tab-rail .tab-btn { border-radius: 8px; border-bottom: 0; border-left: 2px solid transparent; justify-content: flex-start; text-align: left; width: 100%; }
.tab-rail .tab-btn.active { border-bottom-color: transparent; border-left-color: var(--accent); background: var(--active-bg); }
.tab-stat { background: var(--input-bg); border-radius: 8px; padding: 12px 14px; }
.tab-stat-val { font-size: 18px; font-weight: 700; color: var(--text); }
.tab-stat-lbl { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.tab-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 8px; background: var(--input-bg); }

/* ═══════════════════════════════════════════════
   QUICK DATE-RANGE PICKER DROPDOWN
   (drop-in next to any .adv-date pair)
═══════════════════════════════════════════════ */
.dr-wrap { position: relative; }
.dr-btn { display: flex; align-items: center; justify-content: center; padding: 0 8px; height: 32px; border-radius: 7px; border: 1px solid var(--border); background: var(--input-bg); font-size: 12px; color: var(--text-2); cursor: pointer; transition: all .15s; }
.dr-btn:hover { background: var(--hover-bg); color: var(--accent); border-color: var(--accent); }
.dr-arrow { font-size: 10px; transition: transform .2s; }
.dr-arrow.open { transform: rotate(180deg); }
.dr-drop { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--content-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 150px; z-index: 500; padding: 4px; }
.dr-drop.open { display: block; }
.dr-item { padding: 7px 12px; font-size: 13px; color: var(--text-2); border-radius: 6px; cursor: pointer; transition: background .12s; }
.dr-item:hover { background: var(--hover-bg); color: var(--text); }
.dr-item.active { background: var(--active-bg); color: var(--accent); font-weight: 500; }

/* ═══════════════════════════════════════════════
   AJAX LOADING OVERLAY
═══════════════════════════════════════════════ */
#ajax-loader { display: none; position: fixed; inset: 0; z-index: 8000; background: rgba(0,0,0,.35); backdrop-filter: blur(2px); align-items: center; justify-content: center; }
#ajax-loader.show { display: flex; }
.ajax-spinner { width: 44px; height: 44px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--accent); border-radius: 50%; animation: ajax-spin .7s linear infinite; }
@keyframes ajax-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   RESPONSIVE — additions for the new components above
   (existing MOBILE section above is untouched)
═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .prof-info, .prof-chev { display: none; }
  #page-headline-bar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 14px; }
  /* Too narrow for one line: stack the subtitle again and drop the divider dot. */
  .ph-left { flex-direction: column; align-items: flex-start; gap: 1px; }
  .ph-left .ph-title { white-space: normal; }
  .ph-left .ph-sub::before { content: none; }
  .filters-bar { flex-wrap: wrap; }
  #sd-panel { width: 100vw; }
  .form-grid { grid-template-columns: 1fr; }
  .ms-drop { min-width: 160px; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .tb-search { display: none; }
}

/* ═══════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════ */
@media print {
  #sidebar, #topbar, #page-headline-bar, .filters-bar, .adv-search,
  .dt-footer, .ph-right, #ajax-loader, #toast-container,
  #sd-overlay, #sd-panel, #conf-pop, #popup, .modal-backdrop,
  .proc-banners, .tb-mob-toggle { display: none !important; }
  #shell { display: block; }
  #main { width: 100%; }
  #content-area { padding: 0; gap: 12px; }
  .content-inner { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .stat-cards { grid-template-columns: repeat(4,1fr); }
  body { background: #fff; color: #000; }
}
