/* ============================================================
   Manufacturing ERP — Theme
   Palette: deep steel ink sidebar + safety-amber signature accent
   (a nod to factory-floor hazard striping, used sparingly)
   Type: Sora (display/headings) + Inter (body/data)
   ============================================================ */

:root {
    --ink-950: #0b1220;
    --ink-900: #0f172a;
    --ink-800: #1a2540;
    --ink-700: #263457;

    --surface: #f4f6fb;
    --card: #ffffff;
    --border: #e4e8f1;

    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #e8ecf7;
    --text-inverse-muted: #92a0c2;

    --accent: #f59e0b;
    --accent-dark: #d97706;
    --accent-soft: #fef3c7;

    --steel: #2563eb;
    --steel-soft: #dbeafe;

    --success: #16a34a;
    --success-soft: #dcfce7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);

    --sidebar-w: 264px;
    --topbar-h: 64px;
}

/* ---------- Compact icon-only action buttons (e.g. Super Admin > Companies) ---------- */
.icon-action-group {
    display: inline-flex;
    gap: 8px;
}

.icon-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease, transform .05s ease;
}

.icon-action-btn:hover {
    transform: translateY(-1px);
}

.icon-action-btn:active {
    transform: translateY(0);
}

.icon-action-btn--edit:hover {
    color: var(--steel);
    border-color: var(--steel);
    background: var(--steel-soft);
}

.icon-action-btn--activate {
    color: var(--success);
    border-color: var(--success);
}
.icon-action-btn--activate:hover {
    background: var(--success-soft);
}

.icon-action-btn--deactivate {
    color: var(--text-muted);
    border-color: var(--border);
}
.icon-action-btn--deactivate:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-soft);
}

.icon-action-btn--extend {
    color: var(--accent-dark);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.icon-action-btn--extend:hover {
    background: var(--accent);
    color: #fff;
}

.icon-action-btn--renew {
    color: var(--success);
    border-color: var(--success);
}
.icon-action-btn--renew:hover {
    background: var(--success);
    color: #fff;
}

/* ---------- Dashboard-style alert banner (e.g. trial-expired notice) ---------- */
.banner-alert {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--danger);
    border-left-width: 4px;
    background: var(--danger-soft);
    margin-bottom: 20px;
}

.banner-alert__icon {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.banner-alert__title {
    color: var(--danger);
    font-weight: 700;
    margin-bottom: 2px;
}

.banner-alert__body {
    color: var(--text-primary);
    font-size: 14px;
}

/* ---------- Small stat cards (Total / Active / Inactive) ---------- */
.stat-card-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 140px;
    box-shadow: var(--shadow-sm);
}

.stat-card__icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.stat-card__icon--total { background: var(--accent-soft); color: var(--accent-dark); }
.stat-card__icon--active { background: var(--success-soft); color: var(--success); }
.stat-card__icon--inactive { background: var(--border); color: var(--text-muted); }

.stat-card__label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.stat-card__value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background: var(--surface);
    color: var(--text-primary);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-display {
    font-family: "Sora", "Inter", sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--accent-dark); }

/* ============ App shell ============ */

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

/* ============ Sidebar ============ */

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--ink-950) 0%, var(--ink-900) 100%);
    color: var(--text-inverse);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
    border-top: 3px solid var(--accent);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 22px;
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-inverse-muted);
    padding: 14px 12px 6px;
    font-weight: 600;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text-inverse-muted);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.885rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}

.sidebar-nav .nav-link .bi { font-size: 1.05rem; width: 20px; text-align: center; }

.chat-nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #1c1200;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-nav .nav-link.active .chat-nav-badge { background: #1c1200; color: var(--accent); }


.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--accent);
    color: #1c1200;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.sidebar-nav .nav-link.active:hover {
    background: var(--accent);
    color: #1c1200;
}

.sidebar-nav .nav-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 2px;
    background: #fff;
}

/* ============ Collapsible sidebar groups ============ */

.nav-group {
    margin-top: 6px;
}

.sidebar-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    text-align: left;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 700;
    color: var(--text-inverse-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-group-toggle:hover,
.sidebar-group-toggle:focus-visible {
    background: rgba(255,255,255,0.06);
    color: #fff;
    outline: none;
}

.sidebar-group-toggle .group-icon {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-group-toggle span {
    flex: 1;
    min-width: 0;
}

.sidebar-group-toggle .toggle-icon {
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.sidebar-group-toggle .toggle-icon-minus { display: none; }
.nav-group.open .sidebar-group-toggle .toggle-icon-plus { display: none; }
.nav-group.open .sidebar-group-toggle .toggle-icon-minus { display: inline-block; }

.nav-group.open .sidebar-group-toggle {
    color: #fff;
}

.sidebar-group-panel {
    max-height: 0;
    overflow: hidden;
    padding-left: 4px;
    transition: max-height 0.25s ease;
}

.nav-group.open .sidebar-group-panel {
    max-height: 1200px;
}

.sidebar-group-panel .nav-link {
    font-size: 0.86rem;
}

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.75rem;
    color: var(--text-inverse-muted);
}

/* ============ Topbar ============ */

.topbar {
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 1020;
    min-width: 0;
    gap: 12px;
}

.sidebar-toggle {
    display: none;
    border: none;
    background: none;
    font-size: 1.3rem;
    color: var(--text-primary);
    padding: 4px 8px;
}

.topbar-role-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--steel-soft);
    color: var(--steel);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--steel) 0%, #1e40af 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ============ Main content ============ */

.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-w));
    display: flex;
    flex-direction: column;
}

.page-content {
    padding: 26px 28px 40px;
    overflow-x: hidden;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

/* Standalone pages (e.g. Payslip) render without the sidebar/topbar chrome. */
.standalone-body {
    background: var(--bg, #f4f5f7);
    min-height: 100vh;
}
.standalone-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 26px 20px 40px;
}

.page-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-dark);
    margin-bottom: 4px;
}

.page-title { font-size: 1.5rem; margin: 0; }
.page-subtitle { color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }

/* ============ Cards ============ */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-flat { border: 1px solid var(--border); border-radius: var(--radius); }

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-value { font-family: "Sora", sans-serif; font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.module-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.module-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 12px;
}

/* ============ Tables ============ */

.table-erp {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-erp thead th {
    background: var(--ink-900);
    color: var(--text-inverse);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border: none;
    padding: 12px 16px;
}

.table-erp tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 0.87rem;
}

.table-erp tbody tr:hover { background: #fafbff; }

.badge-status-active {
    background: var(--success-soft);
    color: var(--success);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
}

.badge-status-inactive {
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
}

/* ============ Buttons ============ */

.btn {
    font-weight: 600;
    font-size: 0.86rem;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
}

.btn-primary {
    background: var(--steel);
    border-color: var(--steel);
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #1c1200;
}
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* ============ Forms ============ */

.form-label { font-weight: 600; font-size: 0.83rem; color: var(--text-primary); }
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    font-size: 0.88rem;
    padding: 9px 12px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--steel);
    box-shadow: 0 0 0 3px var(--steel-soft);
}

/* ============ Responsive ============ */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.show { transform: translateX(0); }
    .main-wrap { margin-left: 0; max-width: 100vw; }
    .sidebar-toggle { display: inline-flex; align-items: center; }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(11, 18, 32, 0.5);
        z-index: 1025;
    }
    .sidebar-backdrop.show { display: block; }
}

@media (max-width: 575.98px) {
    .page-content { padding: 18px 14px 30px; }
    .stat-card { padding: 16px; }

    /* Generic safety net so every page (not just Attendance) behaves on
       small phones: header action buttons stack full-width, inline filter
       forms stack their fields, and tables/cards never force horizontal
       page scroll. */
    .page-header .btn,
    .attendance-hero-top .btn { flex: 1 1 auto; }
    .page-header > div:last-child,
    .attendance-hero-top > div:last-child { flex-wrap: wrap; width: 100%; }

    .card-flat.d-flex,
    form.d-flex,
    .d-flex.flex-row.align-items-end { flex-wrap: wrap; }
    .card-flat.d-flex .form-select,
    .card-flat.d-flex .form-control,
    form.d-flex .form-select,
    form.d-flex .form-control { min-width: 0; }

    .table-erp, .table { font-size: 0.82rem; }
    .btn { white-space: normal; }
}

/* ============ Mobile card-view grids ============ */
/* Every .table-erp grid becomes a stacked list of cards below this width,
   instead of a table you have to scroll left-right to read. JS (site.js)
   stamps each <td> with a data-label taken from its column header; the
   ::before rule below turns that into an inline label next to the value. */
@media (max-width: 767.98px) {
    .table-responsive { overflow-x: visible; }

    .table-erp { border: none; background: transparent; }

    .table-erp thead { display: none; }

    .table-erp tbody,
    .table-erp tr { display: block; width: 100%; }

    .table-erp tbody tr {
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        padding: 6px 14px;
        box-shadow: var(--shadow-sm, 0 1px 2px rgba(11,18,32,0.06));
    }

    .table-erp tbody tr:hover { background: var(--card); }

    .table-erp td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        text-align: right;
        border: none;
        border-bottom: 1px solid var(--border);
        padding: 10px 0;
        white-space: normal;
        word-break: break-word;
    }

    .table-erp td:last-child { border-bottom: none; }

    .table-erp td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-secondary, #64748b);
        text-align: left;
        margin-right: auto;
        padding-right: 12px;
    }

    /* Cells without a label (e.g. a full-width "no records" message, or an
       actions cell meant to span the card) stay left-aligned and unlabeled. */
    .table-erp td:not([data-label]) {
        justify-content: flex-start;
        text-align: left;
    }

    .table-erp td.text-end:last-child {
        justify-content: flex-end;
        padding-top: 12px;
    }
    .table-erp td.text-end:last-child::before { display: none; }
}

/* ============ Attendance hero panel ============ */

.attendance-hero {
    background: linear-gradient(135deg, var(--ink-950) 0%, var(--ink-800) 100%);
    border-radius: var(--radius);
    padding: 22px 24px 18px;
    margin: 0 0 22px;
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.attendance-hero-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.attendance-hero .page-eyebrow { color: var(--accent); }

.attendance-hero-subtitle {
    color: var(--text-inverse-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.attendance-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.attendance-stat {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.attendance-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.attendance-stat-value { font-family: "Sora", sans-serif; font-size: 1.3rem; font-weight: 700; line-height: 1.1; color: #fff; }
.attendance-stat-label { font-size: 0.72rem; color: var(--text-inverse-muted); margin-top: 2px; }

.attendance-filter {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.attendance-filter-field { display: flex; flex-direction: column; gap: 4px; }
.attendance-filter-field .form-label { color: var(--text-inverse-muted); font-size: 0.72rem; margin-bottom: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.attendance-filter-field .form-control { width: 160px; }

.badge-source-kiosk {
    background: var(--steel-soft);
    color: var(--steel);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    white-space: nowrap;
}

.badge-source-manual {
    background: #f1f2f5;
    color: var(--text-muted);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    white-space: nowrap;
}

.bg-success-soft { background: var(--success-soft); }
.bg-danger-soft { background: var(--danger-soft); }
.bg-steel-soft { background: var(--steel-soft); }
.bg-accent-soft { background: var(--accent-soft); }
.text-accent-dark { color: var(--accent-dark); }
.text-steel { color: var(--steel); }

@media (max-width: 900px) {
    .attendance-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attendance-filter-field .form-control { width: 140px; }
}

/* ============================================================
   Voice calling — floating widget (works app-wide, not just on
   the Chat page; see call-global.js)
   ============================================================ */
.call-widget-overlay {
    position: fixed; z-index: 2000; right: 20px; bottom: 20px;
    width: 300px; max-width: calc(100vw - 32px);
    font-family: inherit;
}
.call-widget-card {
    background: var(--ink-900); color: var(--text-inverse);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 18px; text-align: center;
}
.call-widget-avatar {
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700; color: #1c1200;
}
.call-widget-name { font-weight: 600; font-size: 1rem; margin-bottom: 2px; }
.call-widget-status { font-size: 0.82rem; color: var(--text-inverse-muted); margin-bottom: 16px; }
.call-widget-status.call-widget-status-live { color: var(--success); }
.call-widget-actions { display: flex; justify-content: center; gap: 14px; }
.call-widget-btn {
    width: 48px; height: 48px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; cursor: pointer; color: #fff;
    transition: transform 0.1s ease;
}
.call-widget-btn:active { transform: scale(0.94); }
.call-widget-btn-accept { background: var(--success); }
.call-widget-btn-decline, .call-widget-btn-end { background: var(--danger); }
.call-widget-btn-mute { background: rgba(255,255,255,0.14); }
.call-widget-btn-mute.muted { background: var(--accent); color: #1c1200; }
.call-widget-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.call-widget-ringing .call-widget-avatar { animation: call-widget-pulse 1.4s ease-in-out infinite; }
@keyframes call-widget-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
    50% { box-shadow: 0 0 0 10px rgba(245,158,11,0); }
}

.chat-call-btn { flex-shrink: 0; }

/* ============================================================
   Video calling — full-screen overlay, WhatsApp-style layout:
   full-bleed remote video, small draggable-feel local PiP in the
   corner, name/status pinned to the top, round control bar at
   the bottom. See call-global.js.
   ============================================================ */
.video-call-overlay {
    position: fixed; inset: 0; z-index: 2100;
    background: #0b0b0d;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.video-call-remote {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    background: #0b0b0d;
}
.video-call-remote-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #1a1a1e 0%, #0b0b0d 100%);
}
.video-call-avatar {
    width: 96px; height: 96px; font-size: 2.2rem;
}
.video-call-topbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 2;
    padding: 22px 20px 60px;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
    text-align: center; color: #fff;
    pointer-events: none;
}
.video-call-name { font-size: 1.15rem; font-weight: 700; }
.video-call-status { font-size: 0.85rem; color: rgba(255,255,255,0.75); margin-top: 3px; }
.video-call-status.call-widget-status-live { color: #6ee7a7; }
.video-call-local {
    position: absolute; top: 76px; right: 16px; z-index: 3;
    width: 108px; height: 148px; object-fit: cover;
    border-radius: 14px; box-shadow: 0 4px 18px rgba(0,0,0,0.45);
    background: #16161a; transform: scaleX(-1); /* mirror, like a selfie cam */
}
.video-call-actions {
    position: absolute; left: 0; right: 0; bottom: 34px; z-index: 3;
    display: flex; justify-content: center; gap: 18px;
}
.video-call-actions .call-widget-btn {
    width: 56px; height: 56px; font-size: 1.3rem;
    background: rgba(255,255,255,0.14); backdrop-filter: blur(6px);
}
.video-call-actions .call-widget-btn-accept { background: var(--success); }
.video-call-actions .call-widget-btn-decline,
.video-call-actions .call-widget-btn-end { background: var(--danger); }
.video-call-actions .call-widget-btn-mute.muted,
.video-call-actions .call-widget-btn-camera.muted { background: var(--accent); color: #1c1200; }

@media (max-width: 480px) {
    .video-call-local { width: 84px; height: 116px; top: 70px; right: 12px; }
    .video-call-actions .call-widget-btn { width: 50px; height: 50px; font-size: 1.15rem; }
}
