/* ═══════════════════════════════════════════════
   ROOT TOKENS
═══════════════════════════════════════════════ */
:root {
    --bg-deep:   #05091a;
    --bg-mid:    #0a1228;
    --surface:   #ffffff;
    --surface-2: #f7f9fc;
    --surface-3: #eef2f8;
    --border:    #dde3ee;
    --text:      #0f172a;
    --text-2:    #374151;
    --muted:     #64748b;
    --primary:   #2563eb;
    --primary-d: #1d4ed8;
    --violet:    #7c3aed;
    --teal:      #0f766e;
    --cyan:      #0891b2;
    --danger:    #dc2626;
    --danger-d:  #b91c1c;
    --orange:    #ea580c;
    --success:   #16a34a;
    --gold:      #d97706;
    --r-xl: 24px;
    --r-lg: 18px;
    --r-md: 12px;
    --r-sm: 8px;
    --sh-card: 0 4px 6px -1px rgba(0,0,0,.06), 0 10px 24px -4px rgba(0,0,0,.08);
    --sh-lift: 0 12px 32px -6px rgba(0,0,0,.14), 0 4px 8px -2px rgba(0,0,0,.08);
    --sh-hero: 0 32px 80px rgba(5,9,26,.3);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    direction: rtl;
    color: var(--text);
    background:
        radial-gradient(ellipse 70% 50% at 90% 5%,  rgba(37,99,235,.35) 0%, transparent 60%),
        radial-gradient(ellipse 55% 45% at  5% 90%, rgba(124,58,237,.28) 0%, transparent 55%),
        radial-gradient(ellipse 40% 35% at 50% 50%, rgba(8,145,178,.12) 0%, transparent 60%),
        linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
    background-attachment: fixed;
}

/* ═══════════════════════════════════════════════
   PAGE SHELL
═══════════════════════════════════════════════ */
.page-shell {
    width: min(1480px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 60px;
}

/* ═══════════════════════════════════════════════
   MARQUEE (شريط العرض)
═══════════════════════════════════════════════ */
#status-marquee {
    width: 100%;
    height: 44px;
    color: #fff;
    font-size: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
    overflow: hidden;
    font-weight: 700;
    box-shadow: 0 4px 24px rgba(0,0,0,.35);
    background: #1a56db;
}
.scrolling-text {
    position: absolute;
    top: 0;
    left: 0;
    height: 44px;
    line-height: 44px;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    padding: 0 24px;
    will-change: transform;
}

.color-input {
    width: 100%;
    height: 42px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: #fff;
    cursor: pointer;
}

.display-color-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    direction: ltr;
    font-weight: 800;
}

.color-chip {
    width: 18px;
    height: 18px;
    display: inline-block;
    border-radius: 4px;
    border: 1px solid rgba(15, 23, 42, .25);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

/* ═══════════════════════════════════════════════
   LOGIN CARD
═══════════════════════════════════════════════ */
.login-container, .dashboard-container { display: none; }
.login-container.active { display: block; }
.dashboard-container.active { display: flex; }

.login-container {
    width: min(440px, 100%);
    margin: 10vh auto 0;
    padding: 40px 36px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.5);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-hero);
    backdrop-filter: blur(20px);
}
.login-card-header { text-align: center; margin-bottom: 28px; }
.login-card-header h1 { margin: 10px 0 10px; font-size: 2rem; color: var(--text); }
.login-card-header p  { color: var(--muted); line-height: 1.8; font-size: .95rem; }
.login-form-grid { display: grid; gap: 14px; }

/* ═══════════════════════════════════════════════
   DASHBOARD SHELL
═══════════════════════════════════════════════ */
.dashboard-container {
    background: transparent;
    flex-direction: column;
    gap: 20px;
}

/* ═══════════════════════════════════════════════
   HERO BAR
═══════════════════════════════════════════════ */
.dashboard-hero {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    align-items: center;
    padding: 22px 28px;
    border-radius: var(--r-xl);
    background: linear-gradient(130deg, #0f172a 0%, #1e3a8a 45%, #4c1d95 100%);
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: var(--sh-hero);
    position: relative;
    overflow: hidden;
}
.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 0% 50%, rgba(255,255,255,.07), transparent),
        radial-gradient(circle at 95% 10%, rgba(96,165,250,.15), transparent 35%);
    pointer-events: none;
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero h1 {
    margin: 6px 0 6px;
    font-size: 1.9rem;
    color: #fff;
    font-weight: 800;
    letter-spacing: -.02em;
}
.hero-subtitle {
    color: rgba(255,255,255,.72);
    line-height: 1.7;
    font-size: .9rem;
    max-width: 600px;
}
.hero-badges {
    display: flex;
    gap: 10px;
}
.hero-badge {
    padding: 10px 18px;
    border-radius: 14px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    text-align: center;
    min-width: 110px;
}
.hero-badge span   { display: block; font-size: 11px; color: rgba(255,255,255,.65); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .06em; }
.hero-badge strong { display: block; font-size: .92rem; color: #fff; font-weight: 700; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.dashboard-hero .eyebrow { background: rgba(255,255,255,.14); color: #bfdbfe; }
.data-section .eyebrow   { background: rgba(37,99,235,.1); color: var(--primary); }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 20px;
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    font-size: .92rem;
    font-weight: 700;
    transition: transform .2s, box-shadow .2s, filter .2s;
    white-space: nowrap;
}
button:hover  { transform: translateY(-2px); filter: brightness(1.05); }
button:active { transform: translateY(0);    filter: brightness(.97);  }

.btn-primary  { color:#fff; background:linear-gradient(135deg,var(--primary) 0%,var(--violet) 100%); box-shadow:0 6px 18px rgba(37,99,235,.3); }
.btn-secondary{ color:#fff; background:linear-gradient(135deg,var(--teal) 0%,var(--cyan) 100%);     box-shadow:0 6px 18px rgba(8,145,178,.3); }
.btn-danger   { color:#fff; background:linear-gradient(135deg,var(--danger) 0%,var(--danger-d) 100%); box-shadow:0 6px 18px rgba(220,38,38,.3); }
.btn-print    { color:#fff; background:linear-gradient(135deg,var(--orange) 0%,var(--gold) 100%);   box-shadow:0 6px 18px rgba(234,88,12,.28); }
.logout-btn   { color:#fff; background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.18); backdrop-filter:blur(8px); align-self: center; }
.logout-btn:hover { background:rgba(255,255,255,.2); }
.btn-block { width: 100%; }

/* ═══════════════════════════════════════════════
   INPUTS & SELECTS
═══════════════════════════════════════════════ */
input, select {
    width: 100%;
    padding: 11px 14px;
    font-size: .92rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
input::placeholder { color: var(--muted); }

/* ═══════════════════════════════════════════════
   ADMIN LAYOUT — 3 columns
═══════════════════════════════════════════════ */
.admin-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

/* ═══════════════════════════════════════════════
   PANEL CARD
═══════════════════════════════════════════════ */
.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 22px;
    box-shadow: var(--sh-card);
    position: relative;
    overflow: hidden;
}
.panel-card::before {
    content: "";
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--violet));
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.panel-card:nth-child(2)::before { background: linear-gradient(90deg, var(--violet), #9333ea); }
.panel-card.telegram-settings-panel::before { background: linear-gradient(90deg, #0ea5e9, #06b6d4); }

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.panel-title-row h2 { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.panel-chip {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

/* inner two-col grid inside a panel */
.card-grid.two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.form-card {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px;
}
.form-card-danger { background: #fff5f5; border-color: #fecaca; }
.form-card h3 { margin-bottom: 14px; font-size: .95rem; font-weight: 800; color: var(--text-2); }
.stack-form { display: grid; gap: 11px; }

/* ═══════════════════════════════════════════════
   TELEGRAM PANEL
═══════════════════════════════════════════════ */
.telegram-settings-panel {
    background: linear-gradient(160deg, #fff 0%, #f0f9ff 100%);
    border: 1px solid #bae6fd;
    box-shadow: 0 8px 28px rgba(14,165,233,.1);
}
.telegram-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.telegram-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
}
.telegram-status-dot {
    width: 13px; height: 13px;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 35%, #67e8f9, #0284c7);
    box-shadow: 0 0 0 5px rgba(14,165,233,.12);
}
.telegram-grid {
    display: grid;
    grid-template-columns: minmax(0,1.3fr) minmax(240px,.7fr);
    gap: 14px;
    align-items: start;
}
.telegram-card-main { background: #fff; border-color: #bae6fd; }
.telegram-card-note {
    background: linear-gradient(160deg, #f8fdff 0%, #eff8ff 100%);
    border: 1.5px dashed #7dd3fc;
    border-radius: var(--r-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.telegram-card-note h3 { margin-bottom: 10px; color: var(--text); font-size: .95rem; }
.panel-help { color: var(--muted); line-height: 1.9; font-size: .88rem; }
.telegram-settings-form { gap: 12px; }
.telegram-label { display: block; margin-bottom: -2px; color: var(--text); font-size: .85rem; font-weight: 800; }
.telegram-input { border-color: #7dd3fc; }
.telegram-input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.telegram-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background: #ecfeff;
    color: #0f766e;
    border: 1px solid #a5f3fc;
    font-size: .88rem;
    font-weight: 700;
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* ═══════════════════════════════════════════════
   DATA SECTIONS
═══════════════════════════════════════════════ */
.data-section { display: flex; flex-direction: column; gap: 16px; }

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.section-heading-row h2 { margin: 6px 0 0; font-size: 1.25rem; font-weight: 800; color: #fff; }
.section-heading-row .eyebrow { background: rgba(255,255,255,.14); color: #bfdbfe; }

/* ═══════════════════════════════════════════════
   FILTER CARD
═══════════════════════════════════════════════ */
.filter-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-xl);
    padding: 20px 22px;
    box-shadow: var(--sh-card);
}
.filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1.5px solid var(--surface-3);
}
.filter-card-header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-card-header h3::before {
    content: "";
    display: inline-block;
    width: 4px; height: 18px;
    background: linear-gradient(180deg, var(--primary), var(--violet));
    border-radius: 2px;
}
.filter-card-header p { font-size: .83rem; color: var(--muted); margin-top: 3px; }

/* section-heading-mini used inside filter card (legacy) */
.section-heading-mini { margin-bottom: 14px; }
.section-heading-mini h3 { font-size: 1rem; font-weight: 800; color: var(--text); }
.section-heading-mini p  { margin-top: 4px; font-size: .83rem; color: var(--muted); }

.filter-container {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}
.filter-item { display: grid; gap: 6px; }
.filter-item label {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding-inline: 2px;
}
.dept-fixed-badge {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(124,58,237,.08));
    border: 1.5px solid rgba(37,99,235,.2);
    color: var(--primary);
    font-weight: 800;
    font-size: .9rem;
    cursor: default;
    user-select: none;
}

/* ═══════════════════════════════════════════════
   TABLE CARD
═══════════════════════════════════════════════ */
.table-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-card);
    overflow: hidden;
}
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 700px; }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}
thead tr { background: linear-gradient(130deg, #1d4ed8 0%, #6d28d9 100%); }
th {
    padding: 14px 16px;
    text-align: center;
    color: #fff;
    font-weight: 700;
    font-size: .88rem;
    letter-spacing: .03em;
    white-space: nowrap;
}
td {
    padding: 13px 16px;
    text-align: center;
    border-bottom: 1px solid #f0f4fb;
    font-size: .9rem;
    color: var(--text-2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--surface-2); }
tbody tr:hover { background: #eef4ff; transition: background .18s; }
.status-endorsed { background-color: #dcfce7 !important; color: #166534; }

/* bold key columns */
#statusesTable td:nth-child(1),
#statusesTable td:nth-child(2),
#employeesTable td:nth-child(1) {
    font-weight: 700;
    color: var(--text);
}

/* ═══════════════════════════════════════════════
   LOADING & MESSAGE
═══════════════════════════════════════════════ */
.loading {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    padding: 14px 28px;
    border-radius: var(--r-lg);
    background: rgba(15,23,42,.92);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 16px 32px rgba(0,0,0,.25);
    z-index: 1100;
    backdrop-filter: blur(12px);
}
.empty-row {
    text-align: center;
    color: var(--muted);
    padding: 24px !important;
    font-size: .9rem;
}
.message-box {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background: #fff1f2;
    color: #be123c;
    font-weight: 700;
    font-size: .88rem;
    min-height: 18px;
}

/* ═══════════════════════════════════════════════
   PRINT BUTTON WRAPPER
═══════════════════════════════════════════════ */
#printButtonContainer .btn-secondary {
    background: linear-gradient(135deg, var(--orange) 0%, var(--gold) 100%);
    box-shadow: 0 6px 18px rgba(234,88,12,.28);
}

/* ═══════════════════════════════════════════════
   MANAGEMENT PANEL — TABS
═══════════════════════════════════════════════ */
.mgmt-panel {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-card);
    overflow: hidden;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    background: var(--surface-2);
    border-bottom: 1.5px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 8px;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 15px 22px;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
    border-bottom: 3px solid transparent;
    margin-bottom: -1.5px;
    box-shadow: none;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
}
.tab-btn:hover  { color: var(--primary); transform: none; filter: none; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }

/* Tab Panes */
.tab-pane         { display: none; padding: 22px; }
.tab-pane.active  { display: block; }

/* Tab Layout: form | table */
.tab-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
    align-items: start;
}

.tab-form-card {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
}
.tab-form-card h3 {
    font-size: .98rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
}
.dept-note {
    margin-top: 14px;
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.7;
}

.import-panel {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.import-panel input[type="file"] {
    width: 100%;
    padding: 11px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    background: #fff;
    color: var(--text);
}
.import-message {
    margin-top: 10px;
    font-size: .85rem;
    font-weight: 800;
    line-height: 1.6;
}
.import-message.success { color: var(--success); }
.import-message.error { color: var(--danger); }
.import-errors {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding-inline-start: 18px;
    color: var(--danger);
    font-size: .8rem;
    line-height: 1.5;
}

.tab-table-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.tab-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.tab-table-header h3 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--text);
}
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--violet));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}
.tab-table-body { overflow-x: auto; }
.tab-table-body table { min-width: 0; }
.tab-table-body td { font-size: .88rem; }

/* Action Buttons in table rows */
.action-cell { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.btn-edit {
    padding: 5px 13px;
    font-size: .8rem;
    font-weight: 700;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--primary), var(--violet));
    color: #fff;
    box-shadow: none;
}
.btn-del {
    padding: 5px 13px;
    font-size: .8rem;
    font-weight: 700;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--danger), var(--danger-d));
    color: #fff;
    box-shadow: none;
}
.btn-edit:hover, .btn-del:hover { transform: none; filter: brightness(1.1); }

/* Telegram tab special layout */
.telegram-tab-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 18px;
    align-items: start;
}
.telegram-card-note {
    border: 1.5px dashed #7dd3fc;
    background: linear-gradient(160deg, #f8fdff, #eff8ff);
    border-radius: var(--r-lg);
    padding: 20px;
}
.telegram-card-note h3 { margin-bottom: 10px; font-weight: 800; }

/* ═══════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5,9,26,.55);
    z-index: 2000;
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: 0 32px 80px rgba(5,9,26,.35);
    width: min(460px, calc(100% - 32px));
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modal-in {
    from { transform: scale(.92) translateY(16px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.modal-close {
    width: 32px; height: 32px; padding: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 1.3rem;
    line-height: 1;
    box-shadow: none;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--surface-3); transform: none; filter: none; }
.modal-body { padding: 22px; }
.modal-body .stack-form { gap: 14px; }
.field-label {
    display: block;
    font-size: .83rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 5px;
}
.modal-hint {
    font-size: .8rem;
    color: var(--muted);
    margin-top: -6px;
}
.dept-checkboxes-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    min-height: 42px;
}
.dept-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
.dept-checkbox-item input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.app-footer {
    text-align: center;
    padding: 18px 0 28px;
    font-size: .78rem;
    color: rgba(255,255,255,.35);
    letter-spacing: .04em;
}
.app-footer strong {
    color: rgba(255,255,255,.6);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .filter-container { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .telegram-tab-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .tab-layout { grid-template-columns: 1fr; }
    .telegram-tab-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .dashboard-hero { grid-template-columns: 1fr; gap: 14px; }
    .hero-badges { flex-wrap: wrap; }
    .filter-container { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .section-heading-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
    .page-shell { width: calc(100% - 20px); padding: 20px 0 40px; }
    .dashboard-hero { padding: 16px; }
    .dashboard-hero h1 { font-size: 1.5rem; }
    .filter-card, .table-card { border-radius: var(--r-lg); }
    .tab-pane { padding: 16px; }
    .filter-container { grid-template-columns: 1fr; }
    .action-cell { flex-direction: column; gap: 4px; }
    #status-marquee { width: 100%; top: 0; }
}

.whatsapp-card-main,
.whatsapp-qr-card {
    border-color: #86efac;
}
.whatsapp-badge {
    background: #dcfce7;
    color: #15803d;
}
.whatsapp-status-dot {
    background: #f59e0b;
}
.whatsapp-status-dot.connected {
    background: #16a34a;
    box-shadow: 0 0 0 6px rgba(22,163,74,.12);
}
.whatsapp-status-text {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: #f8fafc;
    color: var(--text);
    font-weight: 800;
    margin-bottom: 14px;
}
.whatsapp-qr-box {
    min-height: 250px;
    display: grid;
    place-items: center;
    padding: 16px;
    border: 1.5px dashed #86efac;
    border-radius: var(--r-lg);
    background: #f0fdf4;
    text-align: center;
    color: var(--muted);
}
.whatsapp-qr-box img {
    width: min(260px, 100%);
    height: auto;
    border-radius: var(--r-md);
    background: #fff;
    padding: 10px;
}
.whatsapp-message.success { color: var(--success); }
.whatsapp-message.error { color: var(--danger); }
.whatsapp-setup-help {
    display: grid;
    gap: 7px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #bbf7d0;
    border-radius: var(--r-md);
    background: #f8fffb;
    color: var(--text);
    font-size: .82rem;
}
.whatsapp-setup-help code {
    display: block;
    direction: ltr;
    text-align: left;
    padding: 7px 9px;
    border-radius: var(--r-md);
    background: #0f172a;
    color: #e2e8f0;
    font-family: Consolas, Monaco, monospace;
    white-space: nowrap;
    overflow-x: auto;
}
