/* ============================================================
   SignOn 2000 — CEO Dashboard
   Design System: Matching bodyshop/paint user pages
   ============================================================ */

/* ====== LOGIN OVERLAY ====== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: linear-gradient(135deg, #0a1628 0%, #1a2744 50%, #0d1f3c 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    transition: opacity 0.5s ease;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.login-overlay.hidden { display: none; }
html.login-active,
body.login-active {
    overflow: hidden;
    height: 100%;
    position: fixed;
    width: 100%;
}
body.login-active .app-container { visibility: hidden; }
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px 40px;
    width: 340px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
    animation: loginSlideUp 0.5s ease;
}
@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-logo {
    width: 180px;
    margin: 0 auto 8px;
    display: block;
}
.login-subtitle {
    font-size: 13px;
    color: #6A7282;
    font-weight: 500;
    margin-bottom: 28px;
    letter-spacing: 0.5px;
}
.login-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 14px;
    border: 3px solid #2D7BF3;
    box-shadow: 0 4px 15px rgba(45,123,243,0.25);
}
.login-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.login-welcome {
    font-size: 18px;
    font-weight: 700;
    color: #1a2744;
    margin-bottom: 24px;
}
.login-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}
.login-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Noto Sans Hebrew', sans-serif;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    direction: ltr;
}
.login-input:focus {
    border-color: #2D7BF3;
    box-shadow: 0 0 0 3px rgba(45,123,243,0.1);
}
.login-submit-btn {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 12px;
    background: #2D7BF3;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}
.login-submit-btn:hover { background: #0059D1; }
.login-submit-btn:active { transform: scale(0.95); }
.login-submit-btn svg { width: 20px; height: 20px; }
.login-error {
    color: #F9513F;
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
    font-weight: 500;
}

/* ====== RESET & BASE ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --dark: #364153;
    --gray: #6A7282;
    --blue: #2D7BF3;
    --blue-brand: #2D7BF3;
    --blue-light: #CCE5FF;
    --green: #28CDA5;
    --green-bg: #ECFDF5;
    --red: #F9513F;
    --red-bg: #FEF2F2;
    --purple: #7C3AED;
    --purple-bg: #EDE9FE;
    --bg: #F5F5F5;
    --bg-soft: #F8FAFF;
    --card: #ffffff;
    --text: #364153;
    --text-secondary: #4D4D4E;
    --text-light: #6A7282;
    --border: #E5E7EB;
    --border-card: #ECECEE;
    --shadow: 0 1px 3px rgba(54,65,83,0.06), 0 1px 2px rgba(54,65,83,0.04);
    --shadow-md: 0 4px 12px rgba(54,65,83,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}
body {
    font-family: 'Noto Sans Hebrew', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ====== HEADER ====== */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(54,65,83,0.06);
}
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 21px;
    object-fit: cover;
    border: 2px solid var(--blue-light);
    flex-shrink: 0;
}
.user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.user-role {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--blue-brand);
    line-height: 1.2;
}
.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.greeting {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.header-date {
    font-size: 12px;
    color: var(--text-light);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo {
    height: 26px;
    width: auto;
    flex-shrink: 0;
}
/* ====== TABS NAV ====== */
/* ====== LIQUID GLASS TABS ====== */
.tabs-nav {
    position: sticky;
    top: 67px;
    z-index: 99;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    justify-content: center;
}
.tabs-glass-bar {
    width: 100%;
    max-width: 580px;
    position: relative;
}
.tabs-glass-track {
    display: flex;
    position: relative;
    background: linear-gradient(135deg, rgba(0,0,0,0.035), rgba(0,0,0,0.055));
    border-radius: 16px;
    padding: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06),
                0 0.5px 0 rgba(255,255,255,0.8);
}
.tabs-glass-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 12px;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.85) 0%,
        rgba(255,255,255,0.65) 100%);
    box-shadow: 0 2px 8px rgba(45,123,243,0.12),
                0 0.5px 2px rgba(0,0,0,0.08),
                inset 0 0.5px 0 rgba(255,255,255,0.9);
    transition: left 0.5s cubic-bezier(0.32, 0.72, 0, 1),
                width 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 0;
    pointer-events: none;
}
.tab-btn {
    flex: 1;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 12px;
    font-family: 'Noto Sans Hebrew', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.35s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}
.tab-btn:hover {
    color: var(--text);
}
.tab-btn:active {
    transform: scale(0.97);
}
.tab-btn.active {
    color: var(--blue-brand);
}
.tab-btn img, .tab-btn svg {
    flex-shrink: 0;
    filter: grayscale(1) opacity(0.5);
    transition: filter 0.35s ease;
}
.tab-btn:hover img, .tab-btn:hover svg {
    filter: grayscale(0.3) opacity(0.7);
}
.tab-btn.active img, .tab-btn.active svg {
    filter: none;
}

/* ====== TAB CONTENT ====== */
.tab-content {
    display: none;
    padding: 20px;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ====== SECTIONS ====== */
/* ====== SECTIONS ROW (2 per row) ====== */
.sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
    align-items: stretch;
}
.sections-row .section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}
.sections-row .section .kpi-grid {
    flex: 1;
    grid-auto-rows: 1fr;
}

.section {
    margin-bottom: 24px;
}
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.section-dot-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.13));
}
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

/* ====== CHART ====== */
.chart-container {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-card);
}
.chart-container canvas {
    width: 100% !important;
    max-height: 220px;
}

/* ====== KPI GRID ====== */
.kpi-grid {
    display: grid;
    gap: 14px;
    align-items: stretch;
}
.kpi-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-2 { grid-template-columns: repeat(2, 1fr); }

.kpi-card {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 20px 14px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    position: relative;
    min-height: 120px;
    height: 100%;
    box-sizing: border-box;
}
.kpi-card.clickable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.kpi-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.kpi-card.clickable:active { transform: translateY(0); }
.kpi-card.mini {
    padding: 16px 12px 14px;
    min-height: 120px;
}
.kpi-card.mini .kpi-circle { width: 38px; height: 38px; }
.kpi-card.mini .kpi-circle img { width: 18px; height: 18px; }
.kpi-card.mini .kpi-value { font-size: 26px; }

/* Blue circle icon */
.kpi-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--blue-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-circle img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
}
.kpi-circle.green { background: var(--green); }
.kpi-circle.red { background: var(--red); }

.kpi-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}
.kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
}
.kpi-value {
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
}
.kpi-value.green { color: var(--green); }
.kpi-value.blue { color: var(--blue-brand); }
.kpi-value.purple { color: var(--purple); }
.kpi-value.red { color: var(--red); }
.kpi-value.muted { color: var(--blue-brand); }

.kpi-change {
    font-size: 11.5px;
    font-weight: 600;
}
.kpi-change.up { color: var(--green); }
.kpi-change.down { color: var(--red); }
.kpi-sub {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
    order: 3;
}

/* ====== DEPARTMENT TOGGLES ====== */
.dept-toggles {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.dept-btn {
    padding: 7px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--card);
    font-family: 'Noto Sans Hebrew', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}
.dept-btn:hover {
    border-color: var(--blue-brand);
    color: var(--blue-brand);
}
.dept-btn.active {
    background: var(--blue-brand);
    color: white;
    border-color: var(--blue-brand);
}

/* ====== STATUS GRID ====== */
.status-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.status-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 18px;
    border: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}
.status-card:hover {
    box-shadow: var(--shadow-md);
}
.status-card.highlight {
    background: linear-gradient(135deg, #F0F6FF, #CCE5FF);
    border-color: var(--blue-light);
}
.status-card.hidden {
    display: none;
}
.status-num {
    display: none;
}
.status-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(0, 111, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.status-icon-svg {
    width: 22px;
    height: 22px;
    opacity: 0.7;
    filter: brightness(0) saturate(100%) invert(30%) sepia(90%) saturate(1000%) hue-rotate(200deg) brightness(95%);
}
.status-body { flex: 1; }
.status-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.status-dept {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-light);
}
.status-count {
    font-size: 28px;
    font-weight: 800;
    color: var(--blue-brand);
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
}

/* ====== CALLS GRID (Marketing tab) ====== */
.calls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.calls-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.call-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px 14px;
    border: 1px solid var(--border-card);
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 100px;
}
.call-card:hover { box-shadow: var(--shadow-md); }
.call-card.total {
    background: linear-gradient(135deg, #F0F6FF, #CCE5FF);
    border-color: var(--blue-light);
}
.call-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: auto;
    padding-bottom: 8px;
}
.call-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-top: auto;
}
.call-card.total .call-value { color: var(--blue-brand); }
.call-diff {
    font-size: 11.5px;
    font-weight: 600;
}
.call-diff.up { color: var(--green); }
.call-diff.down { color: var(--red); }

/* ====== TABLE FILTERS ====== */
.table-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filter-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Noto Sans Hebrew', sans-serif;
    font-size: 13px;
    background: var(--card);
    cursor: pointer;
    min-width: 150px;
    color: var(--text);
}
.filter-select:focus { border-color: var(--blue-brand); outline: none; }
.search-mini input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Noto Sans Hebrew', sans-serif;
    font-size: 13px;
    width: 180px;
    direction: rtl;
    color: var(--text);
}
.search-mini input:focus { border-color: var(--blue-brand); outline: none; }

/* ====== CALLS TABLE ====== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border-card);
    background: var(--card);
    max-width: 100%;
}
.calls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}
/* Date+time stacked cell — keeps column width unchanged */
.calls-table td.date-time-cell {
    line-height: 1.15;
    padding-top: 6px;
    padding-bottom: 6px;
}
.calls-table .dt-date {
    display: block;
    white-space: nowrap;
}
.calls-table .dt-time {
    display: block;
    font-size: 10px;
    color: #6B7280;
    margin-top: 2px;
    white-space: nowrap;
}
.day-label {
    font-size: 10px;
    font-weight: 600;
    margin-right: 4px;
}
.day-label.today {
    color: #2D7BF3;
}
.day-label.yesterday {
    color: #E5A300;
}
.calls-table thead {
    background: #F8F9FB;
}
.calls-table th {
    padding: 10px 6px;
    text-align: right;
    font-weight: 600;
    color: var(--text-light);
    font-size: 11px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
}
/* Column widths: #, מקור, תאריך, ממספר, סטטוס, האזנה, טופל */
.calls-table th:nth-child(1),
.calls-table td:nth-child(1) { text-align: center; width: 7%; }
.calls-table th:nth-child(2),
.calls-table td:nth-child(2) { width: 15%; }
.calls-table th:nth-child(3),
.calls-table td:nth-child(3) { width: 20%; }
.calls-table th:nth-child(4),
.calls-table td:nth-child(4) { width: 21%; }
.calls-table th:nth-child(5),
.calls-table td:nth-child(5) { width: 16%; }
.calls-table th:nth-child(6),
.calls-table td:nth-child(6) { text-align: center; width: 13%; }
.calls-table th:nth-child(7),
.calls-table td:nth-child(7) { text-align: center; width: 8%; }

.calls-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #F1F3F5;
    color: var(--text);
    vertical-align: middle;
    white-space: nowrap;
    font-size: 12px;
    overflow: visible;
    text-overflow: ellipsis;
}
.calls-table tbody tr:hover { background: var(--bg-soft); }
.calls-table tbody tr:last-child td { border-bottom: none; }

/* Source badge */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
    background: none;
    color: #364153;
}
.source-badge.tesla { color: #364153; }
.source-badge.paid { color: #364153; }
.source-badge.organic { color: #364153; }
.source-icon { width: 14px; height: 14px; flex-shrink: 0; }

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.status-badge.answered { color: var(--green); }
.status-badge.missed { color: var(--red); }

/* Handled toggle */
.handled-toggle {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border);
    background: var(--card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.handled-toggle.checked {
    background: var(--green);
    border-color: var(--green);
}
.handled-toggle svg {
    width: 12px;
    height: 12px;
    color: white;
    display: none;
}
.handled-toggle.checked svg { display: block; }

/* ====== TABLE FOOTER ====== */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-top: 8px;
}
.table-status {
    font-size: 12.5px;
    color: var(--text-light);
}
.pager {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pager-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-family: 'Noto Sans Hebrew', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}
.pager-btn:hover:not(:disabled) { border-color: var(--blue-brand); color: var(--blue-brand); }
.pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--blue-brand);
    min-width: 24px;
    text-align: center;
}

/* ====== REPORTS LIST ====== */
.reports-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.report-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px 18px;
    border: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s;
}
.report-card:hover { box-shadow: var(--shadow-md); }
.report-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.report-meta {
    font-size: 12px;
    color: var(--text-light);
}
.report-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
}
.report-check input { display: none; }
.checkmark-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: var(--card);
}
.checkmark-icon::after {
    content: '';
    display: none;
}
.report-check input:checked + .checkmark-icon {
    background: var(--green);
    border-color: var(--green);
}
.report-check input:checked + .checkmark-icon::after {
    content: '✓';
    display: block;
    color: white;
    font-size: 13px;
    font-weight: 700;
}
.report-check input:checked ~ span:last-child { color: var(--green); }

/* ====== WHATSAPP SECTION ====== */
.wa-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.wa-block {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 18px;
    border: 1px solid var(--border-card);
}
.wa-block-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.calls-grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}
.call-card.wa {
    border-color: #D1FAE5;
}
.call-card.wa.total {
    background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
    border-color: #6EE7B7;
}
.call-card.wa.total .call-value { color: var(--green); }

/* ====== PLAY BUTTON (Recording) — Table ====== */
.play-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(45,123,243,0.12);
    color: var(--blue-brand);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.play-btn:hover {
    background: rgba(45,123,243,0.25);
    transform: scale(1.1);
}
.play-btn svg {
    width: 15px;
    height: 15px;
}
.rec-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}
.rec-duration {
    font-size: 11px;
    color: #6B7280;
    font-variant-numeric: tabular-nums;
    min-width: 34px;
}

/* ====== CUSTOM AUDIO PLAYER (Modal) ====== */
.custom-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #F8FAFF;
    border-radius: 14px;
    border: 1px solid var(--border);
    margin: 14px 0;
    direction: ltr;
}
.cp-play {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    border: none;
    background: var(--blue-brand);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    box-shadow: 0 2px 8px rgba(45,123,243,0.3);
}
.cp-play:hover { background: #0058CC; transform: scale(1.05); }
.cp-play:active { transform: scale(0.95); }
.cp-play svg { width: 20px; height: 20px; }
.cp-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    min-width: 38px;
    text-align: center;
    user-select: none;
}
.cp-track {
    flex: 1;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    min-width: 80px;
}
.cp-track:hover { height: 10px; }
.cp-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-brand), #5B9CFF);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}
.cp-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--blue-brand);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    left: 0%;
    pointer-events: none;
    transition: left 0.1s linear;
}
.cp-speed {
    font-size: 11px;
    font-weight: 700;
    color: var(--blue-brand);
    background: rgba(45,123,243,0.1);
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    min-width: 32px;
    text-align: center;
}
.cp-speed:hover { background: rgba(45,123,243,0.2); }
.cp-error {
    text-align: center;
    color: var(--red);
    font-size: 13px;
    padding: 12px;
    background: var(--red-bg, #FEF2F2);
    border-radius: 10px;
    margin: 10px 0;
}
.no-rec {
    color: var(--text-light);
    font-size: 11px;
    opacity: 0.5;
}

/* ====== HANDLED READ-ONLY INDICATOR ====== */
.handled-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}
.handled-indicator.yes {
    color: var(--green);
}
.handled-indicator.no {
    color: var(--border);
    font-size: 14px;
}

/* ====== RECORDING MODAL ====== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(54,65,83,0.4);
    z-index: 1000;
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
    animation: modalOverlayIn 0.25s ease;
}
.modal-overlay.closing {
    display: flex;
    animation: modalOverlayOut 0.3s ease forwards;
}
.modal-overlay.closing .client-modal,
.modal-overlay.closing .rec-modal,
.modal-overlay.closing .survey-modal,
.modal-overlay.closing .status-popup-modal {
    animation: modalCardOut 0.3s ease forwards;
}
@keyframes modalOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes modalOverlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes modalCardOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to   { opacity: 0; transform: scale(0.96) translateY(8px); }
}
.rec-modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.rec-modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rec-modal-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.rec-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s;
    padding: 0;
}
.rec-modal-close:hover { background: var(--border); }
.rec-modal-body {
    padding: 20px;
}
.rec-info {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}
.wa-share-btn {
    width: 100%;
    padding: 11px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Noto Sans Hebrew', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.wa-share-btn:hover { background: #1DA851; }

/* ====== CLIENT SUB-TABS ====== */
.client-subtabs {
    display: flex;
    gap: 0;
    background: var(--card);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border-card);
    border-bottom: none;
    overflow: hidden;
    margin-bottom: 16px;
}
.client-subtab-btn {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: 'Noto Sans Hebrew', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.client-subtab-btn:hover {
    color: var(--text);
    background: rgba(45,123,243,0.04);
}
.client-subtab-btn.active {
    color: var(--blue-brand);
    border-bottom-color: var(--blue-brand);
    background: rgba(45,123,243,0.03);
}

/* ====== CLIENTS TABLE (Tab 2) ====== */
.client-count-badge {
    margin-right: auto;
    margin-left: 0;
    background: var(--blue-brand);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    line-height: 1;
}
.clients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.clients-table thead {
    background: #F8F9FB;
}
.clients-table th {
    padding: 10px 10px;
    text-align: right;
    font-weight: 600;
    color: var(--text-light);
    font-size: 11.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.clients-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #F1F3F5;
    color: var(--text);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12.5px;
    cursor: pointer;
}
.clients-table tbody tr:hover { background: var(--bg-soft); }
.clients-table tbody tr:last-child td { border-bottom: none; }

/* Client status pill */
.client-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.client-status-pill .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.client-status-pill .status-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
/* 01 פתיחת כרטיס — ירוק */
.client-status-pill.s-green       { background: #ECFDF5; color: #065F46; }
.client-status-pill.s-green .status-dot { background: #28CDA5; }
/* 02 נקלט במוסך — כחול בהיר */
.client-status-pill.s-blue-1      { background: #F0F6FF; color: #1E40AF; }
.client-status-pill.s-blue-1 .status-dot { background: #60A5FA; }
/* 03 ממתין לחלקים — כחול-טורקיז */
.client-status-pill.s-blue-2      { background: #F0FDFA; color: #115E59; }
.client-status-pill.s-blue-2 .status-dot { background: #14B8A6; }
/* 04 פחחות — כחול אינדיגו */
.client-status-pill.s-blue-3      { background: #EEF2FF; color: #3730A3; }
.client-status-pill.s-blue-3 .status-dot { background: #6366F1; }
/* 05 צבע — כחול סגלגל */
.client-status-pill.s-blue-4      { background: #F5F3FF; color: #5B21B6; }
.client-status-pill.s-blue-4 .status-dot { background: #8B5CF6; }
/* 06 הרכבות — כחול ים */
.client-status-pill.s-blue-5      { background: #ECFEFF; color: #155E75; }
.client-status-pill.s-blue-5 .status-dot { background: #06B6D4; }
/* 07 עבודות חוץ — כחול פלדה */
.client-status-pill.s-blue-6      { background: #F0F9FF; color: #075985; }
.client-status-pill.s-blue-6 .status-dot { background: #0EA5E9; }
/* 08 שטיפה ובקרה — כחול כהה */
.client-status-pill.s-blue-7      { background: #F0F6FF; color: #1E3A5F; }
.client-status-pill.s-blue-7 .status-dot { background: #3B82F6; }
/* 09 מוכן למסירה — כחול-ירוק */
.client-status-pill.s-blue-8      { background: #F0FDF4; color: #166534; }
.client-status-pill.s-blue-8 .status-dot { background: #22C55E; }
/* 10 נמסר — אפור-כחול */
.client-status-pill.s-blue-9      { background: #F8FAFC; color: #475569; }
.client-status-pill.s-blue-9 .status-dot { background: #94A3B8; }
/* 11 אינו לתיקון — אפור */
.client-status-pill.s-cancelled   { background: #F3F4F6; color: #6B7280; }
.client-status-pill.s-cancelled .status-dot { background: #9CA3AF; }
/* תקוע 3+ ימים — כתום */
.client-status-pill.s-stuck-warn  { background: #FEF3C7; color: #92400E; }
.client-status-pill.s-stuck-warn .status-dot { background: #F59E0B; }
/* תקוע 5+ ימים — אדום */
.client-status-pill.s-stuck-danger { background: #FEE2E2; color: #991B1B; }
.client-status-pill.s-stuck-danger .status-dot { background: #F9513F; }

/* Days badge */
.days-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    background: #F1F3F5;
    color: var(--text);
}
.days-badge.warn {
    background: #FEF3C7;
    color: #92400E;
}
.days-badge.danger {
    background: #FEE2E2;
    color: #991B1B;
}

/* ====== CLIENT DETAIL MODAL ====== */
.client-modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    width: 70%;
    max-width: 680px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}
.client-modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
}
.client-modal-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 4px;
}
.client-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Client modal navigation arrows — forced LTR to avoid RTL flip */
.client-modal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    direction: ltr;
}
.client-nav-btn {
    border: 2px solid var(--blue);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    background: #fff;
    color: var(--blue);
}
/* "הבא" (next) = filled blue */
#clientNavNext {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}
/* "הקודם" (prev) = outlined blue */
#clientNavPrev {
    background: #fff;
    color: var(--blue);
    border-color: var(--blue);
}
.client-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #CBD5E1;
    color: #CBD5E1;
    background: #F8FAFC;
}
#clientNavNext:disabled {
    background: #CBD5E1;
    color: #fff;
    border-color: #CBD5E1;
}
.client-nav-counter {
    font-size: 11px;
    color: var(--muted);
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}

/* Client info card inside modal */
.client-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.client-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.client-info-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
}
.client-info-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.client-info-val.client-phone {
    direction: ltr;
    text-align: right;
}
.client-current-status {
    grid-column: 1 / -1;
    padding: 12px 16px;
    background: linear-gradient(135deg, #F0F6FF, #CCE5FF);
    border-radius: var(--radius);
    border: 1px solid var(--blue-light);
    display: flex;
    align-items: center;
    gap: 10px;
}
.client-current-status .cs-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}
.client-current-status .cs-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--blue-brand);
}

/* Timeline */
.timeline-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.timeline {
    position: relative;
    padding-right: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    right: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
    padding-right: 20px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    right: -28px;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.timeline-dot.completed {
    background: var(--green);
    border-color: var(--green);
}
.timeline-dot.completed::after {
    content: '✓';
    color: white;
    font-size: 10px;
    font-weight: 700;
}
.timeline-dot.current {
    background: var(--blue-brand);
    border-color: var(--blue-brand);
    box-shadow: 0 0 0 4px rgba(45,123,243,0.15);
}
.timeline-dot.current::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}
.timeline-dot.pending {
    background: var(--bg);
    border-color: #D1D5DB;
}
.timeline-status {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.timeline-date {
    font-size: 11px;
    color: var(--text-light);
}
.timeline-item.is-current .timeline-status {
    color: var(--blue-brand);
    font-weight: 700;
}



/* ====== SURVEY TAB ====== */
.survey-score-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 8px;
}
.survey-score-circle {
    position: relative;
    width: 120px;
    height: 120px;
}
.survey-score-circle svg {
    width: 100%;
    height: 100%;
}
.survey-score-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--green);
}
.survey-score-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    margin-top: 8px;
}

/* Category bars */
.survey-categories {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.survey-cat-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.survey-cat-label {
    flex: 0 0 130px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}
.survey-cat-bar-wrap {
    flex: 1;
    height: 28px;
    background: #F1F3F5;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}
.survey-cat-bar {
    height: 100%;
    border-radius: 14px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-right: 12px;
}
.survey-cat-bar.excellent { background: linear-gradient(90deg, #28CDA5, #28CDA5); }
.survey-cat-bar.good { background: linear-gradient(90deg, #0D9488, #2DD4BF); }
.survey-cat-bar.average { background: linear-gradient(90deg, #D97706, #F59E0B); }
.survey-cat-bar.poor { background: linear-gradient(90deg, #F9513F, #F9513F); }
.survey-cat-score {
    font-size: 13px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.survey-cat-avg {
    flex: 0 0 44px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

/* Stars in table */
.star-score {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    font-weight: 700;
}
.star-score .star-icon { width: 14px; height: 14px; }
.star-score .star-icon.empty { opacity: 0.2; filter: grayscale(1); }
.not-relevant-label {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 500;
    font-style: italic;
}
.star-score .score-num {
    margin-right: 4px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

/* Survey table tweaks */
.surveys-table td {
    cursor: pointer;
}
.surveys-table tbody tr:hover {
    background: #F0F6FF;
}

/* Survey modal details */
.survey-detail-section {
    margin-bottom: 20px;
}
.survey-detail-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.survey-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.survey-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.survey-detail-item.full-width {
    grid-column: 1 / -1;
}
.survey-detail-item .sd-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
}
.survey-detail-item .sd-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.survey-detail-item .sd-stars {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}
.star-icon-modal { width: 18px; height: 18px; }
.star-icon-modal.empty { opacity: 0.2; filter: grayscale(1); }
.survey-detail-item .sd-raw {
    font-size: 11px;
    color: var(--text-light);
    font-style: italic;
}

/* NPS badge in table */
.nps-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
}
.nps-high { background: #D1FAE5; color: #065F46; }
.nps-mid  { background: #FEF3C7; color: #92400E; }
.nps-low  { background: #FEE2E2; color: #991B1B; }

/* NPS in modal */
.nps-modal-val {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--blue-brand) !important;
}

/* Client button in survey modal */
.survey-client-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--blue-brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.survey-client-btn:hover:not(.disabled) { background: #3570d4; }
.survey-client-btn.disabled {
    background: #E5E7EB;
    color: #9CA3AF;
    cursor: default;
}
.survey-comment-box {
    padding: 12px 14px;
    background: #FFF9E6;
    border: 1px solid #FDE68A;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}
.survey-comment-box .sc-label {
    font-size: 11px;
    font-weight: 600;
    color: #92400E;
    margin-bottom: 4px;
}
.survey-comment-box .sc-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
}
.survey-modal {
    max-width: 580px;
}
/* Survey modal — box grid (client details) */
.survey-box-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.survey-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 12px;
    background: #F3F4F6;
    border-radius: 12px;
    text-align: right;
    overflow: hidden;
}
.survey-box-label {
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
}
.survey-box-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}
.survey-box-value.small-text {
    font-size: 14px;
}
.survey-box-value.client-phone {
    direction: ltr;
    unicode-bidi: bidi-override;
}

/* Survey modal — rating list */
.survey-rating-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.survey-rating-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.survey-rating-row .sr-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    line-height: 1.5;
}
.survey-rating-row .sr-stars {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}
.survey-rating-row .sr-raw {
    font-size: 11px;
    color: var(--text-light);
    font-style: italic;
}
.survey-rating-row .sr-nps {
    display: flex;
    align-items: center;
    gap: 4px;
}
.survey-rating-row .nps-of {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* ====== STATUS POPUP ====== */
.status-popup-modal {
    max-width: 520px;
    max-height: 80vh;
}
.status-popup-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.status-popup-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
    border-radius: 8px;
}
.status-popup-item:last-child {
    border-bottom: none;
}
.status-popup-item:hover {
    background: rgba(45,123,243,0.04);
}
.status-popup-item:active {
    background: rgba(45,123,243,0.08);
}
.status-popup-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.status-popup-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.status-popup-car {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}
.status-popup-days {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.status-popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 10px;
    border-bottom: 2px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
}
.status-popup-header .status-popup-days { background: none; color: var(--text-light); padding: 0; }
.status-popup-days.green { background: #ECFDF5; color: #28CDA5; }
.status-popup-days.yellow { background: #FFFBEB; color: #D97706; }
.status-popup-days.red { background: #FEF2F2; color: #F9513F; }
.status-popup-days.blue { background: #F0F6FF; color: #2D7BF3; }
.status-popup-arrow {
    color: var(--text-light);
    opacity: 0.4;
    font-size: 16px;
}
.status-popup-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-light);
    font-size: 14px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
    .kpi-4 { grid-template-columns: repeat(2, 1fr); }
    .kpi-3 { grid-template-columns: repeat(3, 1fr); }
    .calls-grid { grid-template-columns: repeat(2, 1fr); }
    .calls-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .calls-grid-3 { grid-template-columns: repeat(3, 1fr) !important; }
    .wa-split { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .header-content { gap: 8px; }
    .header-center { display: none; }
    .user-avatar { width: 36px; height: 36px; }
    .user-name { font-size: 13px; }
    .tabs-nav { padding: 6px 6px; top: 60px; }
    .tabs-glass-bar { max-width: 100%; }
    .tabs-glass-track { padding: 3px; border-radius: 13px; }
    .tabs-glass-indicator { border-radius: 10px; }
    .tab-btn { font-size: 12px; padding: 8px 4px; gap: 2px; border-radius: 10px; white-space: nowrap; min-width: 0; flex-direction: column; }
    .tab-btn img, .tab-btn svg { width: 20px; height: 20px; }
    .tab-btn span { font-size: 11px; }
    .tab-content { padding: 16px 14px; }
    .clients-table { min-width: 540px; font-size: 11px; }
    .clients-table th { padding: 8px 6px; font-size: 10px; }
    .clients-table td { padding: 7px 6px; font-size: 11px; }
    .client-status-pill { font-size: 9.5px; padding: 2px 7px; }
    .client-count-badge { font-size: 10.5px; padding: 3px 9px; }
    .client-modal { width: 95%; max-width: none; }
    .client-info-grid { grid-template-columns: 1fr; }
    .client-subtab-btn { font-size: 12px; padding: 10px 8px; }
    .sections-row { grid-template-columns: 1fr; }
    .kpi-4 { grid-template-columns: 1fr 1fr; }
    .kpi-2 { grid-template-columns: 1fr 1fr; }
    .kpi-3 { grid-template-columns: 1fr; }
    .calls-grid { grid-template-columns: 1fr 1fr; }
    .calls-grid-2 { grid-template-columns: 1fr 1fr; }
    .kpi-value { font-size: 26px; }
    .call-value { font-size: 26px; }
    .status-count { font-size: 22px; }
    .table-filters { flex-direction: column; gap: 8px; }
    .filter-select { min-width: 100%; }
    .search-mini input { width: 100%; }
    .hide-mobile { display: none; }
    .calls-table { font-size: 11px; }
    .calls-table th { padding: 8px 3px; font-size: 10px; }
    .calls-table td { padding: 7px 3px; font-size: 11px; }
    /* Mobile: ממספר hidden, redistribute widths */
    .calls-table th:nth-child(1),
    .calls-table td:nth-child(1) { width: 7%; }
    .calls-table th:nth-child(2),
    .calls-table td:nth-child(2) { width: 18%; }
    .calls-table th:nth-child(3),
    .calls-table td:nth-child(3) { width: 25%; padding-right: 6px; }
    .calls-table th:nth-child(5),
    .calls-table td:nth-child(5) { width: 20%; }
    .calls-table th:nth-child(6),
    .calls-table td:nth-child(6) { width: 14%; }
    .calls-table th:nth-child(7),
    .calls-table td:nth-child(7) { width: 8%; }
    .source-badge { font-size: 9.5px; padding: 2px 6px; }
    .status-badge { font-size: 10px; }
    .play-btn { width: 30px; height: 30px; min-width: 30px; }
    .play-btn svg { width: 13px; height: 13px; }
    .custom-player { gap: 8px; padding: 12px; }
    .cp-play { width: 40px; height: 40px; min-width: 40px; }
    .cp-play svg { width: 18px; height: 18px; }
    .cp-time { font-size: 12px; min-width: 34px; }
    .handled-indicator { font-size: 14px; }
    .report-card { flex-direction: column; align-items: flex-start; }
    .survey-cat-label { flex: 0 0 90px; font-size: 11.5px; }
    .surveys-table { min-width: 500px; }
    .survey-detail-grid { grid-template-columns: 1fr; }
    .survey-box-grid { grid-template-columns: 1fr 1fr; }
    .survey-modal { width: 95%; max-width: none; }
    .status-popup-modal { width: 95%; max-width: none; }
    /* .status-popup-car visible on mobile — uses short names */
}

@media (max-width: 390px) {
    .sections-row { grid-template-columns: 1fr; }
    .calls-grid { grid-template-columns: 1fr; }
    .calls-grid-2 { grid-template-columns: 1fr; }
    .kpi-4 { grid-template-columns: 1fr; }
    .kpi-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   NOTIFICATION BELL + PANEL
   ============================================================ */

/* Bell Button */
.notif-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--bg-soft, #F3F4F6);
    color: var(--text, #1E293B);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.notif-bell-btn:hover {
    background: var(--border, #E2E8F0);
    transform: scale(1.05);
}
.notif-bell-btn:active {
    transform: scale(0.95);
}
.notif-bell-btn svg {
    display: block;
}

/* Badge (red dot with count) */
.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #F9513F;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    display: none;
    pointer-events: none;
    box-shadow: 0 0 0 2px #fff;
}
.notif-badge.visible {
    display: block;
}

/* Shake animation for new notifications */
@keyframes bellShake {
    0%   { transform: rotate(0); }
    15%  { transform: rotate(14deg); }
    30%  { transform: rotate(-12deg); }
    45%  { transform: rotate(10deg); }
    60%  { transform: rotate(-8deg); }
    75%  { transform: rotate(4deg); }
    100% { transform: rotate(0); }
}
.notif-bell-btn.shake svg {
    animation: bellShake 0.6s ease-in-out;
}

/* Panel Overlay */
.notif-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.notif-panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Slide-down Panel */
.notif-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: 420px;
    margin: 0 auto;
    max-height: 70vh;
    background: #fff;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.notif-panel.open {
    transform: translateY(0);
}

/* Panel Header */
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--border, #E2E8F0);
}
.notif-panel-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text, #1E293B);
}
.notif-panel-clear {
    border: none;
    background: none;
    color: var(--primary, #2D7BF3);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
    font-family: inherit;
}
.notif-panel-clear:hover {
    background: rgba(0, 111, 255, 0.08);
}

/* Panel Body — scrollable */
.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 16px;
    -webkit-overflow-scrolling: touch;
}

/* Empty state */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    color: #94A3B8;
    font-size: 14px;
}

/* Individual notification item */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: background 0.15s;
    cursor: pointer;
    position: relative;
    background: #fff;            /* read = white */
}
.notif-item.unread {
    background: #F1F5F9;         /* unread = light gray */
}
.notif-item.unread::before {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary, #2D7BF3);
}
.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}
.notif-item-icon.status { background: #F0F6FF; }
.notif-item-icon.call   { background: #D1FAE5; }
.notif-item-icon.survey  { background: #FEF3C7; }
.notif-item-icon.alert  { background: #FEE2E2; }
.notif-item-icon.general { background: #F3F4F6; }

.notif-item-content {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}
.notif-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #1E293B);
    margin-bottom: 2px;
    line-height: 1.4;
}
.notif-item-body {
    font-size: 13px;
    color: var(--text-light, #64748B);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item-time {
    font-size: 11px;
    color: #94A3B8;
    margin-top: 4px;
}

/* Safe area for iOS PWA (status bar) */
@supports (padding-top: env(safe-area-inset-top)) {
    .notif-panel {
        padding-top: env(safe-area-inset-top);
    }
}
