/* CallAgent — Ergonomic Cyberpunk theme. Single global stylesheet; no page adds its own CSS. */

:root {
    /* Deep dark grey, deliberately not near-black or pure black — reduces eye strain
       during long shifts. Distinct from itovijat's #0a0d12 near-black by design. */
    --bg-void: #1b1e24;
    --bg-panel: #242832;
    --bg-panel-2: #2b303c;
    --bg-hover: #323847;
    --border: #363c4a;
    --border-bright: #454c5e;

    --neon-green: #3ddc84;
    --neon-green-dim: #3ddc8422;
    --neon-red: #ff4d6d;
    --neon-red-dim: #ff4d6d22;
    --neon-amber: #ffb020;
    --neon-amber-dim: #ffb02022;
    --neon-cyan: #38bdf8;
    --neon-cyan-dim: #38bdf822;

    --slate: #8b93a3;
    --slate-dim: #5c6577;
    --text: #e8ecf1;
    --text-bright: #ffffff;

    --radius: 10px;
    --radius-sm: 6px;
    --sidebar-w: 224px;
    --topbar-h: 58px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--bg-void);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Bengali", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--neon-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 8px; color: var(--text-bright); font-weight: 600; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* --- Layout shell --- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.2s ease;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 16px; height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-brand img { height: 28px; width: auto; }
.sidebar-brand span { font-weight: 700; color: var(--text-bright); letter-spacing: 0.02em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px; min-width: 0; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate-dim); margin: 16px 10px 6px; }
.nav-section:first-child { margin-top: 4px; }

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--slate); font-weight: 500;
    min-height: 44px;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--neon-green-dim); color: var(--neon-green); }

.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 30;
}

.main { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    height: var(--topbar-h);
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    padding: 0 16px;
    min-width: 0;
}
.topbar-title { font-weight: 600; color: var(--text-bright); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-toggle {
    display: none;
    align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: transparent; border: none; color: var(--text);
    font-size: 20px; cursor: pointer; border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg-hover); }

/* Fixed thumb-reachable bottom nav — hidden by default, shown only under 900px
   (see the media query below); the off-canvas sidebar stays the desktop nav and
   the mobile "everything else" drawer via this bar's own "More" button. */
.bottom-nav { display: none; }

/* Company context pill + switcher trigger in the topbar */
.company-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--bg-panel-2); border: 1px solid var(--border);
    color: var(--text); font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap; min-height: 36px;
}
.company-pill:hover { border-color: var(--border-bright); text-decoration: none; }
.company-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neon-green); flex-shrink: 0; }

.user-menu { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--neon-cyan-dim); color: var(--neon-cyan);
    font-weight: 700; font-size: 13px; flex-shrink: 0;
}

/* min-width: 0 overrides the flex/grid item default of min-width:auto, which
   otherwise sizes a container to its widest descendant's intrinsic content and
   pushes the whole page wider than the viewport instead of letting the container's
   own overflow-x scroll it internally. This recurs at every nesting level (flex-in-
   flex, grid-in-grid, card-in-grid) — applied proactively here rather than patched
   in reactively wherever it's next discovered. */
.content { padding: 20px; min-width: 0; flex: 1; }
.card, .grid, .table-wrap, .company-grid, .form-grid { min-width: 0; }

.mobile-app-name {
    display: none;
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-mobile-open .sidebar { transform: translateX(0); }
    body.sidebar-mobile-open .sidebar-backdrop { display: block; }
    .main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .content { padding: 14px 14px 90px; }
    .topbar { padding: 0 10px; gap: 8px; justify-content: space-between; }
    .topbar-title { display: none; }
    .mobile-app-name {
        display: flex !important;
        align-items: center;
        gap: 6px;
        font-weight: 700;
        font-size: 15px;
        color: var(--text-bright);
        margin-right: auto;
    }
    .mobile-app-name img {
        height: 20px;
        width: 20px;
        object-fit: contain;
    }
    #globalSearchBtn {
        margin-right: 0 !important;
    }
    .hide-mobile { display: none !important; }

    .bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        background: var(--bg-panel); border-top: 1px solid var(--border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    }
    .bottom-nav-link {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 6px 2px; color: var(--slate); text-decoration: none;
        font-size: 11px; font-weight: 600; border: none; background: transparent;
        cursor: pointer; border-radius: var(--radius-sm); position: relative;
        font-family: inherit;
    }
    .bottom-nav-link .icon { font-size: 19px; line-height: 1; }
    .bottom-nav-link.active { color: var(--neon-green); }
    .bottom-nav-link:hover { text-decoration: none; color: var(--text-bright); }

    /* Mobile Touch-Friendly Overrides */
    .chip {
        min-height: 40px !important;
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
    .color-swatch {
        width: 36px !important;
        height: 36px !important;
    }
    #logForm select, #logForm input[type="number"] {
        height: 44px !important;
        font-size: 14px !important;
        width: 100% !important;
    }
    #logSubmitBtn {
        height: 46px !important;
        font-size: 14px !important;
        width: 100% !important;
    }
}

/* --- Cards / panels --- */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 16px; }

/* Collapsible card, default closed — native <details>/<summary> so no JS is needed
   for the toggle state itself. Used on contact_detail.php/task_detail.php's
   multi-section layout: summary carries the .card's own padding (clickable edge to
   edge), the body content gets its own padding wrapper via .details-body. */
details.card { padding: 0; }
details.card > summary {
    list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none;
    padding: 18px; margin: 0; min-width: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-weight: 600; color: var(--text-bright); font-size: 15px;
    border-radius: var(--radius);
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '\25B8'; color: var(--slate); font-size: 13px; transition: transform 0.15s ease; flex-shrink: 0; }
details.card[open] > summary::after { transform: rotate(90deg); }
details.card > summary:hover { background: var(--bg-hover); }
details.card[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
details.card .details-body { padding: 18px; min-width: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.stat-tile { display: flex; flex-direction: column; gap: 4px; }
.stat-tile .value { font-size: 28px; font-weight: 700; color: var(--text-bright); }
.stat-tile .label { color: var(--slate); font-size: 13px; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; min-height: 42px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg-panel-2); color: var(--text);
    font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn-primary { background: var(--neon-green); border-color: var(--neon-green); color: #0c1f14; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: var(--neon-red); border-color: var(--neon-red); color: #2a0810; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 13px; }
.btn-block { width: 100%; }

/* --- Forms --- */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--slate); }
.field input, .field select, .field textarea {
    width: 100%; padding: 11px 12px; min-height: 44px;
    background: var(--bg-void); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--neon-cyan);
}
.field-hint { font-size: 12px; color: var(--slate-dim); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--neon-red); margin-top: 4px; }

/* --- Badges / pills --- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-admin { background: var(--neon-red-dim); color: var(--neon-red); }
.badge-management { background: var(--neon-amber-dim); color: var(--neon-amber); }
.badge-agent { background: var(--neon-cyan-dim); color: var(--neon-cyan); }
.badge-active { background: var(--neon-green-dim); color: var(--neon-green); }
.badge-inactive { background: var(--slate-dim); color: var(--slate); }

select.badge-select {
    display: inline-flex;
    align-items: center;
    padding: 3px 22px 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 8px;
    min-height: unset;
    width: auto;
}
select.badge-select.badge-agent {
    background-color: var(--neon-cyan-dim);
    color: var(--neon-cyan);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
select.badge-select.badge-active {
    background-color: var(--neon-green-dim);
    color: var(--neon-green);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233ddc84' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
select.badge-select.badge-inactive {
    background-color: var(--slate-dim);
    color: var(--slate);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
select.badge-select.badge-dnc {
    background-color: var(--neon-red-dim);
    color: var(--neon-red);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff4d6d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
select.badge-select option {
    background-color: var(--bg-panel);
    color: var(--text);
}

.avatar-admin { background: var(--neon-red-dim); color: var(--neon-red); }
.avatar-management { background: var(--neon-amber-dim); color: var(--neon-amber); }
.avatar-agent { background: var(--neon-cyan-dim); color: var(--neon-cyan); }

/* tel: links — every phone number in the app renders through this class from Phase 2 on */
.tel-link { color: var(--neon-green); font-weight: 600; white-space: nowrap; }
.tel-link:hover { text-decoration: underline; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--slate); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* --- Company switcher cards --- */
.company-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.company-card {
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; text-align: left; cursor: pointer; min-width: 0;
}
.company-card:hover { border-color: var(--neon-green); }
.company-card .name { font-weight: 700; color: var(--text-bright); margin-bottom: 8px; }

/* --- Auth pages (login, setup, company switch) --- */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: var(--bg-void);
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px 28px; box-shadow: var(--shadow-card);
}
.auth-card.wide { max-width: 720px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-logo img { height: 44px; width: auto; }

/* --- Alerts / toasts --- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; }
.alert-error { background: var(--neon-red-dim); color: var(--neon-red); border: 1px solid var(--neon-red); }
.alert-success { background: var(--neon-green-dim); color: var(--neon-green); border: 1px solid var(--neon-green); }
.alert-info { background: var(--neon-cyan-dim); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }

#toast-stack {
    position: fixed; bottom: 16px; right: 16px; z-index: 100;
    display: flex; flex-direction: column; gap: 8px; max-width: min(90vw, 360px);
}
.toast {
    padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-card);
    background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text);
    font-size: 14px; min-width: 0; word-break: break-word;
}
.toast-error { border-color: var(--neon-red); color: var(--neon-red); }
.toast-ok { border-color: var(--neon-green); color: var(--neon-green); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--slate); }
.empty-state .icon { font-size: 36px; margin-bottom: 10px; }

/* --- Chat --- */
.chat-card { display: flex; flex-direction: column; min-width: 0; }
.chat-messages {
    display: flex; flex-direction: column; gap: 10px;
    height: 50vh; min-height: 260px; overflow-y: auto;
    padding: 4px; margin-bottom: 12px; min-width: 0;
}
.chat-bubble {
    max-width: 78%; align-self: flex-start;
    background: var(--bg-panel-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 8px 12px; min-width: 0;
}
.chat-bubble.mine { align-self: flex-end; background: var(--neon-green-dim); border-color: var(--neon-green); }
.chat-sender { font-size: 12px; font-weight: 700; color: var(--neon-cyan); margin-bottom: 2px; }
.chat-body { white-space: pre-wrap; word-break: break-word; }
.chat-time { font-size: 11px; color: var(--slate-dim); margin-top: 4px; text-align: right; }

.chat-send-row { display: flex; gap: 8px; min-width: 0; }
.chat-send-row input {
    flex: 1; min-width: 0; padding: 11px 12px; min-height: 44px;
    background: var(--bg-void); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
}
.chat-send-row input:focus { outline: none; border-color: var(--neon-cyan); }

.chat-layout { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.chat-conv-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chat-conv-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; border-radius: var(--radius-sm); cursor: pointer; min-height: 44px; min-width: 0;
}
.chat-conv-row:hover { background: var(--bg-hover); }
.chat-conv-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back-link { display: inline-block; }

#navChatBadge { min-width: 20px; padding: 2px 6px; text-align: center; font-size: 11px; }

/* --- Search bar + filter chips (contacts, and reused by future list pages) --- */
.search-bar {
    display: flex; gap: 8px; margin-bottom: 12px; min-width: 0;
}
/* Unlike .field input, these sit outside any .field wrapper, so they never picked
   up the dark background/text-color pairing — left at browser defaults, they
   rendered as a light/white input box with light text inherited from the theme,
   i.e. near-invisible text on a near-white background. */
.search-bar input {
    flex: 1; min-width: 0;
    padding: 11px 12px; min-height: 44px;
    background: var(--bg-void); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
}
.search-bar input:focus { outline: none; border-color: var(--neon-cyan); }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; min-width: 0; }
.chip {
    padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--bg-panel-2); color: var(--slate); font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap; min-height: 34px; display: inline-flex; align-items: center;
}
.chip.active { background: var(--neon-green-dim); border-color: var(--neon-green); color: var(--neon-green); }

/* --- Contact list: a vertical row list, not a grid of tiles — reads better than a
   card grid when scanning many contacts on a narrow mobile screen. --- */
.contact-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.contact-row {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; min-width: 0; cursor: pointer;
}
.contact-row:hover { border-color: var(--border-bright); }
.contact-row .avatar { flex-shrink: 0; }
.contact-row .info { flex: 1; min-width: 0; }
.contact-row .info .name { font-weight: 700; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-row .info .meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.contact-row .call-btn {
    flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--neon-green-dim); color: var(--neon-green); font-size: 18px;
}
.contact-row .call-btn:hover { background: var(--neon-green); color: #0c1f14; text-decoration: none; }

.badge-dnc { background: var(--neon-red-dim); color: var(--neon-red); }

/* --- Status color tag (logs, replies, tasks, work entries) — shared across
   contact_detail.php's log form, tasks.php/task_detail.php, and work_logs.php.
   Rendered as a left border, not a background fill: browsers strip
   background-color from print output by default, but border-color generally
   survives — so this is print-safe without relying solely on print-color-adjust. */
.status-color-none { border-left: 3px solid transparent; }
.status-color-red { border-left: 3px solid var(--neon-red); }
.status-color-green { border-left: 3px solid var(--neon-green); }
.status-color-yellow { border-left: 3px solid var(--neon-amber); }
.status-color-blue { border-left: 3px solid var(--neon-cyan); }

.color-swatch-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
    border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center;
}
.color-swatch.active { border-color: var(--text-bright); box-shadow: 0 0 0 2px var(--bg-void), 0 0 0 4px var(--text-bright); }
.color-swatch[data-color="none"] { background: var(--bg-panel-2); }
.color-swatch[data-color="red"] { background: var(--neon-red); }
.color-swatch[data-color="green"] { background: var(--neon-green); }
.color-swatch[data-color="yellow"] { background: var(--neon-amber); }
.color-swatch[data-color="blue"] { background: var(--neon-cyan); }

.call-now-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 16px; border-radius: var(--radius); min-height: 56px;
    background: var(--neon-green); color: #0c1f14; font-weight: 700; font-size: 17px;
}
.call-now-btn:hover { filter: brightness(1.08); text-decoration: none; }

/* --- Daily Work Summary print sheet ---
   The report is styled to look like an official, clean Google Sheet:
   light background, crisp gridlines, clear header columns, and compact rows.
   It overrides the dark theme both on-screen (as a report preview card) and
   for print. Font fallback includes Tiro Bangla for Bengali text. */
.print-sheet {
    background: #ffffff !important;
    color: #111111 !important;
    border: 1px solid #dadce0 !important;
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-family: 'Tiro Bangla', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif !important;
}
.print-header {
    text-align: center;
    border-bottom: 2px solid #1a73e8;
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.print-header h2 {
    margin: 0 0 10px;
    color: #1a73e8 !important;
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.print-subtitle-line {
    font-size: 12px;
    color: #5f6368 !important;
    margin: 0 auto;
    max-width: 90%;
    line-height: 1.6;
}
.print-subtitle-line strong {
    color: #202124 !important;
    font-weight: 600;
}
.print-subtitle-line .sep {
    margin: 0 12px;
    color: #dadce0;
    font-weight: 300;
}

.print-sheet h3 {
    font-size: 14px;
    font-weight: 600;
    color: #202124 !important;
    margin: 20px 0 8px 0;
    border-left: 4px solid #1a73e8;
    padding-left: 8px;
}

/* Google Sheets Style Tables */
.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 12px;
    font-family: 'Tiro Bangla', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif !important;
}
.print-table th {
    background-color: #f1f3f4 !important;
    color: #3c4043 !important;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    border: 1px solid #bdc1c6 !important;
    padding: 6px 8px;
    text-align: left;
}
.print-table td {
    border: 1px solid #dadce0 !important;
    padding: 6px 8px;
    color: #202124 !important;
    vertical-align: top;
    line-height: 1.4;
}
.print-table tr:nth-child(even) td {
    background-color: #f8f9fa;
}

/* Accent status indicator strips on the first cell of the row */
.print-table tr.status-color-none td:first-child { border-left: 3px solid transparent !important; }
.print-table tr.status-color-red td:first-child { border-left: 3px solid #d93025 !important; }
.print-table tr.status-color-green td:first-child { border-left: 3px solid #188038 !important; }
.print-table tr.status-color-yellow td:first-child { border-left: 3px solid #f9ab00 !important; }
.print-table tr.status-color-blue td:first-child { border-left: 3px solid #1a73e8 !important; }

/* Custom activity type badges */
.act-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.act-type-call {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
}
.act-type-task {
    background-color: #ccfbf1 !important;
    color: #0f766e !important;
}
.act-type-work {
    background-color: #ffedd5 !important;
    color: #c2410c !important;
}
.act-type-billing {
    background-color: #ffe4e6 !important;
    color: #9f1239 !important;
}
.act-type-meeting {
    background-color: #e0e7ff !important;
    color: #3730a3 !important;
}

.dir-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.dir-in {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}
.dir-out {
    background-color: #f8fafc !important;
    color: #64748b !important;
}

/* Custom status and tag badges */
.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}
.status-badge.status-val-completed {
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
}
.tag-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    background-color: #fef9c3 !important;
    color: #a16207 !important;
    border: 1px solid #fef08a !important;
}

.print-footer {
    margin-top: 24px;
    border-top: 1px solid #dadce0;
    padding-top: 8px;
    font-size: 11px;
    color: #70757a !important;
    text-align: center;
}

@media print {
    html, body {
        background: #ffffff !important;
        color: #111111 !important;
        height: auto !important;
        font-family: 'Tiro Bangla', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif !important;
    }
    
    /* Hide all layout wrappers & non-needed elements in print output */
    .no-print, .sidebar, .topbar, .sidebar-backdrop, .bottom-nav, .user-menu, .dropdown, .alert {
        display: none !important;
    }
    
    /* Reset margins/paddings on parents so the print area is positioned correctly at top-left */
    .app-shell, .main, .content {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    
    #printArea {
        position: static !important;
        width: 100% !important;
        background: #ffffff !important;
        color: #111111 !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .print-table th {
        background-color: #f1f3f4 !important;
        border: 1px solid #bdc1c6 !important;
        color: #3c4043 !important;
    }
    
    .print-table td {
        border: 1px solid #dadce0 !important;
        color: #202124 !important;
    }
    
    .print-table td .contact-meta {
        font-size: 10px !important;
        color: #5f6368 !important;
        font-weight: normal !important;
        margin-top: 2px !important;
    }

    .act-badge, .dir-badge, .status-badge, .tag-badge {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }
    
    .print-subtitle-line {
        color: #3c4043 !important;
    }
    
    .print-footer {
        color: #70757a !important;
    }
    
    @page { margin: 12mm; }
}

.text-muted { color: var(--slate); }
.text-danger { color: var(--neon-red); }
.text-success { color: var(--neon-green); }

.crm-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}
.crm-main-col, .crm-side-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
@media (max-width: 900px) {
    .crm-layout {
        grid-template-columns: 1fr;
    }
}

.ca-side-scroll {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    width: 100%;
    padding-bottom: 6px;
}
.ca-side-scroll::-webkit-scrollbar {
    height: 4px;
}
.ca-side-scroll::-webkit-scrollbar-track {
    background: var(--bg-void);
    border-radius: 4px;
}
.ca-side-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
.ca-side-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}
.ca-side-scroll > * {
    flex-shrink: 0;
}

/* Modals Centering & Scrolling Fixes */
[id$="Modal"] {
    align-items: flex-start !important;
    overflow-y: auto !important;
    padding: 20px 16px !important;
}
[id$="Modal"] > .card {
    margin: auto !important;
}

select.ca-quick-status-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 2px 8px !important;
    border: 1px solid currentColor !important;
    border-radius: var(--radius-sm);
    text-align: center;
    text-align-last: center;
}
select.ca-quick-status-select option {
    background: var(--bg-panel-2);
    color: var(--text-bright);
}
