:root {
            --primary-color: #5E6A9C;
            --secondary-color: #868E96;
            --background-color: #F4F6F9;
            --panel-bg-color: #ffffff;
            --text-color: #343A40;
            --border-color: #e9ecef;
            --green-status: #16C79A;
            --red-status: #E57373;
            --yellow-status: #FFB74D;
            --blue-status: #64B5F6;
        }

        html,
        body {
            height: 100%;
        }

        button:focus {
            outline: none;
            box-shadow: none
        }

        body {
            font-family: "Lato", sans-serif;
            background:
                radial-gradient(circle at top left, rgba(100, 181, 246, .18), transparent 30%),
                radial-gradient(circle at bottom right, rgba(94, 106, 156, .16), transparent 32%),
                linear-gradient(145deg, #eef2f8 0%, #f7f9fc 48%, #eef3fb 100%);
            color: var(--text-color);
            display: flex;
            align-items: stretch;
            justify-content: center;
            min-height: 100vh;
            min-height: 100dvh;
            padding: 12px;
            margin: 0;
            overflow: hidden;
            box-sizing: border-box;
        }

        /* =========================================================
         * Login overlay – redesigned
         * ======================================================= */
        #login-overlay {
            position: fixed;
            inset: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1050;
            opacity: 1;
            transition: opacity .3s;
            background: linear-gradient(135deg, #1a2340 0%, #2d3a5e 50%, #1e2d55 100%);
        }

        #login-overlay.hidden {
            opacity: 0;
            pointer-events: none;
        }

        /* Card */
        .login-container {
            width: 100%;
            max-width: 400px;
            background: #fff;
            border-radius: 20px;
            padding: 36px 32px 28px;
            box-shadow: 0 32px 80px rgba(0,0,0,.35);
        }

        /* Header */
        .login-header {
            text-align: center;
            margin-bottom: 28px;
        }

        .login-icon-wrap {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary-color, #5E6A9C), #7686bd);
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            margin-bottom: 14px;
            box-shadow: 0 8px 24px rgba(94,106,156,.35);
        }

        .login-title {
            font-size: 1.6rem;
            font-weight: 800;
            color: #1a2340;
            margin: 0 0 6px;
            letter-spacing: -.01em;
        }

        .login-subtitle {
            font-size: .9rem;
            color: #7b8aaa;
            margin: 0;
        }

        /* Fields */
        .login-field {
            margin-bottom: 14px;
        }

        .login-label {
            display: block;
            margin-bottom: 6px;
            font-size: .82rem;
            font-weight: 700;
            color: #3a4766;
            letter-spacing: .02em;
            text-transform: uppercase;
        }

        .input-icon-wrap {
            position: relative;
        }

        .input-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: #9aa5bf;
            font-size: .85rem;
            pointer-events: none;
        }

        .login-input {
            height: 48px;
            padding: 0 44px 0 38px;
            border-radius: 12px;
            border: 1.5px solid #dde3f0;
            background: #f7f9fc;
            font-size: .95rem;
            color: #1a2340;
            width: 100%;
            transition: border-color .2s, box-shadow .2s, background .2s;
        }

        .login-input:focus {
            outline: none;
            border-color: var(--primary-color, #5E6A9C);
            background: #fff;
            box-shadow: 0 0 0 4px rgba(94,106,156,.12);
        }

        .password-toggle-btn {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #9aa5bf;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: color .2s, background .2s;
        }

        .password-toggle-btn:hover {
            color: var(--primary-color, #5E6A9C);
            background: rgba(94,106,156,.08);
        }

        /* Button */
        .btn-login {
            margin-top: 8px;
            height: 50px;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--primary-color, #5E6A9C), #7686bd);
            color: #fff;
            border: none;
            box-shadow: 0 8px 22px rgba(94,106,156,.3);
            transition: transform .2s, box-shadow .2s, filter .2s;
            letter-spacing: .02em;
        }

        .btn-login:hover {
            filter: brightness(1.06);
            transform: translateY(-1px);
            box-shadow: 0 12px 28px rgba(94,106,156,.35);
            color: #fff;
        }

        .btn-login:focus {
            box-shadow: 0 0 0 4px rgba(94,106,156,.22);
            color: #fff;
        }

        /* Footer note */
        .login-footer-note {
            text-align: center;
            margin: 14px 0 0;
            font-size: .78rem;
            color: #9aabcb;
        }

        /* Progress screen */
        .login-progress {
            width: 100%;
            max-width: 400px;
            text-align: center;
            padding: 48px 32px;
            background: rgba(255,255,255,.07);
            border-radius: 20px;
            backdrop-filter: blur(6px);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
        }

        .lp-spinner {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: rgba(255,255,255,.12);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            color: #fff;
        }

        .login-progress h4 {
            color: #fff;
            font-weight: 700;
            font-size: 1.1rem;
            margin: 0;
        }

        .login-progress p {
            color: rgba(255,255,255,.6);
            margin: 0;
            font-size: .9rem;
        }

        .dialer-container {
            max-width: 1000px;
            width: 100%;
            background: var(--panel-bg-color);
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
            overflow: hidden;
            position: relative; /* for drawer overlay */
            display: flex;
            flex-direction: column;
            min-height: 0;
            height: calc(100vh - 24px);
            height: calc(100dvh - 24px);
        }

        .dialer-header {
            background: var(--primary-color);
            color: #fff;
            padding: 7px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center
        }

        .agent-info .agent-name {
            font-weight: 700;
            font-size: 1.1rem
        }

        .agent-status {
            display: flex;
            align-items: center;
            font-size: .9rem
        }

        .status-indicator {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-right: 3px;
            transition: background-color .3s
        }

        .status-indicator.available {
            background: var(--green-status)
        }

        .status-indicator.busy {
            background: var(--yellow-status)
        }

        .status-indicator.offline {
            background: var(--red-status)
        }

        .btn-header-action {
            background: transparent;
            border: none;
            color: #fff;
            font-size: 1rem;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            line-height: 1;
            transition: .2s
        }

        .btn-header-action:hover {
            background: rgba(255, 255, 255, .2)
        }

        .btn-dnd.active {
            background: var(--red-status);
            color: #fff
        }

        .btn-break.active {
            background: var(--yellow-status);
            color: #fff
        }

        .logout-btn {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, .5);
            color: #fff;
            padding: 5px 16px;
            border-radius: 25px;
            font-size: .9rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            transition: .2s
        }

        .logout-btn i {
            margin-right: 8px
        }

        .logout-btn:hover {
            background: #fff;
            color: var(--primary-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(0, 0, 0, .1)
        }

        .incoming-call-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, .6);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000
        }

        .incoming-call-modal {
            background: var(--panel-bg-color);
            padding: 40px;
            border-radius: 15px;
            text-align: center;
            box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
            animation: pulse 1.5s infinite
        }

        .incoming-call-modal h3 {
            margin-bottom: 10px;
            color: var(--secondary-color)
        }

        .incoming-caller-id {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 30px
        }

        .incoming-call-actions .btn {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            font-size: 1.8rem;
            margin: 0 15px;
            color: #fff;
            border: none
        }

        .btn-accept {
            background: var(--green-status)
        }

        .btn-decline {
            background: var(--red-status)
        }

        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(23, 162, 184, .7)
            }

            70% {
                box-shadow: 0 0 0 20px rgba(23, 162, 184, 0)
            }

            100% {
                box-shadow: 0 0 0 0 rgba(23, 162, 184, 0)
            }
        }

        .dialer-body {
            display: flex;
            flex-direction: column;
            background: linear-gradient(180deg, #f7f9ff 0%, #ffffff 55%, #f7f9ff 100%);
            flex: 1 1 auto;
            min-height: 0;
        }

        .dialer-left-panel {
            flex: 1 1 auto;
            padding: 16px;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        .dialpad-panel {
            max-width: 560px;
            margin: 0 auto;
            width: 100%;
        }

        .dialer-tabs {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
        }

        .dialer-tab-nav {
            display: flex;
            flex-wrap: nowrap;
            gap: 4px;
            padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
            background: rgba(248, 249, 252, 0.96);
            border-top: 1px solid var(--border-color);
            box-shadow: 0 -8px 24px rgba(0, 0, 0, .06);
            flex: 0 0 auto;
        }

        .dialer-tab-nav .nav-link {
            flex: 1 1 0;
            border: none;
            border-radius: 12px;
            background: transparent;
            color: var(--secondary-color);
            font-weight: 700;
            padding: 6px 4px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            white-space: nowrap;
            min-height: 36px;
        }

        .dialer-tab-nav .nav-link.active {
            background: rgba(94, 106, 156, 0.12);
            color: var(--primary-color);
            box-shadow: inset 0 0 0 1px rgba(94, 106, 156, 0.12);
        }

        .dialer-tab-nav .nav-link i {
            font-size: .95rem;
            line-height: 1;
        }

        .call-status-area {
            text-align: center;
            padding: 8px 10px;
            border: 1px solid rgba(94, 106, 156, 0.12);
            border-radius: 14px;
            margin-bottom: 8px;
            min-height: 64px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            transition: .3s;
            flex: 0 0 auto;
            background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
            box-shadow: 0 12px 24px rgba(94, 106, 156, 0.08);
        }

        .call-status-area.ringing {
            border-color: var(--blue-status);
            box-shadow: 0 0 10px rgba(23, 162, 184, .3)
        }

        .call-status-area.connected {
            border-color: var(--green-status);
            box-shadow: 0 0 10px rgba(40, 167, 69, .3)
        }

        .call-status-area.on-hold {
            border-color: var(--yellow-status);
            box-shadow: 0 0 10px rgba(255, 193, 7, .3)
        }

        #welcome-message {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        #welcome-message h4 {
            margin: 0;
            font-size: .92rem;
            font-weight: 700;
            color: #2f3758;
        }

        #welcome-message p {
            margin: 0;
            max-width: 240px;
            font-size: .75rem;
            line-height: 1.2;
            color: var(--secondary-color);
        }

        .welcome-badge {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--primary-color);
            background: rgba(94, 106, 156, 0.12);
            box-shadow: inset 0 0 0 1px rgba(94, 106, 156, 0.08);
            font-size: .78rem;
        }

        .caller-id {
            font-size: 1.5rem;
            font-weight: 700
        }

        .call-timer {
            font-size: 1.2rem;
            color: var(--secondary-color)
        }

        .call-state {
            font-size: 1rem;
            font-weight: 700;
            text-transform: uppercase
        }

        .call-state.ringing {
            color: var(--blue-status)
        }

        .call-state.connected {
            color: var(--green-status)
        }

        .call-state.on-hold {
            color: var(--yellow-status)
        }

        .dtmf-sequence-display {
            min-height: 28px;
            font-size: 1.5rem;
            color: var(--secondary-color);
            letter-spacing: 4px;
            font-weight: 700;
            margin: 5px 0;
            word-break: break-all
        }

        .in-call-actions {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: 10px
        }

        .in-call-actions .btn-call-action {
            background: #f6f8fa;
            border: none;
            color: #555;
            border-radius: 50%;
            width: 42px;
            height: 42px;
            font-size: 1rem;
            transition: .2s
        }

        .in-call-actions .btn-call-action:hover {
            background: #eef1f6;
            transform: translateY(-2px)
        }

        .in-call-actions .btn-call-action.active {
            background: var(--primary-color);
            color: #fff
        }

        .number-input-container {
            position: relative;
            margin-bottom: clamp(6px, 1vh, 10px);
            flex: 0 0 auto;
            background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
            border-radius: 14px;
            padding: clamp(4px, 0.8vh, 8px) clamp(8px, 1.2vw, 12px);
            box-shadow: 0 10px 22px rgba(94, 106, 156, 0.08);
        }

        #phone-number-input {
            width: 100%;
            height: clamp(36px, 5.2vh, 48px);
            padding: 6px clamp(38px, 4.8vw, 46px) 6px clamp(10px, 1.6vw, 14px);
            font-size: clamp(.98rem, 2.2vh, 1.2rem);
            text-align: center;
            letter-spacing: clamp(.5px, 0.15vw, 1px);
            border: none;
            border-radius: 10px;
            background: #fcfdff;
            color: #2f3758;
            font-weight: 700;
        }

        #phone-number-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 4px rgba(94, 106, 156, 0.12)
        }

        #phone-number-input:disabled {
            background: #f0f2f5;
            cursor: not-allowed
        }

        .backspace-btn {
            position: absolute;
            right: clamp(12px, 1.6vw, 16px);
            top: 50%;
            transform: translateY(-50%);
            border: none;
            background: #eef2fb;
            font-size: clamp(.72rem, 1.5vh, .86rem);
            color: var(--primary-color);
            cursor: pointer;
            width: clamp(24px, 3.2vh, 30px);
            height: clamp(24px, 3.2vh, 30px);
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .backspace-btn:hover {
            background: #e2e8f7;
            color: var(--red-status)
        }

        .dialpad {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            flex: 1 1 auto;
            align-content: start;
        }

        .dialpad-btn {
            min-height: 40px;
            height: clamp(40px, 6.6vh, 54px);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            background: var(--panel-bg-color);
            font-size: 1.05rem;
            font-weight: 700;
            transition: .2s
        }

        .dialpad-btn:hover {
            background: #f0f0f0;
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(0, 0, 0, .05)
        }

        .dialpad-btn:active {
            transform: translateY(0);
            box-shadow: none
        }

        .dialpad-btn .sub-text {
            font-size: .68rem;
            color: var(--secondary-color);
            font-weight: 400
        }

        .call-actions {
            display: flex;
            justify-content: center;
            align-items: center;
            position: sticky;
            bottom: 0;
            margin-top: auto;
            padding: 8px 0 4px;
            min-height: 58px;
            flex: 0 0 auto;
            z-index: 4;
            background: linear-gradient(180deg, rgba(247, 249, 255, 0) 0%, rgba(247, 249, 255, 0.92) 28%, #f7f9ff 100%);
        }

        .btn-main-action {
            width: 58px;
            height: 58px;
            border: none;
            border-radius: 50%;
            font-size: 1.45rem;
            transition: .2s;
            display: flex;
            align-items: center;
            justify-content: center
        }

        .btn-call {
            background: var(--green-status);
            color: #fff
        }

        .btn-call:hover {
            background: #218838
        }

        .btn-hangup {
            background: var(--red-status);
            color: #fff
        }

        .btn-hangup:hover {
            background: #c82333
        }

        .dialer-tab-content {
            padding: 10px;
            flex: 1 1 auto;
            min-height: 0;
            overflow: auto;
            padding-bottom: 6px;
        }

        .dialer-panel-card {
            background: #fbfdff;
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 12px;
            box-shadow: 0 12px 26px rgba(0, 0, 0, .07);
            min-height: 100%;
        }

        .dialer-tab-content > .tab-pane {
            min-height: 100%;
        }

        .dialer-tab-content > .tab-pane.active,
        .dialer-tab-content > .tab-pane.show,
        .dialer-tab-content > .tab-pane.show.active {
            display: flex;
            flex-direction: column;
        }

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

        .tab-section-title {
            font-weight: 700;
            color: var(--text-color);
            margin: 0
        }

        .tab-section-sub {
            color: var(--secondary-color);
            font-size: .9rem
        }

        .tab-icon-btn {
            border: 1px solid var(--border-color);
            background: #f4f6fd;
            color: var(--primary-color);
            width: 38px;
            height: 38px;
            border-radius: 12px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 6px 14px rgba(0, 0, 0, .06)
        }

        .tab-icon-btn:hover {
            background: #e9edfb
        }

        .search-bar {
            margin-bottom: 20px;
            width: 100%;
        }

        .log-item,
        .contact-item {
            display: flex;
            align-items: center;
            padding: 12px 5px;
            border-bottom: 1px solid var(--border-color);
            transition: background-color .2s
        }

        .log-item:hover,
        .contact-item:hover {
            background: #eef1f6;
            cursor: pointer
        }

        .log-item .call-icon,
        .contact-item .contact-icon {
            font-size: 1.2rem;
            margin-right: 15px;
            width: 30px;
            text-align: center
        }

        .call-icon.incoming {
            color: var(--green-status)
        }

        .call-icon.outgoing {
            color: var(--primary-color)
        }

        .call-icon.missed {
            color: var(--red-status)
        }

        .item-details {
            flex: 1;
            line-height: 1.3
        }

        .item-name {
            font-weight: 700
        }

        .item-meta {
            font-size: .85rem;
            color: var(--secondary-color)
        }

        .call-button {
            background: transparent;
            border: none;
            color: var(--green-status);
            font-size: 1.5rem;
            opacity: 0;
            transform: scale(.8);
            transition: .2s
        }

        .contact-item:hover .call-button {
            opacity: 1;
            transform: scale(1)
        }

        @media (max-width:992px) {
            .dialpad-panel {
                max-width: none
            }
        }

        @media (max-width:768px) {
            body {
                padding: 0;
                align-items: flex-start
            }

            .login-container,
            .login-progress {
                padding: 26px 22px 22px;
                border-radius: 16px;
            }

            .login-title {
                font-size: 1.35rem;
            }

            .login-icon-wrap {
                width: 52px;
                height: 52px;
                font-size: 1.25rem;
            }

            .dialer-container {
                border-radius: 0;
                min-height: 100vh;
                min-height: 100dvh;
                height: 100vh;
                height: 100dvh;
            }

            .dialer-header {
                padding: 10px 14px;
            }

            .dialer-left-panel,
            .dialer-tab-content {
                padding: 8px;
            }

            .dialer-tab-nav {
                padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
                gap: 4px;
            }

            .dialpad {
                gap: 6px;
            }

            .dialpad-btn {
                font-size: 1rem;
            }
        }

        @media (max-height: 760px) {
            .dialer-header {
                padding: 6px 14px;
            }

            .dialer-tab-nav {
                padding-top: 5px;
                padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px));
            }

            .dialer-left-panel,
            .dialer-tab-content {
                padding-top: 8px;
                padding-bottom: 8px;
            }

            .call-status-area {
                margin-bottom: 6px;
                min-height: 58px;
                padding-top: 8px;
                padding-bottom: 8px;
            }

            .number-input-container {
                margin-bottom: 6px;
                padding-top: 5px;
                padding-bottom: 5px;
            }

            .dialpad {
                gap: 6px;
            }

            .call-actions {
                min-height: 52px;
                padding-top: 4px;
                padding-bottom: 2px;
            }
        }

        @media (min-height: 820px) {
            .number-input-container {
                margin-bottom: 10px;
            }

            #phone-number-input {
                height: 46px;
                font-size: 1.14rem;
            }
        }

        /* hide technical sections */
        #remote-audio audio {
            display: block;
            margin-top: 6px;
            width: 100%
        }

        /* ====== NEW: Customer Drawer styling ====== */
        .drawer-scrim {
            position: absolute;
            inset: 0;
            background: rgba(52, 58, 64, 0.12);
            opacity: 0;
            pointer-events: none;
            transition: opacity .25s ease;
            z-index: 20;
        }

        .drawer-scrim.open {
            opacity: 1;
            pointer-events: auto
        }

        .customer-drawer {
            position: absolute;
            top: 48px;
            right: 0;
            bottom: 0;
            width: 332px;
            max-width: 85vw;
            background: linear-gradient(180deg, #fcfdff 0%, #f7f9ff 100%);
            border-left: 1px solid var(--border-color);
            box-shadow: -14px 0 32px rgba(0, 0, 0, .10);
            transform: translateX(100%);
            transition: transform .28s ease;
            z-index: 21;
            display: flex;
            flex-direction: column
        }

        .customer-drawer.open {
            transform: translateX(0)
        }

        .drawer-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            border-bottom: 1px solid var(--border-color);
            background: rgba(255, 255, 255, .9)
        }

        .drawer-title {
            font-weight: 700;
            color: var(--primary-color);
            margin: 0;
            font-size: .92rem
        }

        .drawer-close {
            border: none;
            background: transparent;
            color: var(--secondary-color);
            width: 30px;
            height: 30px;
            border-radius: 50%
        }

        .drawer-close:hover {
            background: #eef1f6;
            color: #222
        }

        .drawer-body {
            padding: 12px 12px 14px;
            overflow: auto
        }

        .profile-card {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            border: 1px solid rgba(94, 106, 156, 0.10);
            border-radius: 14px;
            background: #fff;
            padding: 10px 10px;
            margin-bottom: 10px;
            box-shadow: 0 10px 24px rgba(94, 106, 156, 0.08);
        }

        .profile-avatar {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #e9edf7 0%, #dfe7fb 100%);
            color: #44546b;
            font-weight: 700;
            flex: 0 0 42px;
            font-size: .92rem;
        }

        .profile-copy {
            flex: 1 1 auto;
            min-width: 0;
        }

        .profile-headline {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 8px;
        }

        .profile-name {
            font-weight: 700;
            margin: 0;
            font-size: .98rem;
            line-height: 1.2;
            color: #2f3758;
        }

        .profile-sub {
            margin: 2px 0 0;
            color: var(--secondary-color);
            font-size: .8rem;
            line-height: 1.35
        }

        .profile-tags {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 4px;
        }

        .badge-tag {
            background: #eef2fb;
            color: #4b5876;
            border: 1px solid rgba(94, 106, 156, .10);
            border-radius: 999px;
            padding: 2px 7px;
            font-size: .68rem;
            line-height: 1.25;
        }

        .info-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
            margin-bottom: 10px;
        }

        .info-card {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0;
            padding: 9px 10px;
            border: 1px solid rgba(94, 106, 156, .10);
            border-radius: 12px;
            background: #fff;
        }

        .info-card-wide {
            grid-column: 1 / -1;
        }

        .info-label {
            color: var(--secondary-color);
            font-size: .7rem;
            font-weight: 700;
            letter-spacing: .06em;
            text-transform: uppercase
        }

        .info-value {
            font-weight: 700;
            color: #2f3758;
            font-size: .82rem;
            line-height: 1.35;
            word-break: break-word;
        }

        .timeline {
            border: 1px solid rgba(94, 106, 156, .10);
            border-radius: 14px;
            background: #fff;
            overflow: hidden;
        }

        .timeline h6 {
            padding: 10px 12px;
            border-bottom: 1px solid rgba(94, 106, 156, .10);
            margin: 0;
            color: #44546b;
            font-size: .8rem;
            font-weight: 700;
            background: #f8faff;
        }

        .tl-item {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 9px 12px;
            border-bottom: 1px solid rgba(94, 106, 156, .08)
        }

        .tl-item:last-child {
            border-bottom: none
        }

        .tl-icn {
            width: 22px;
            text-align: center;
            color: var(--primary-color);
            flex: 0 0 22px;
            margin-top: 1px;
        }

        .tl-item > div:last-child {
            min-width: 0;
            flex: 1 1 auto;
        }

        .tl-item > div:last-child > div:first-child {
            font-size: .8rem;
            line-height: 1.35;
            color: #2f3758;
        }

        .tl-meta {
            font-size: .72rem;
            color: var(--secondary-color);
            margin-top: 2px;
        }

        .call-icon.incoming { color: var(--green-status) }
        .call-icon.outgoing { color: var(--primary-color) }
        .call-icon.missed   { color: var(--red-status) }

        mark { background: #ffe9a8; padding: 0 .15em; border-radius: 3px; }

        /* Contact avatar (initials) */
        .contact-avatar {
          width: 36px;
          height: 36px;
          border-radius: 50%;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          font-weight: 700;
          background: #e9edf7;
          color: #445;
          margin-right: 12px;
          flex: 0 0 36px;
        }

        /* Tighten items on small mobile */
        @media (max-width: 480px){
          .login-footer-note {
            font-size: .74rem;
          }

          .item-meta { font-size: 0.8rem; }
        }

        .in-call-actions .btn-call-action[disabled] {
          opacity: .45;
          cursor: not-allowed;
          pointer-events: none;
        }


        /* Use the same color classes the history list uses */
        .tl-icn .call-icon.incoming { color: var(--green-status); }
        .tl-icn .call-icon.outgoing { color: var(--primary-color); }
        .tl-icn .call-icon.missed   { color: var(--red-status); }

        /* You already show it for .contact-item; do the same for .log-item */
      .log-item .call-button {
        background: transparent;
        border: none;
        color: var(--green-status);
        font-size: 1.5rem;
        opacity: 0;
        transform: scale(.8);
        transition: .2s;
      }
      .log-item:hover .call-button {
        opacity: 1;
        transform: scale(1);
      }
      
      .text-primary { color: var(--primary-color) !important; }
