:root {
    --sidebar-width: 280px;
    --bg: #efe4de;
    --card: #ffffff;
    --line: #d8c8c2;
    --text: #111827;
    --muted: #5f7999;
    --primary: #ea3b3b;
    --accent: #f99c25;
    --success: #619300;
    --danger: #ea3b3b;
    --info: #83aee1;
    --soft-blue: #d9f3ff;
    --soft-rose: #e0a79f;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Roboto", sans-serif;
    background: radial-gradient(circle at top right, #f9f2ef 0%, var(--bg) 50%);
    color: var(--text);
}

h1,
h2,
h3,
h4,
h5,
h6,
.btn {
    font-family: "Geologica", sans-serif;
}

a {
    color: #2563eb;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    position: relative;
    z-index: 0;
    max-width: 1320px;
    margin: 20px auto;
    padding: 0 14px 22px;
}

/* Keep charts/canvas layers inside main so they cannot composite above the statusbar dropdown */
.app-shell > main {
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.topbar,
.statusbar,
.footerbar,
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.topbar,
.statusbar,
.footerbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
}

.topbar {
    font-size: 0.9rem;
}

.topbar__left {
    color: var(--muted);
}

.topbar__left strong {
    color: var(--text);
}

.topbar__links {
    display: flex;
    gap: 14px;
    align-items: center;
}

.topbar__campaign-links {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #44566f;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.topbar__sep {
    color: #8aa0bd;
}

.profile-menu {
    position: relative;
}

.profile-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 10px 0 6px;
    border-radius: 999px;
    border: 1px solid #d8e1ef;
    background: #f8fbff;
    color: #44566f;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: none;
    cursor: pointer;
}

.profile-menu__trigger:hover {
    text-decoration: none;
    background: #eef5ff;
    border-color: #b8cce8;
}

.profile-menu__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #8aa7cb;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
}

.profile-menu__label {
    font-size: 0.8rem;
}

.profile-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    border-radius: 10px;
    border: 1px solid #d8e1ef;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
    padding: 6px;
    display: none;
    z-index: 100;
}

.profile-menu.is-open .profile-menu__panel {
    display: block;
}

.profile-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    color: #34485f;
    font-size: 0.8rem;
    text-transform: none;
}

.profile-menu__item:hover {
    text-decoration: none;
    background: #f3f7fd;
}

.profile-menu__item--danger {
    color: #b92727;
}

.profile-menu__item--danger:hover {
    background: #fff1ee;
}

.profile-menu__item--current {
    background: #eef5ff;
    color: #2563eb;
    font-weight: 600;
}

.about-session-modal-card {
    max-width: 540px;
}

.about-session-details {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d8e1ef;
    background: #f8fbff;
    color: #34485f;
    font-family: "Roboto", sans-serif;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.statusbar {
    margin-top: 0;
    position: relative;
    /* Below modals (.modal-backdrop 999); above reports content (charts/canvas can form layers) */
    z-index: 998;
    justify-content: center;
    min-height: 62px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.brand__title {
    font-family: "Geologica", sans-serif;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.15;
    display: block;
    margin: 0;
}

.brand__badge {
    font-size: 0.72rem;
    text-transform: uppercase;
    background: #fce7d6;
    color: #57423f;
    padding: 4px 8px;
    border-radius: 999px;
    margin-left: 6px;
}

.statusbar__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 0.85rem;
    align-items: center;
    justify-content: center;
}

.statusbar__profile {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.notification-menu {
    position: relative;
}

.notification-menu__trigger,
.statusbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #d8e1ef;
    background: #f8fbff;
    color: #44566f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.notification-menu__trigger:hover,
.statusbar-icon-btn:hover {
    background: #eef5ff;
    border-color: #b8cce8;
}

.notification-menu__badge {
    position: absolute;
    right: -3px;
    top: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ea3b3b;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.notification-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 250px;
    border-radius: 10px;
    border: 1px solid #d8e1ef;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
    padding: 6px;
    display: none;
    z-index: 100;
}

.notification-menu.is-open .notification-menu__panel {
    display: block;
}

.notification-menu__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
    text-transform: none;
    color: #34485f;
    font-size: 0.8rem;
}

.notification-menu__item span {
    color: #60738d;
}

.notification-menu__item:hover {
    text-decoration: none;
    background: #f3f7fd;
}

.statusbar__meta-item {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #d8e1ef;
    border-radius: 10px;
    background: #f7faff;
    color: #50647d;
    font-weight: 600;
}

.live-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #ffd59a;
    border-radius: 999px;
    background: #fff5e6;
    color: #b26400;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

/* Locked after Save and Clear (inert + visual hint) */
form.customer-form.customer-form--locked {
    opacity: 0.88;
}

/* Save row: two buttons side by side; feedback follows (dialer customer form) */
.form-row.customer-form-save-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.customer-form-save-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Save and Clear hidden during incall — [hidden] must win over .btn { display: inline-flex } */
.customer-form-save-actions .btn[data-save-and-clear="true"][hidden] {
    display: none !important;
}

.customer-save-feedback {
    font-family: "Geologica", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d5016;
    letter-spacing: 0.02em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    min-height: 1.2em;
}

.customer-save-feedback.customer-save-feedback--visible {
    opacity: 1;
    visibility: visible;
}

.customer-save-feedback.customer-save-feedback--fade-out {
    opacity: 0;
    visibility: hidden;
}

.workspace {
    margin-top: 12px;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 12px;
    align-items: start;
}

body.sidebar-compact {
    --sidebar-width: 76px;
}

/* Sticky sidebar column */
.workspace__rail-wrap {
    position: sticky;
    top: 12px;
    align-self: start;
    z-index: 5;
    max-height: calc(100vh - 24px);
    width: var(--sidebar-width);
    min-width: 0;
}

aside.action-rail {
    position: relative;
    min-width: 0;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

/* Compact toggle + live call status: one row (button left, No Live Call right) */
.sidebar-compact-host {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
}

.sidebar-compact-host .live-call--rail {
    min-width: 0;
    max-width: 100%;
    font-size: 0.72rem;
    padding: 4px 10px;
    min-height: 30px;
}

body.sidebar-compact .sidebar-compact-host .live-call--rail {
    font-size: 0;
    padding: 4px 6px;
    min-height: 28px;
}

body.sidebar-compact .sidebar-compact-host .live-call--rail i {
    font-size: 0.85rem;
}

.sidebar-compact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    font-size: 0;
    gap: 0;
    border-radius: 8px;
    box-sizing: border-box;
}

.sidebar-compact-btn i {
    font-size: 0.95rem;
}

.sidebar-compact-btn .sidebar-compact-icon--to-full {
    display: none;
}

body.sidebar-compact .sidebar-compact-btn .sidebar-compact-icon--to-compact {
    display: none;
}

body.sidebar-compact .sidebar-compact-btn .sidebar-compact-icon--to-full {
    display: inline-block;
}

/* Compact sidebar: narrow rail, icon-only action buttons */
body.sidebar-compact .action-rail.card {
    padding: 8px 6px;
}

body.sidebar-compact .action-rail .status-line {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding-right: 4px;
}

body.sidebar-compact .action-rail .status-line h2 {
    display: none;
}

body.sidebar-compact .action-rail .agent-state {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    text-align: center;
    width: 100%;
}

body.sidebar-compact .action-rail .pause-timer {
    font-size: 0.62rem;
    min-height: auto;
    padding: 2px 6px;
}

body.sidebar-compact .action-rail .autodial-dial-line {
    padding: 6px 8px;
    margin-bottom: 8px;
}

body.sidebar-compact .action-rail .autodial-dial-line__lead,
body.sidebar-compact .action-rail .autodial-dial-line__phone,
body.sidebar-compact .action-rail .autodial-dial-line__timer {
    font-size: 0.6rem;
    margin-bottom: 4px;
}

body.sidebar-compact .action-rail .action-group__label {
    display: none;
}

body.sidebar-compact .action-rail .recording-file-name {
    display: none;
}

body.sidebar-compact .action-rail .btn {
    font-size: 0;
    gap: 0;
    justify-content: center;
    padding: 10px 6px;
    min-height: 42px;
}

body.sidebar-compact .action-rail .btn i {
    font-size: 1.05rem;
}

body.sidebar-compact .action-rail .recording-btn-label,
body.sidebar-compact .action-rail .recording-wave {
    display: none;
}

body.sidebar-compact .action-rail .btn > span:not(.recording-wave):not(.park-music-wave) {
    display: none;
}

body.sidebar-compact .action-rail .park-music-wave {
    display: none;
}

body.sidebar-compact .action-rail .checkbox-action {
    justify-content: center;
    font-size: 0;
    padding: 8px 4px;
}

body.sidebar-compact .action-rail .checkbox-action > span {
    display: none;
}

body.sidebar-compact .action-rail .checkbox-action i {
    font-size: 1rem;
}

body.sidebar-compact .action-rail .action-grid--top {
    grid-template-columns: 1fr;
}

body.sidebar-compact .action-rail .script-webform-row {
    grid-template-columns: 1fr;
}

body.sidebar-compact .action-rail .volume-slider {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

body.sidebar-compact .action-rail .volume-slider input[type="range"] {
    width: 100%;
    min-width: 0;
}

.card {
    padding: 16px;
}

.status-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.action-rail h2 {
    margin: 0;
    font-size: 0.92rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.08em;
}

.agent-state {
    margin: 0;
    font-family: "Geologica", sans-serif;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5f7999;
    font-weight: 700;
}

.agent-state.is-resumed {
    color: #619300;
}

.agent-state.is-paused {
    color: #6c757d;
}

.agent-state.is-manual {
    color: #5f8fd4;
}

.agent-state.is-dialling {
    color: #c2410c;
}

.agent-state.is-incall {
    color: #0369a1;
}

.pause-timer {
    display: none;
    margin: 0;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #cfd8e6;
    background: #f6f9ff;
    color: #435976;
    font-family: "Geologica", sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.pause-timer.is-visible {
    display: inline-flex;
    align-items: center;
}

/* Start Recording, Park, Transfer, Hangup, DTMF — only visible during INCALL (agent-state.is-incall).
   [hidden] must win over .btn { display: inline-flex } */
.action-rail .btn[data-requires-incall="true"][hidden] {
    display: none !important;
}

.autodial-dial-line {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cfd8e6;
    background: linear-gradient(180deg, #fbfdff 0%, #f3f7fc 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.autodial-dial-line[hidden] {
    display: none !important;
}

.autodial-dial-line__lead,
.autodial-dial-line__phone,
.autodial-dial-line__timer {
    margin: 0 0 6px;
    font-family: "Geologica", sans-serif;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #3d5266;
}

.autodial-dial-line__lead:last-child,
.autodial-dial-line__phone:last-child,
.autodial-dial-line__timer:last-child {
    margin-bottom: 0;
}

.autodial-dial-line__lead {
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #2c3d4d;
}

.autodial-dial-line__phone {
    font-weight: 600;
    color: #1a5a8a;
    white-space: pre-line;
}

.autodial-dial-line__timer {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #5f7999;
}

.action-grid {
    display: grid;
    gap: 8px;
}

.action-grid--top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-grid--top .checkbox-action {
    grid-column: 1 / -1;
}

.action-grid--top .btn[data-autodial-mode="manual"] {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
}

.action-group--primary {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--line);
}

.action-group {
    margin-bottom: 10px;
}

.action-group--recording {
    margin-top: 4px;
    margin-bottom: 30px;
}

.action-group--script-workflow {
    margin-bottom: 12px;
}

.script-webform-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.action-group--park-transfer {
    margin-top: 30px;
    margin-bottom: 30px;
}

.action-group--hangup {
    margin-bottom: 14px;
}

.action-group__label {
    margin: 0 0 6px;
    font-family: "Geologica", sans-serif;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.recording-file-name {
    margin-left: 6px;
    font-family: "Roboto", sans-serif;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
}

.checkbox-action {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #5f7999;
    font-family: "Geologica", sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.83rem;
    padding: 2px 2px 4px;
}

.checkbox-action input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(0.96);
}

.btn i {
    font-size: 0.95rem;
    line-height: 1;
}

.btn--muted {
    background: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
}

.btn--outline-muted {
    background: #ffffff;
    border-color: #6c757d;
    color: #6c757d;
}

.btn--success {
    background: #619300;
    border-color: #619300;
    color: #ffffff;
}

.btn--outline-success {
    background: #ffffff;
    border-color: #619300;
    color: #619300;
}

.btn--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn--secondary {
    background: #e0a79f;
    border-color: #e0a79f;
    color: #57423f;
}

.btn--danger {
    background: #ea3b3b;
    border-color: #ea3b3b;
    color: #ffffff;
}

.btn--ghost {
    background: #ffffff;
    border-color: #83aee1;
    color: #5f7999;
}

.btn.is-active,
.btn[data-toggle-button="true"][aria-pressed="true"] {
    box-shadow: 0 0 0 0.2rem rgba(131, 174, 225, 0.35);
}

.btn--warning {
    background: #f99c25;
    border-color: #f99c25;
    color: #212529;
}

.btn--info {
    background: #83aee1;
    border-color: #83aee1;
    color: #212529;
}

.btn--light {
    background: #efe4de;
    border-color: #efe4de;
    color: #57423f;
}

.btn--dark {
    background: #57423f;
    border-color: #57423f;
    color: #ffffff;
}

.btn--link {
    background: transparent;
    border-color: transparent;
    color: #5f7999;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding-left: 6px;
    padding-right: 6px;
}

.btn--recording {
    background: linear-gradient(135deg, #ea3b3b 0%, #f99c25 100%);
    border-color: #e56b33;
    color: #ffffff;
}

.recording-wave {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.recording-wave span {
    width: 2px;
    height: 4px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 2px;
    animation: wavePulse 0.9s ease-in-out infinite;
    transform-origin: bottom;
}

.recording-wave span:nth-child(2) {
    animation-delay: 0.12s;
}

.recording-wave span:nth-child(3) {
    animation-delay: 0.24s;
}

.recording-wave span:nth-child(4) {
    animation-delay: 0.36s;
}

.btn--recording.is-recording .recording-wave {
    display: inline-flex;
}

@keyframes wavePulse {
    0%,
    100% {
        transform: scaleY(0.45);
        opacity: 0.75;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.btn--neutral-outline {
    background: #ffffff;
    border-color: #b8bec8;
    color: #5f7999;
}

.btn--dtmf-purple {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #ffffff;
}

.btn--park-playing {
    background: #22a35a;
    border-color: #22a35a;
    color: #ffffff;
    box-shadow: 0 0 0 0 rgba(34, 163, 90, 0.35);
    animation: parkGlow 1.4s ease-out infinite;
}

.park-music-wave {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.park-music-wave span {
    width: 2px;
    height: 4px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 2px;
    animation: wavePulse 0.9s ease-in-out infinite;
    transform-origin: bottom;
}

.park-music-wave span:nth-child(2) {
    animation-delay: 0.1s;
}

.park-music-wave span:nth-child(3) {
    animation-delay: 0.2s;
}

.park-music-wave span:nth-child(4) {
    animation-delay: 0.3s;
}

.btn[data-park-call="true"].is-park-playing .park-music-wave {
    display: inline-flex;
}

@keyframes parkGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 163, 90, 0.35);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 163, 90, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 163, 90, 0);
    }
}

.volume-controls {
    display: block;
    margin-top: 12px;
}

.volume-slider {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: center;
    gap: 8px;
    color: #5f7999;
}

.volume-slider input[type="range"] {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    height: 6px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: linear-gradient(90deg, #ea3b3b 0%, #f99c25 100%) no-repeat, #d1d5db;
    background-size: 70% 100%, 100% 100%;
    cursor: pointer;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid #ea3b3b;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.25);
}

.volume-slider input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    border: 0;
    background: #d1d5db;
}

.volume-slider input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid #ea3b3b;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.25);
}

.panel-header {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.main-panel h1 {
    font-size: 1.2rem;
    margin: 14px 0;
}

/* Customer Information — smaller than default h1, bold */
.main-panel h1:not(.page-title-center) {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 10px 0 12px;
}

.customer-form-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0 12px;
}

.customer-form-heading-row h1 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.customer-form-dummy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    padding: 6px 10px;
}

/* Section titles inside customer form (e.g. Account info) */
.customer-form .form-section-heading {
    grid-column: 1 / -1;
    font-family: "Geologica", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 18px 0 8px;
    padding-top: 4px;
    border-top: 1px dashed var(--line);
}

/* Demo Campaign — same size as original .main-panel h1, centered */
.main-panel h1.page-title-center {
    text-align: center;
}

.customer-form {
    display: grid;
    gap: 10px;
}

/* Case notes accordion (below Comments) */
.case-notes-fieldset {
    margin: 0;
    padding: 0;
    border: none;
    min-width: 0;
}

.case-notes-fieldset__legend {
    padding: 0;
    margin: 0 0 6px;
    font-family: "Geologica", sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
}

.case-notes-accordion {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-elevated, rgba(255, 255, 255, 0.04));
    overflow: hidden;
}

.case-notes-accordion__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text, inherit);
    user-select: none;
}

.case-notes-accordion__summary::-webkit-details-marker {
    display: none;
}

.case-notes-accordion__summary::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    margin-right: 8px;
    transform: rotate(-90deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    opacity: 0.75;
}

.case-notes-accordion[open] .case-notes-accordion__summary::before {
    transform: rotate(0deg);
}

.case-notes-accordion__summary-text {
    flex: 1;
    text-align: left;
}

.case-notes-accordion__count {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
}

.case-notes-accordion__panel {
    padding: 0 12px 12px;
    border-top: 1px dashed var(--line);
}

.case-notes-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
}

.case-notes-list__item {
    display: grid;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.case-notes-list__item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.case-notes-list__time {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    letter-spacing: 0.02em;
}

.case-notes-list__relative {
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    opacity: 0.92;
}

.case-notes-list__disposition {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.case-notes-list__text {
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.case-notes-empty {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
    font-style: italic;
}

.form-row {
    display: grid;
    gap: 10px;
}

.columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.columns-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.columns-1 {
    grid-template-columns: 1fr;
}

.field-group {
    display: grid;
    gap: 5px;
}

.field-group--inline {
    align-content: end;
}

.field-group--button-row .btn {
    width: 140px;
}

.field-group label {
    font-size: 0.76rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.04em;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 0.9rem;
    font-family: "Roboto", sans-serif;
    background: #fcfdff;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

.quick-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.subsection-title {
    margin: 16px 0 2px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.submit-btn {
    width: 220px;
    justify-self: start;
}

.footerbar {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--muted);
}

.footer-sep {
    margin-left: 10px;
}

.hotkeys-pill {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 8px 10px;
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-backdrop--incall {
    z-index: 1000;
    background: rgba(17, 24, 39, 0.5);
}

.live-call--incall {
    border-color: #7dd3fc;
    background: #e0f2fe;
    color: #0369a1;
}

.incall-card {
    width: min(320px, 92vw);
    max-height: min(92vh, 640px);
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
    padding: 12px 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.modal-backdrop--incall.is-minimized {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    background: transparent;
    pointer-events: none;
}

.modal-backdrop--incall.is-minimized .incall-card {
    pointer-events: auto;
    width: auto;
    max-width: min(340px, calc(100vw - 24px));
    max-height: none;
    overflow: visible;
    padding: 10px 12px;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
}

/* Park call badge + timer + controls need more horizontal room when minimized */
.modal-backdrop--incall.is-minimized .incall-card.is-park-call {
    min-width: min(392px, calc(100vw - 24px));
    max-width: min(440px, calc(100vw - 24px));
}

.incall-card__header {
    margin-bottom: 10px;
}

.incall-card__header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.incall-card__header-label {
    font-family: "Geologica", sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.04em;
}

.incall-card__park-call {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.42);
    background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4338ca;
    font-family: "Geologica", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.incall-card__park-call .fa-music {
    font-size: 0.9rem;
    opacity: 0.95;
}

.incall-card__park-call-text {
    line-height: 1.2;
    white-space: nowrap;
}

/* [hidden] must win over display rules (same idea as action-rail incall buttons). */
.incall-card__park-call[hidden] {
    display: none !important;
}

.incall-card.is-park-call .incall-card__wave span {
    animation-duration: 1.35s;
    opacity: 0.88;
}

.incall-card__duration-dock {
    display: none;
    margin: 0;
    padding: 0 4px;
    font-family: "Geologica", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    color: #1f2937;
}

.modal-backdrop--incall.is-minimized .incall-card__duration-dock {
    display: block;
}

.modal-backdrop--incall.is-minimized .incall-card__header-label {
    flex: 0 0 auto;
}

.incall-card__header-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.incall-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.incall-header-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.modal-backdrop--incall:not(.is-minimized) .incall-card__maximize-btn {
    display: none !important;
}

.modal-backdrop--incall.is-minimized .incall-card__minimize-btn {
    display: none !important;
}

.modal-backdrop--incall.is-minimized .incall-card__body {
    display: none !important;
}

.modal-backdrop--incall:not(.is-minimized) .incall-hangup--micro {
    display: none !important;
}

.incall-hangup--micro {
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex-shrink: 0;
    margin-left: 4px;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.4);
}

.modal-backdrop--incall.is-minimized .incall-card__header {
    margin-bottom: 0;
}

.modal-backdrop--incall.is-minimized .incall-card__header-main {
    flex-wrap: wrap;
    row-gap: 6px;
    width: 100%;
}

.incall-card__sr-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.incall-card__wave-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.incall-card__wave {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 36px;
}

.incall-card__wave span {
    display: block;
    width: 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 100%);
    animation: incall-wave 0.9s ease-in-out infinite;
}

.incall-card__wave span:nth-child(1) {
    height: 12px;
    animation-delay: 0s;
}

.incall-card__wave span:nth-child(2) {
    height: 22px;
    animation-delay: 0.08s;
}

.incall-card__wave span:nth-child(3) {
    height: 32px;
    animation-delay: 0.16s;
}

.incall-card__wave span:nth-child(4) {
    height: 24px;
    animation-delay: 0.24s;
}

.incall-card__wave span:nth-child(5) {
    height: 32px;
    animation-delay: 0.32s;
}

.incall-card__wave span:nth-child(6) {
    height: 22px;
    animation-delay: 0.4s;
}

.incall-card__wave span:nth-child(7) {
    height: 12px;
    animation-delay: 0.48s;
}

@keyframes incall-wave {
    0%,
    100% {
        transform: scaleY(0.45);
        opacity: 0.75;
    }

    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.incall-card__divider {
    height: 2px;
    background: #4b5563;
    border-radius: 1px;
    margin: 0 auto 8px;
    width: 100%;
}

.incall-card__divider--short {
    width: 42%;
    height: 1px;
    background: #e5e7eb;
    margin-bottom: 10px;
}

.incall-card__duration {
    margin: 0 0 16px;
    text-align: center;
    font-family: "Geologica", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #1f2937;
}

/* Same 3-column grid as .incall-card__pad so icons line up with 1–3, 4–6, 7–9 / * 0 # */
.incall-card__action-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: center;
    justify-items: center;
    margin-bottom: 16px;
    padding: 0 2px;
}

.incall-icon-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    box-sizing: border-box;
    border-radius: 50%;
    aspect-ratio: 1;
    border: 2px solid #3b82f6;
    background: #fff;
    color: #2563eb;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.incall-icon-btn:hover {
    background: #eff6ff;
}

.incall-icon-btn--solid {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.incall-icon-btn--solid:hover {
    background: #2563eb;
}

.incall-card__pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: center;
    justify-items: center;
    margin-bottom: 18px;
    padding: 0 2px;
}

/* Match .incall-icon-btn (52×52) so columns line up with mute / keypad / transfer */
.incall-pad-key {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    background: #fff;
    color: #1e40af;
    font-family: "Geologica", sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: default;
}

.incall-card__hangup-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 8px;
}

.incall-hangup {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: #ef4444;
    color: #fff;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
    transition: background 0.15s ease, transform 0.1s ease;
}

.incall-hangup:hover {
    background: #dc2626;
}

.incall-hangup:active {
    transform: scale(0.96);
}

.modal-card {
    width: min(760px, 95vw);
    max-height: 90vh;
    overflow: auto;
    background: #f4f6f8;
    border: 1px solid #d9dee5;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    padding: 18px;
}

.modal-card--compact {
    width: min(460px, 95vw);
}

.modal-card--customer-record {
    width: min(720px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.modal-card--customer-record .customer-record-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 18px 18px;
}

.modal-card--customer-record .modal-header {
    padding: 18px 18px 12px;
    flex-shrink: 0;
}

.customer-record-meta-details {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--surface-muted, #f3f4f6);
    border: 1px solid var(--line);
}

.customer-record-meta-details__heading {
    margin: 0 0 10px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted, #6b7280);
}

.customer-record-meta-details__dl {
    margin: 0;
    display: grid;
    gap: 6px 16px;
    grid-template-columns: auto 1fr;
    font-size: 0.9375rem;
}

.customer-record-meta-details__row {
    display: contents;
}

.customer-record-meta-details__dl dt {
    margin: 0;
    font-weight: 600;
    color: var(--muted, #6b7280);
}

.customer-record-meta-details__dl dd {
    margin: 0;
    word-break: break-word;
}

.customer-record-form-scroll {
    overflow-y: auto;
    max-height: min(56vh, 520px);
    padding-right: 8px;
    margin-bottom: 4px;
}

.modal-card--customer-record .modal-actions {
    flex-shrink: 0;
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

#customer-record-modal.customer-record-modal--view .modal-actions {
    justify-content: flex-end;
}

#customer-record-modal.customer-record-modal--view .customer-record-field-input,
#customer-record-modal.customer-record-modal--view #customer-record-lead-id {
    opacity: 0.92;
    cursor: default;
}

.modal-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.manual-dial-form {
    display: grid;
    gap: 10px;
}

.manual-dial-note {
    margin: 0 0 6px;
    color: #5f7999;
    font-size: 0.86rem;
}

.manual-checkbox {
    justify-self: start;
}

.manual-actions {
    justify-content: center;
}

.transfer-mini-modal {
    width: min(340px, 92vw);
    background: #fff;
    border: 1px solid #d8c8c2;
    border-radius: 10px;
    padding: 10px 12px 12px;
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.22);
    text-align: center;
}

.transfer-mini-modal h3 {
    margin: 0 0 8px;
    font-size: 0.88rem;
    color: #57423f;
}

.transfer-lines {
    border: 1px solid #d8c8c2;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.transfer-line {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    font-size: 0.82rem;
    background: #fff;
}

.transfer-line + .transfer-line {
    border-top: 1px solid #e7dbd6;
}

.transfer-line a {
    text-transform: none;
    justify-self: start;
}

.transfer-line--active {
    background: #f0f7ff;
}

.transfer-line--highlight {
    background: #fff5df;
}

.transfer-status-flags {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.74rem;
    color: #5f7999;
    text-transform: uppercase;
}

.transfer-status-flags input {
    width: 12px;
    height: 12px;
}

.transfer-close-link {
    font-size: 0.84rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #d9dee5;
    border-radius: 10px;
    background: #eef1f4;
    margin-bottom: 14px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.02rem;
    color: #4b5563;
}

.transfer-form {
    display: grid;
    gap: 10px;
}

.transfer-row {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 12px;
    align-items: center;
}

.transfer-row label {
    justify-self: end;
    font-family: "Geologica", sans-serif;
    font-size: 0.88rem;
    color: #4b5563;
}

.modal-close {
    width: 34px;
    height: 34px;
}

.script-modal-card {
    width: min(1020px, 96vw);
    height: min(78vh, 620px);
    background: #f6f1ee;
    border: 1px solid #d8c8c2;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.22);
    display: grid;
    grid-template-rows: auto 1fr;
}

.script-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #e5d8d3;
}

.script-modal-header h2 {
    margin: 0;
    text-transform: uppercase;
    font-size: 0.95rem;
    color: #57423f;
}

.script-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.circle-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid #b8bec8;
    background: #ffffff;
    color: #5f7999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.circle-close-btn:hover {
    background: #f3f4f6;
}

.script-modal-body {
    padding: 14px;
    overflow: auto;
    color: #5f7999;
    line-height: 1.6;
    font-size: 0.92rem;
}

.disposition-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(239, 228, 222, 0.95);
    display: none;
    overflow: auto;
    padding: 24px;
}

.disposition-screen.is-open {
    display: block;
}

.disposition-card {
    max-width: 980px;
    margin: 0 auto;
    background: #f8f2ef;
    border: 1px solid #e0c7bb;
    border-radius: 12px;
    padding: 18px;
}

.disposition-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.disposition-header h2 {
    margin: 0;
    text-transform: uppercase;
    font-size: 1.1rem;
}

.disposition-header h2 span {
    color: var(--muted);
}

.disposition-header__actions {
    display: flex;
    gap: 8px;
}

.disposition-card h3 {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.9rem;
    color: var(--primary);
}

.disposition-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.disposition-column {
    background: #d9f3ff;
    border: 1px solid #83aee1;
    border-radius: 10px;
    min-height: 220px;
    padding: 10px;
    display: grid;
    align-content: start;
    gap: 8px;
}

.disposition-item {
    background: transparent;
    border: 0;
    text-align: left;
    color: #5f7999;
    font-family: "Geologica", sans-serif;
    font-weight: 600;
    font-size: 0.84rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    padding: 0;
}

.disposition-footer {
    margin-top: 16px;
    display: grid;
    justify-items: center;
    gap: 8px;
}

.disposition-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    font-family: "Geologica", sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
}

.disposition-checkbox input {
    width: 14px;
    height: 14px;
}

.disposition-footer__links {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 1080px) {
    .workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .panel-header,
    .columns-2,
    .columns-3,
    .columns-4 {
        grid-template-columns: 1fr;
    }
}

/* Reports page */
.brand__link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand__link:hover .brand__title {
    opacity: 0.92;
}

.profile-menu__section {
    padding: 8px 10px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8aa0bd;
}

.profile-menu__item--sub {
    padding-left: 12px;
}

.reports-page {
    margin-top: 12px;
}

.reports-page__inner {
    padding: 20px 22px 24px;
}

.reports-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.reports-page__title {
    margin: 0;
    font-family: "Geologica", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.reports-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 2px;
}

.reports-tab {
    font-family: "Geologica", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 10px 16px;
    border: none;
    border-radius: 10px 10px 0 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-transform: none;
}

.reports-tab:hover {
    color: var(--text);
    background: #f6f9ff;
}

.reports-tab.is-active {
    color: #2563eb;
    background: #eef5ff;
    box-shadow: inset 0 -2px 0 #2563eb;
}

.reports-panel {
    display: none;
}

.reports-panel.is-active {
    display: block;
}

.reports-panel__heading {
    margin: 0 0 8px;
    font-size: 1rem;
    font-family: "Geologica", sans-serif;
}

.reports-panel__title-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    width: 100%;
}

.reports-panel__title-row .reports-panel__heading {
    margin: 0;
    min-width: 0;
}

.reports-panel__title-row .reports-panel__head-action.btn--dark {
    justify-self: end;
    background: #3d3d3d;
    border-color: #3d3d3d;
    color: #ffffff;
}

.reports-panel__title-row .reports-panel__head-action.btn--dark:hover {
    background: #525252;
    border-color: #525252;
    filter: none;
}

.reports-panel__muted {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.88rem;
}

.reports-panel__muted--error {
    color: #b42318;
}

/* Dashboard — ambient canvas + KPI / charts / agents */
.reports-panel.reports-dashboard {
    position: relative;
    padding: 18px 16px 26px;
    border-radius: 14px;
    background:
        radial-gradient(ellipse 120% 90% at 8% -15%, rgba(129, 140, 248, 0.22) 0%, transparent 52%),
        radial-gradient(ellipse 90% 70% at 92% 8%, rgba(45, 212, 191, 0.14) 0%, transparent 48%),
        radial-gradient(ellipse 80% 60% at 50% 100%, rgba(251, 191, 36, 0.06) 0%, transparent 45%),
        linear-gradient(168deg, #fbfbff 0%, #f1f5f9 42%, #eef2ff 100%);
    border: 1px solid rgba(148, 163, 184, 0.38);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 1px 2px rgba(15, 23, 42, 0.04);
}

.reports-dashboard .reports-panel__heading {
    margin-bottom: 6px;
    font-size: 1.12rem;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.reports-dashboard .reports-panel__heading::after {
    content: "";
    display: block;
    width: 100%;
    max-width: 148px;
    height: 3px;
    margin-top: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366f1 0%, #3b82f6 35%, #14b8a6 72%, #f59e0b 100%);
    opacity: 0.92;
}

.reports-dashboard-intro {
    margin-bottom: 18px;
    color: #475569;
}

.reports-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.reports-dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    text-decoration: none;
    color: inherit;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
    box-shadow: 0 2px 12px -4px rgba(15, 23, 42, 0.08);
}

.reports-dashboard-card:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 8px 28px -10px rgba(79, 70, 229, 0.28);
    transform: translateY(-2px);
}

.reports-dashboard-card:nth-child(1) {
    background: linear-gradient(145deg, #ffffff 0%, #eef2ff 55%, #e0e7ff 100%);
    border-color: rgba(99, 102, 241, 0.42);
}

.reports-dashboard-card:nth-child(1):hover {
    border-color: rgba(79, 70, 229, 0.55);
    box-shadow: 0 8px 28px -10px rgba(99, 102, 241, 0.35);
}

.reports-dashboard-card:nth-child(2) {
    background: linear-gradient(145deg, #ffffff 0%, #f5f3ff 50%, #ede9fe 100%);
    border-color: rgba(139, 92, 246, 0.38);
}

.reports-dashboard-card:nth-child(2):hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 8px 28px -10px rgba(139, 92, 246, 0.3);
}

.reports-dashboard-card:nth-child(3) {
    background: linear-gradient(145deg, #ffffff 0%, #ecfeff 45%, #cffafe 100%);
    border-color: rgba(6, 182, 212, 0.38);
}

.reports-dashboard-card:nth-child(3):hover {
    border-color: rgba(6, 182, 212, 0.52);
    box-shadow: 0 8px 28px -10px rgba(6, 182, 212, 0.28);
}

.reports-dashboard-card:nth-child(4) {
    background: linear-gradient(145deg, #ffffff 0%, #fffbeb 50%, #fef3c7 100%);
    border-color: rgba(245, 158, 11, 0.42);
}

.reports-dashboard-card:nth-child(4):hover {
    border-color: rgba(245, 158, 11, 0.55);
    box-shadow: 0 8px 28px -10px rgba(245, 158, 11, 0.28);
}

.reports-dashboard-card:nth-child(5) {
    background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 60%, #e2e8f0 100%);
    border-color: rgba(100, 116, 139, 0.35);
}

.reports-dashboard-card:nth-child(5):hover {
    border-color: rgba(71, 85, 105, 0.45);
    box-shadow: 0 8px 28px -10px rgba(71, 85, 105, 0.22);
}

.reports-dashboard-card:nth-child(6) {
    background: linear-gradient(145deg, #ffffff 0%, #ecfdf5 50%, #d1fae5 100%);
    border-color: rgba(16, 185, 129, 0.4);
}

.reports-dashboard-card:nth-child(6):hover {
    border-color: rgba(16, 185, 129, 0.52);
    box-shadow: 0 8px 28px -10px rgba(16, 185, 129, 0.28);
}

.reports-dashboard-card:nth-child(1) .reports-dashboard-card__icon {
    color: #6366f1;
}

.reports-dashboard-card:nth-child(2) .reports-dashboard-card__icon {
    color: #8b5cf6;
}

.reports-dashboard-card:nth-child(3) .reports-dashboard-card__icon {
    color: #0891b2;
}

.reports-dashboard-card:nth-child(4) .reports-dashboard-card__icon {
    color: #d97706;
}

.reports-dashboard-card:nth-child(5) .reports-dashboard-card__icon {
    color: #64748b;
}

.reports-dashboard-card:nth-child(6) .reports-dashboard-card__icon {
    color: #059669;
}

.reports-dashboard-card--static {
    cursor: default;
}

.reports-dashboard-card--static:hover {
    transform: none;
}

.reports-dashboard-card--static:nth-child(5):hover,
.reports-dashboard-card--static:nth-child(6):hover {
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 2px 12px -4px rgba(15, 23, 42, 0.08);
}

.reports-dashboard-card__icon {
    font-size: 1.1rem;
    color: var(--muted);
}

.reports-dashboard-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: "Geologica", sans-serif;
    color: #0f172a;
    line-height: 1.2;
}

.reports-dashboard-card__label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
}

.reports-dashboard-charts-heading,
.reports-dashboard-agents-heading {
    position: relative;
    margin: 22px 0 12px;
    padding-left: 14px;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.reports-dashboard-charts-heading::before,
.reports-dashboard-agents-heading::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.12em;
    bottom: 0.12em;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #6366f1 0%, #3b82f6 40%, #14b8a6 100%);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.reports-dashboard-agents-heading {
    margin-top: 26px;
}

.reports-dashboard-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 900px) {
    .reports-dashboard-charts {
        grid-template-columns: 1.4fr 1fr 1fr;
        align-items: start;
    }
}

.reports-dashboard-charts--dispositions {
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .reports-dashboard-charts--dispositions {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.reports-dashboard-dispositions-note {
    margin: -4px 0 14px;
    font-size: 0.82rem;
}

.reports-dashboard-chart-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 12px;
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
    padding: 14px 16px 16px;
    box-shadow:
        0 4px 22px -8px rgba(15, 23, 42, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.reports-dashboard-chart-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1 0%, #3b82f6 38%, #06b6d4 68%, #a855f7 100%);
    opacity: 0.9;
}

.reports-dashboard-chart-card__title {
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.reports-dashboard-chart-card__canvas-wrap {
    position: relative;
    min-height: 200px;
}

.reports-dashboard-chart-card__canvas-wrap--compact {
    min-height: 180px;
    max-width: 280px;
    margin: 0 auto;
}

.reports-dashboard-chart-empty {
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: var(--muted);
    text-align: center;
}

.reports-dashboard-agents-note {
    margin-bottom: 14px;
    color: #64748b;
}

.reports-dashboard .reports-table-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 6px 28px -12px rgba(15, 23, 42, 0.15);
}

.reports-dashboard .reports-dashboard-agents-table thead {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

.reports-dashboard .reports-dashboard-agents-table thead th {
    color: #334155;
    font-weight: 600;
    border-bottom-color: rgba(148, 163, 184, 0.45);
}

.reports-dashboard .reports-dashboard-agents-table tbody tr {
    background: rgba(255, 255, 255, 0.65);
}

.reports-dashboard .reports-dashboard-agents-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.95);
}

.reports-dashboard-agents-table__name {
    font-weight: 600;
}

.reports-dashboard-agent-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text);
}

.reports-dashboard-agent-status--live {
    font-weight: 600;
    color: #166534;
}

.reports-dashboard-agent-status__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.reports-dashboard-agent-listen-placeholder {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.reports-dashboard-agent-listen-btn {
    color: #4f46e5;
}

.reports-dashboard-agent-listen-btn:hover {
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.55);
    background: linear-gradient(145deg, rgba(238, 242, 255, 0.95) 0%, rgba(224, 231, 255, 0.75) 100%);
    box-shadow: 0 2px 10px -4px rgba(79, 70, 229, 0.35);
}

.reports-customer-toolbar {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.reports-customer-toolbar__left {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.reports-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

.reports-pagination__status {
    font-size: 0.88rem;
    color: var(--muted);
}

.reports-pagination__btn.reports-pagination__btn--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.reports-customer-toolbar__label {
    font-size: 0.76rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.reports-customer-toolbar__select {
    width: auto;
    min-width: 200px;
    max-width: min(420px, 100%);
}

.reports-recordings-filters {
    margin-bottom: 12px;
}

.reports-customer-toolbar--recordings {
    align-items: flex-end;
}

.reports-customer-toolbar__select--disposition {
    min-width: 180px;
    max-width: min(360px, 100%);
}

.reports-customer-toolbar__search {
    flex: 1 1 220px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reports-recordings-search-input {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--line);
    font-size: 0.85rem;
    font-family: "Roboto", sans-serif;
    background: #fcfdff;
}

.reports-customer-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}

/* Actions body: flex cell; default column stack. Leads + customer-records-full use table-cell so row borders align. */
.reports-table td.reports-table__actions {
    vertical-align: top;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    white-space: normal;
}

.reports-table th.reports-table__actions {
    vertical-align: top;
    display: table-cell;
    white-space: nowrap;
    word-break: normal;
}

.reports-table__actions .reports-table__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    flex-shrink: 0;
}

/*
 * Freeze last column (Actions) when scrolling horizontally.
 * Do NOT apply sticky to .reports-table--customer-records-full: in Chromium/WebKit,
 * sticky last-column th/td often misaligns — the header stays in the table grid while
 * body cells paint at the scrollport edge, leaving an empty “Actions” column and
 * floating Edit/Delete. Leads table (few columns) is fine with sticky.
 */
.reports-table-wrap--scroll
    .reports-table:not(.reports-table--customer-records-full)
    th.reports-table__actions,
.reports-table-wrap--scroll
    .reports-table:not(.reports-table--customer-records-full)
    td.reports-table__actions {
    position: sticky;
    right: 0;
    z-index: 2;
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 14px -10px rgba(15, 23, 42, 0.18);
}

.reports-table-wrap--scroll
    .reports-table:not(.reports-table--customer-records-full)
    th.reports-table__actions {
    min-width: 7rem;
    max-width: none;
    width: auto;
}

.reports-table-wrap--scroll
    .reports-table:not(.reports-table--customer-records-full)
    td.reports-table__actions {
    min-width: 0;
    max-width: 5.5rem;
    width: 1%;
}

.reports-table-wrap--scroll
    .reports-table:not(.reports-table--customer-records-full)
    thead
    th.reports-table__actions {
    z-index: 4;
    background: #f3f7fd;
}

.reports-table-wrap--scroll
    .reports-table:not(.reports-table--customer-records-full)
    tbody
    td.reports-table__actions {
    background: #fbfcfe;
}

/* Wide customer table: no sticky (see comment above); Actions: active toggle + icons in one row */
.reports-table-wrap--scroll .reports-table--customer-records-full th.reports-table__actions,
.reports-table-wrap--scroll .reports-table--customer-records-full td.reports-table__actions {
    border-left: 1px solid var(--line);
    min-width: 0;
    max-width: 12.5rem;
    width: 1%;
    padding-left: 6px;
    padding-right: 6px;
}

.reports-table-wrap--scroll .reports-table--customer-records-full th.reports-table__actions {
    min-width: 10rem;
    background: #f3f7fd;
    white-space: nowrap;
    word-break: normal;
}

.reports-table-wrap--scroll .reports-table--customer-records-full td.reports-table__actions {
    background: #fbfcfe;
}

/* Use table-cell, not flex, on td — flex breaks border-collapse row lines next to this column. */
.reports-table--customer-records-full td.reports-table__actions {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
    text-align: left;
}

.reports-table--customer-records-full td.reports-table__actions .customer-record-actions__inner {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    vertical-align: middle;
}

.reports-table--recordings td.reports-table__actions {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
    text-align: left;
}

.reports-table--recordings td.reports-table__actions .recording-actions__inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/*
 * Dashboard agent activity: Listen column must use table-cell. The generic rule
 * `.reports-table td.reports-table__actions { display: flex }` comes later and was
 * overriding a lower-specificity fix — flex breaks border-collapse row lines.
 */
.reports-table.reports-dashboard-agents-table td.reports-table__actions {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
    text-align: center;
}

/* Recording preview modal — reuses .incall-card__wave (same animation as softphone) */
.modal-card--recording-player {
    width: min(420px, 94vw);
}

.recording-player-body {
    padding: 8px 4px 12px;
}

.recording-player-stage {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 112px;
    margin-bottom: 14px;
}

.recording-player-live-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.recording-player-live-rings span {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(34, 197, 94, 0.5);
    animation: recording-live-ring 2.4s ease-out infinite;
}

.recording-player-live-rings span:nth-child(2) {
    animation-delay: 0.55s;
}

.recording-player-live-rings span:nth-child(3) {
    animation-delay: 1.1s;
}

@keyframes recording-live-ring {
    0% {
        transform: scale(0.65);
        opacity: 0.85;
    }

    100% {
        transform: scale(2.35);
        opacity: 0;
    }
}

.recording-player-wave-wrap {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}

.recording-player-wave-wrap.recording-player-wave-wrap--live .incall-card__wave span {
    background: linear-gradient(180deg, #86efac 0%, #15803d 100%);
    animation-name: live-listen-wave;
    animation-duration: 0.52s;
    animation-timing-function: ease-in-out;
}

@keyframes live-listen-wave {
    0%,
    100% {
        transform: scaleY(0.38);
        opacity: 0.72;
    }

    50% {
        transform: scaleY(1.08);
        opacity: 1;
    }
}

.recording-player-hint {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.45;
    text-align: center;
}

/* Shared pill toggle: Leads + Customer records Actions */
.reports-active-toggle {
    display: inline-block;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    vertical-align: middle;
    flex-shrink: 0;
}

.reports-active-toggle:active:not(:disabled) {
    transform: scale(0.98);
}

.reports-active-toggle:disabled {
    opacity: 0.45;
    cursor: wait;
}

.reports-active-toggle__track {
    display: block;
    position: relative;
    width: 4.35rem;
    height: 1.48rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #dfe1e6 0%, #c8cbd2 100%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.16);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.reports-active-toggle.is-active .reports-active-toggle__track {
    background: linear-gradient(180deg, #6aa3e8 0%, #3d7ab8 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

.reports-active-toggle__thumb {
    position: absolute;
    top: 50%;
    left: 0.18rem;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: -0.575rem;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff 0%, #e4e6ec 100%);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.32);
    transition: left 0.2s ease;
    z-index: 1;
}

.reports-active-toggle.is-active .reports-active-toggle__thumb {
    left: calc(100% - 1.15rem - 0.18rem);
}

.reports-active-toggle__label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0.03em;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.reports-active-toggle__label--active {
    left: 0.38rem;
}

.reports-active-toggle__label--inactive {
    right: 0.32rem;
}

.reports-active-toggle.is-active .reports-active-toggle__label--active {
    color: rgba(255, 255, 255, 0.95);
    opacity: 1;
}

.reports-active-toggle.is-active .reports-active-toggle__label--inactive {
    opacity: 0.3;
    color: rgba(255, 255, 255, 0.55);
}

.reports-active-toggle:not(.is-active) .reports-active-toggle__label--active {
    opacity: 0.32;
    color: rgba(75, 85, 99, 0.55);
}

.reports-active-toggle:not(.is-active) .reports-active-toggle__label--inactive {
    opacity: 1;
    color: rgba(55, 65, 81, 0.92);
}

.reports-table--customer-records-full td.reports-table__actions .reports-table__icon-btn + .reports-table__icon-btn {
    margin-left: 0;
}

/*
 * Leads table: Actions should stay narrow and icons in one row (not the customer vertical stack).
 * Sticky rules above use :not(.customer-records-full); this overrides #leads-master-table only.
 */
.reports-table-wrap--scroll #leads-master-table th.reports-table__actions,
.reports-table-wrap--scroll #leads-master-table td.reports-table__actions {
    min-width: 0;
    max-width: 12.5rem;
    width: 1%;
    padding-left: 6px;
    padding-right: 6px;
}

.reports-table-wrap--scroll #leads-master-table th.reports-table__actions {
    min-width: 10rem;
}

#leads-master-table td.reports-table__actions .lead-actions__inner {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    vertical-align: middle;
}

#leads-master-table td.reports-table__actions {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
    text-align: left;
}

#leads-master-table .leads-master-name-link {
    color: #3d5f8a;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(61, 95, 138, 0.35);
}

#leads-master-table .leads-master-name-link:hover {
    color: #1e4a7a;
    border-bottom-color: currentColor;
}

.reports-pill {
    display: inline-block;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    vertical-align: middle;
}

.reports-pill--green {
    background: rgba(97, 147, 0, 0.18);
    color: #3d5a06;
}

.reports-pill--gray {
    background: rgba(95, 121, 153, 0.14);
    color: #3d4d5f;
}

.reports-pill--orange {
    background: rgba(249, 156, 37, 0.22);
    color: #8a4a0a;
}

.reports-pill--blue {
    background: rgba(131, 174, 225, 0.28);
    color: #1e4a7a;
}

.reports-table--customer-records-full tbody tr.customer-record-row--tone-green td:first-child {
    box-shadow: inset 4px 0 0 0 #619300;
}

.reports-table--customer-records-full tbody tr.customer-record-row--tone-gray td:first-child {
    box-shadow: inset 4px 0 0 0 #8a9bab;
}

.reports-table--customer-records-full tbody tr.customer-record-row--tone-orange td:first-child {
    box-shadow: inset 4px 0 0 0 #e88a0c;
}

.reports-table--customer-records-full tbody tr.customer-record-row--tone-blue td:first-child {
    box-shadow: inset 4px 0 0 0 #5f8fd4;
}

.lead-import-hint {
    margin: 0 0 14px;
}

.lead-import-hint--demo {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: rgba(249, 156, 37, 0.12);
}

.reports-table__actions .btn--link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.lead-form .field-group {
    margin-bottom: 12px;
}

.reports-table__empty {
    color: var(--muted);
    font-style: italic;
    text-align: center;
}

.reports-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfe;
}

.reports-table-wrap--scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.reports-table-wrap--scroll .reports-table--customer-records-full {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.reports-table--customer-records-full th,
.reports-table--customer-records-full td {
    white-space: pre-wrap;
    word-break: break-word;
    vertical-align: top;
    min-width: 6.5rem;
    max-width: 22rem;
}

.reports-table--customer-records-full th {
    white-space: normal;
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.reports-table th,
.reports-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.reports-table th {
    font-family: "Geologica", sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: #f3f7fd;
}

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

.reports-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #e8eef8;
    color: #44566f;
}

.reports-badge--success {
    background: #e6f4d9;
    color: #3d6600;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: radial-gradient(circle at top right, #f9f2ef 0%, var(--bg) 50%);
}

.login-shell {
    width: 100%;
    max-width: 420px;
    padding: 24px 16px;
}

.login-card {
    padding: 28px 26px 24px;
}

.login-brand {
    text-align: center;
    margin-bottom: 26px;
}

.login-brand .brand__title {
    font-size: clamp(2.1rem, 7vw, 2.85rem);
    font-weight: 800;
    margin: 0 0 8px;
}

.login-error {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff1ee;
    border: 1px solid #f1beb3;
    color: #9a3412;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.login-form .field-group {
    margin-bottom: 14px;
}

.login-submit {
    width: 100%;
    margin-top: 6px;
    justify-content: center;
    gap: 8px;
}

.login-hint {
    margin: 18px 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.45;
}

.login-hint strong {
    color: #44566f;
}

.login-optional {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.85em;
}

/* Profile page */
.profile-page {
    margin-top: 12px;
}

.profile-page__inner {
    padding: 20px 22px 28px;
    width: 100%;
    box-sizing: border-box;
}

.profile-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.profile-page__title {
    margin: 0;
    font-family: "Geologica", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 16px;
    margin-bottom: 22px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, #f8fbff 0%, #fff9f5 100%);
}

.profile-hero__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8aa7cb;
    color: #ffffff;
    font-family: "Geologica", sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-hero__name {
    margin: 0 0 4px;
    font-family: "Geologica", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.profile-hero__role {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.profile-details {
    margin: 0;
    padding: 0;
}

.profile-details__row {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--line);
    align-items: baseline;
}

.profile-details__row:last-of-type {
    border-bottom: none;
}

.profile-details dt {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-details dt i {
    width: 1.1em;
    color: #8aa0bd;
}

.profile-details dd {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 500;
}

.profile-actions {
    margin-top: 22px;
    padding-top: 8px;
}

@media (max-width: 560px) {
    .profile-details__row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
