/* ═══════════════════════════════════════════════════════════
   Reaktivierung Softphone — Stylesheet
   3-Column Desktop Layout: WV | Phone | Calllog
   ═══════════════════════════════════════════════════════════ */

/* ─── Theme Variables ───────────────────────────────────── */
.login-ext-link {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1.5rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
}

.login-ext-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

:root {
    --bg-gradient: linear-gradient(135deg, #09090b, #18181b, #09090b);
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.05);
    --text-primary: #f8fafc;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --accent: #e4150c;
    --accent-hover: #be0a0a;
    --shadow: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f8fafc, #f1f5f9, #e2e8f0);
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-input: rgba(0, 0, 0, 0.04);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.15);
    --accent: #e4150c;
    --accent-hover: #be0a0a;
    --shadow: rgba(0, 0, 0, 0.12);
}

/* ─── Reset & Base ───────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ─── LOGIN SCREEN ───────────────────────────────────────── */
#login-screen {
    text-align: center;
    max-width: 600px;
    width: 100%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.02);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#login-screen .app-logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(228, 21, 12, 0.3));
    transition: opacity 0.3s ease;
}

#login-screen .hidden-title {
    display: none;
}

#login-screen .subtitle {
    font-size: 15px;
    opacity: 0.7;
    margin-bottom: 48px;
    letter-spacing: -0.2px;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.agent-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: left;
    color: var(--text-primary);
    font-family: inherit;
    width: 100%;
    font-size: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.agent-btn:hover {
    background: rgba(228, 21, 12, 0.08);
    border-color: rgba(228, 21, 12, 0.3);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.agent-btn .avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 1px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(228, 21, 12, 0.4);
    color: white;
}

.agent-btn .info .name {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.3px;
}

/* ─── PIN Login ──────────────────────────────────────────── */
.pin-login {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pin-login label {
    font-size: 13px;
    opacity: 0.7;
    display: block;
    margin-bottom: 8px;
}

.pin-input-group {
    display: flex;
    gap: 8px;
}

.pin-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    text-align: center;
    letter-spacing: 8px;
    outline: none;
}

.pin-input:focus {
    border-color: #e4150c;
}

.pin-btn {
    padding: 12px 20px;
    background: #e4150c;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.pin-btn:hover {
    background: #5a6fd6;
}

.pin-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   SOFTPHONE — 3-Column Workspace
   ═══════════════════════════════════════════════════════════ */
#softphone {
    display: none;
    width: 100vw;
    height: 100vh;
}

.workspace {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    height: 100vh;
    width: 100%;
    gap: 0;
}

/* ─── Sidebars ───────────────────────────────────────────── */
.sidebar {
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.sidebar-action {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(228, 21, 12, 0.2);
    border: 1px solid rgba(228, 21, 12, 0.3);
    color: #e4150c;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.sidebar-action:hover {
    background: rgba(228, 21, 12, 0.4);
    transform: scale(1.1);
}

/* ─── Phone Center ───────────────────────────────────────── */
.phone-center {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    align-items: center;
    padding: 0;
}

.phone-center>.top-bar,
.phone-center>.phone-header,
.phone-center>.call-timer,
.phone-center>.dial-area,
.phone-center>.pin-change-panel {
    width: 100%;
    max-width: 420px;
}

.phone-header {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    padding: 16px 20px;
    text-align: center;
}

.phone-header .agent-name {
    font-size: 18px;
    font-weight: 700;
}

.phone-header .agent-phone {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    opacity: 0.6;
    margin-top: 4px;
}

/* Status badges */
.phone-header .status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status.online {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status.offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status.calling {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.status.ringing {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    animation: pulse 1.5s infinite;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ─── Dial Area ──────────────────────────────────────────── */
.dial-area {
    background: rgba(255, 255, 255, 0.04);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 20px 20px;
    padding: 16px 20px;
}

.dial-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    text-align: center;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.2s;
}

.dial-input:focus {
    border-color: #e4150c;
}

.dial-input::placeholder {
    opacity: 0.3;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.numpad-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: nowrap;
}

@media (max-width: 768px) {
    .numpad-wrapper {
        gap: 8px;
        flex-wrap: wrap;
    }

    .side-actions {
        flex-direction: row !important;
        width: 100%;
        justify-content: center;
        order: 2;
        /* Put side actions below numpad on mobile */
    }

    .numpad {
        order: 1;
        /* Keep numpad on top */
    }
}

.side-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    align-items: center;
}

.side-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: #a0aec0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.side-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.side-btn.active {
    background: rgba(228, 21, 12, 0.2);
    border-color: #e4150c;
    color: #e4150c;
}

.side-btn .icon {
    font-size: 20px;
}

.side-btn .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex: 2;
    max-width: 240px;
}

.num-btn {
    padding: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.num-btn:hover {
    background: rgba(228, 21, 12, 0.2);
}

.num-btn:active {
    transform: scale(0.95);
}

.num-btn .sub {
    display: block;
    font-size: 8px;
    font-weight: 400;
    opacity: 0.4;
    letter-spacing: 2px;
}

/* ─── Call Buttons ───────────────────────────────────────── */
.side-btn.primary-call {
    background: #22c55e;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.side-btn.primary-call:hover {
    background: #16a34a;
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.6);
}

.side-btn.danger-hangup {
    background: #ef4444;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.side-btn.danger-hangup:hover {
    background: #dc2626;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.6);
}

.side-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Call timer */
.call-timer {
    display: none;
    text-align: center;
    padding: 8px;
    font-size: 26px;
    font-weight: 300;
    font-family: 'Courier New', monospace;
    color: #22c55e;
    letter-spacing: 2px;
}

/* ─── Wiedervorlage ──────────────────────────────────────── */
.wv-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.wv-list::-webkit-scrollbar {
    width: 3px;
}

.wv-list::-webkit-scrollbar-thumb {
    background: rgba(228, 21, 12, 0.2);
    border-radius: 2px;
}

.wv-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.wv-item:hover {
    filter: brightness(1.2);
    transform: translateX(2px);
}

.wv-item .wv-time {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 11px;
}

.wv-item .wv-number {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
}

.wv-item .wv-note {
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.wv-item .wv-delete {
    position: absolute;
    top: 6px;
    right: 8px;
    opacity: 0;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.15s;
}

.wv-item {
    position: relative;
}

.wv-item:hover .wv-delete {
    opacity: 0.6;
}

.wv-item .wv-delete:hover {
    opacity: 1;
}

/* Wiedervorlage status colors */
.wv-item.wv-green {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.wv-item.wv-yellow {
    background: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.3);
    color: #fde047;
    animation: wv-pulse 2s infinite;
}

.wv-item.wv-red {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

@keyframes wv-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Wiedervorlage form */
.wv-form {
    display: none;
    margin: 8px 12px;
    padding: 12px;
    background: rgba(228, 21, 12, 0.1);
    border: 1px solid rgba(228, 21, 12, 0.25);
    border-radius: 10px;
    flex-shrink: 0;
}

.wv-form h4 {
    font-size: 13px;
    color: #e4150c;
    margin-bottom: 10px;
}

.wv-form input,
.wv-form select {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.wv-form input:focus {
    border-color: #e4150c;
}

.wv-form .wv-row {
    display: flex;
    gap: 8px;
}

.wv-form .wv-row input {
    flex: 1;
}

.wv-form .wv-save-btn {
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    background: #e4150c;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.wv-form .wv-save-btn:hover {
    background: #5a6fd6;
}

.wv-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.wv-save-primary {
    flex: 2;
}

.wv-save-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

/* ─── Call Log (Right Sidebar) ───────────────────────────── */
.call-log-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.call-log-container::-webkit-scrollbar {
    width: 3px;
}

.call-log-container::-webkit-scrollbar-thumb {
    background: rgba(228, 21, 12, 0.2);
    border-radius: 2px;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 6px;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.05);
}

.log-entry .dir {
    flex-shrink: 0;
}

.log-entry .number {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-entry .time {
    opacity: 0.4;
    font-size: 10px;
    white-space: nowrap;
}

/* ─── Transfer Panel ─────────────────────────────────────── */
.transfer-panel {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
}

.transfer-panel h4 {
    font-size: 13px;
    margin-bottom: 8px;
    color: #3b82f6;
}

.transfer-agent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.transfer-agent-btn {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e2e8f0;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    transition: all 0.15s;
}

.transfer-agent-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

/* ─── PIN Change Panel ───────────────────────────────────── */
.pin-change-panel {
    display: none;
    margin-top: 12px;
    padding: 14px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 10px;
    max-width: 420px;
    width: 100%;
}

.pin-change-panel h4 {
    font-size: 13px;
    margin-bottom: 10px;
    color: #eab308;
}

.pin-change-panel input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    text-align: center;
    letter-spacing: 6px;
    outline: none;
}

.pin-change-panel input:focus {
    border-color: #eab308;
}

.pin-change-panel .pin-save-btn {
    width: 100%;
    padding: 10px;
    background: #eab308;
    border: none;
    border-radius: 8px;
    color: #1a1a2e;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.pin-change-panel .pin-save-btn:hover {
    background: #ca8a04;
}

.pin-change-msg {
    font-size: 12px;
    margin-top: 6px;
    text-align: center;
}

/* ─── Top bar buttons ────────────────────────────────────── */
.top-bar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 12px;
    width: 100%;
    max-width: 420px;
}

.top-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #e2e8f0;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    transition: all 0.15s;
}

.top-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.top-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* ─── Incoming Call Overlay ──────────────────────────────── */
#incoming-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.incoming-card {
    background: linear-gradient(135deg, #1a1a2e, #302b63);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.incoming-card .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.incoming-card h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.incoming-card .caller {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #e4150c;
}

.incoming-card .actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    justify-content: center;
}

.incoming-card .actions button {
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.incoming-card .accept {
    background: #22c55e;
    color: white;
}

.incoming-card .reject {
    background: #ef4444;
    color: white;
}

/* ─── Utility ────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

.wv-add-hint {
    opacity: 0.5;
    font-size: 10px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.section-title.clickable {
    cursor: pointer;
}

.section-title.clickable:hover {
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (stacked layout)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    body {
        overflow: auto;
        align-items: flex-start;
    }

    .workspace {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .sidebar-right {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .sidebar-left {
        order: 2;
    }

    .phone-center {
        order: 1;
        height: auto;
        overflow: visible;
    }

    .sidebar-right {
        order: 3;
    }

    .wv-list {
        max-height: 200px;
    }

    .call-log-container {
        max-height: 200px;
    }

    .phone-center>.top-bar,
    .phone-center>.phone-header,
    .phone-center>.call-timer,
    .phone-center>.dial-area,
    .phone-center>.pin-change-panel {
        max-width: 100%;
    }

    .phone-header {
        border-radius: 0;
    }

    .dial-area {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

@media (max-width: 480px) {
    .num-btn {
        padding: 14px;
        font-size: 20px;
    }

    .top-bar {
        padding: 8px 16px;
    }
}

/* ═══════════════════════════════════════════════════════════
   TEAM CHAT — WhatsApp-Style Panel
   ═══════════════════════════════════════════════════════════ */

/* Chat toggle button */
.chat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e4150c, #be0a0a);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(228, 21, 12, 0.4);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
    display: none;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(228, 21, 12, 0.6);
}

.chat-toggle-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Chat panel */
.chat-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 380px;
    max-height: 520px;
    background: rgba(10, 10, 12, 0.97);
    border: 1px solid rgba(228, 21, 12, 0.3);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    z-index: 999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.chat-panel.open {
    display: flex;
    animation: chatSlideUp 0.25s ease-out;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat header */
.chat-header {
    padding: 14px 18px;
    background: rgba(15, 15, 20, 0.8);
    border-bottom: 1px solid rgba(228, 21, 12, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #e2e8f0;
}

.chat-header-online {
    font-size: 12px;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-header-online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.chat-close-btn:hover {
    color: #e2e8f0;
}

/* Messages container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 300px;
    max-height: 360px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(228, 21, 12, 0.3);
    border-radius: 2px;
}

/* Message bubbles */
.chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.own {
    align-self: flex-end;
    background: linear-gradient(135deg, #e4150c, #be0a0a);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg.other {
    align-self: flex-start;
    background: rgba(15, 15, 20, 0.8);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chat-msg-name {
    font-size: 11px;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 2px;
}

.chat-msg.own .chat-msg-name {
    color: rgba(255, 255, 255, 0.7);
}

.chat-msg-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-align: right;
    margin-top: 4px;
}

.chat-msg.other .chat-msg-time {
    color: rgba(148, 163, 184, 0.6);
}

/* System messages */
.chat-msg.system {
    align-self: center;
    max-width: 90%;
    background: rgba(228, 21, 12, 0.15);
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Input area */
.chat-input-area {
    padding: 12px;
    border-top: 1px solid rgba(228, 21, 12, 0.2);
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(15, 15, 20, 0.6);
    border: 1px solid rgba(228, 21, 12, 0.2);
    border-radius: 20px;
    color: #e2e8f0;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
}

.chat-input::placeholder {
    color: #64748b;
}

.chat-input:focus {
    border-color: #e4150c;
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e4150c, #be0a0a);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.1);
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Empty state */
.chat-empty {
    text-align: center;
    color: #64748b;
    padding: 40px 20px;
    font-size: 13px;
}

.chat-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

/* Chat Mobile responsive */
@media (max-width: 480px) {
    .chat-panel {
        right: 8px;
        left: 8px;
        bottom: 80px;
        width: auto;
        max-height: 60vh;
    }

    .chat-toggle-btn {
        bottom: 16px;
        right: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════
   MINI-MODE — Floating bar when minimized
   ═══════════════════════════════════════════════════════════ */
.mini-bar {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 12, 0.95);
    border: 1px solid rgba(228, 21, 12, 0.4);
    border-radius: 40px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 2000;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    animation: miniSlideDown 0.3s ease-out;
    cursor: default;
    min-width: 280px;
}

@keyframes miniSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.mini-bar.hidden {
    display: none !important;
}

.mini-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.mini-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.mini-dot.calling {
    background: #eab308;
    animation: pulse 1.5s infinite;
}

.mini-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.mini-timer {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    color: #22c55e;
    letter-spacing: 1px;
}

.mini-actions {
    display: flex;
    gap: 6px;
}

.mini-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.mini-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.mini-hangup {
    background: rgba(239, 68, 68, 0.3) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.mini-hangup:hover {
    background: #ef4444 !important;
}

.mini-expand {
    background: rgba(228, 21, 12, 0.3) !important;
    border-color: rgba(228, 21, 12, 0.5) !important;
}

.mini-expand:hover {
    background: #e4150c !important;
}

/* ═══════════════════════════════════════════════════════════
   AUDIO SETTINGS PANEL
   ═══════════════════════════════════════════════════════════ */
.audio-panel {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 20px;
    background: rgba(228, 21, 12, 0.08);
    border: 1px solid rgba(228, 21, 12, 0.2);
    border-radius: 14px;
    animation: fadeIn 0.2s ease-out;
}

.audio-panel h4 {
    font-size: 14px;
    color: #e4150c;
    margin-bottom: 14px;
    font-weight: 600;
}

.audio-control {
    margin-bottom: 12px;
}

.audio-control:last-child {
    margin-bottom: 0;
}

.audio-control label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.audio-control select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.audio-control select:focus {
    border-color: #e4150c;
}

.audio-control select option {
    background: #1a1a2e;
    color: #e2e8f0;
}

.audio-control input[type="range"] {
    width: calc(100% - 46px);
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
    vertical-align: middle;
}

.audio-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e4150c;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(228, 21, 12, 0.5);
}

.volume-label {
    display: inline-block;
    width: 40px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #e4150c;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════
   KEYBOARD SHORTCUTS HINT
   ═══════════════════════════════════════════════════════════ */
.shortcuts-hint {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 10px;
    font-size: 11px;
    opacity: 0.35;
    flex-wrap: wrap;
    max-width: 420px;
    width: 100%;
    transition: opacity 0.2s;
}

.shortcuts-hint:hover {
    opacity: 0.65;
}

.shortcuts-hint b {
    background: rgba(255, 255, 255, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════
   PWA INSTALL PROMPT
   ═══════════════════════════════════════════════════════════ */
.pwa-install {
    position: fixed;
    bottom: 90px;
    left: 24px;
    background: rgba(10, 10, 12, 0.95);
    border: 1px solid rgba(228, 21, 12, 0.4);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease-out;
    font-size: 13px;
    font-weight: 500;
}

.pwa-install.hidden {
    display: none !important;
}

.pwa-install-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #e4150c, #be0a0a);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s;
}

.pwa-install-btn:hover {
    transform: scale(1.05);
}

.pwa-dismiss-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}

.pwa-dismiss-btn:hover {
    color: #e2e8f0;
}

/* ═══════════════════════════════════════════════════════════
   CLICK-TO-DIAL — linked phone numbers
   ═══════════════════════════════════════════════════════════ */
.clickable-number {
    color: #e4150c;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: color 0.15s;
    font-family: 'Courier New', monospace;
}

.clickable-number:hover {
    color: #a78bfa;
    text-decoration-style: solid;
}

/* ═══════════════════════════════════════════════════════════
   MINI-MODE RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .mini-bar {
        left: 8px;
        right: 8px;
        transform: none;
        border-radius: 16px;
        min-width: auto;
    }

    .pwa-install {
        left: 8px;
        right: 8px;
        bottom: 80px;
    }

    .shortcuts-hint {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2: CALL RESULT TAGS — Post-call popup
   ═══════════════════════════════════════════════════════════ */
.call-result-modal {
    max-width: 420px;
    width: 100%;
    margin: 12px auto 0;
    padding: 18px 20px;
    background: rgba(10, 10, 12, 0.95);
    border: 1px solid rgba(228, 21, 12, 0.3);
    border-radius: 16px;
    animation: fadeIn 0.3s ease-out;
    text-align: center;
}

.call-result-modal.hidden {
    display: none !important;
}

.call-result-modal h4 {
    font-size: 15px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 14px;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.result-tag {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.result-tag:hover {
    background: rgba(228, 21, 12, 0.2);
    border-color: rgba(228, 21, 12, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(228, 21, 12, 0.2);
}

.result-tag:active {
    transform: scale(0.95);
}

.result-tag[data-tag="reached"] {
    border-color: rgba(34, 197, 94, 0.4);
}

.result-tag[data-tag="reached"]:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.result-tag[data-tag="appointment"] {
    border-color: rgba(34, 197, 94, 0.4);
}

.result-tag[data-tag="appointment"]:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.result-tag[data-tag="mailbox"] {
    border-color: rgba(251, 191, 36, 0.4);
}

.result-tag[data-tag="mailbox"]:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
}

.result-tag[data-tag="not-reachable"] {
    border-color: rgba(239, 68, 68, 0.4);
}

.result-tag[data-tag="not-reachable"]:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.result-tag[data-tag="no-interest"] {
    border-color: rgba(239, 68, 68, 0.4);
}

.result-tag[data-tag="no-interest"]:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.result-tag[data-tag="callback"] {
    border-color: rgba(59, 130, 246, 0.4);
}

.result-tag[data-tag="callback"]:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.result-tag[data-tag="wrong-number"] {
    border-color: rgba(107, 114, 128, 0.4);
}

.result-tag[data-tag="wrong-number"]:hover {
    background: rgba(107, 114, 128, 0.15);
    border-color: #6b7280;
}

.result-skip {
    background: none;
    border: none;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 12px;
    transition: color 0.15s;
}

.result-skip:hover {
    color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2: CALL NOTES — Textarea during call
   ═══════════════════════════════════════════════════════════ */
.call-notes {
    max-width: 420px;
    width: 100%;
    margin: 8px auto 0;
}

.call-notes.hidden {
    display: none !important;
}

.call-notes textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(228, 21, 12, 0.2);
    border-radius: 10px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 13px;
    padding: 10px 14px;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.call-notes textarea::placeholder {
    color: #64748b;
}

.call-notes textarea:focus {
    outline: none;
    border-color: rgba(228, 21, 12, 0.5);
    box-shadow: 0 0 0 3px rgba(228, 21, 12, 0.1);
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2: STATUS MENU — Presence dropdown
   ═══════════════════════════════════════════════════════════ */
.status-menu {
    max-width: 220px;
    margin: 0 auto 8px;
    background: rgba(10, 10, 12, 0.95);
    border: 1px solid rgba(228, 21, 12, 0.25);
    border-radius: 12px;
    padding: 6px;
    animation: fadeIn 0.2s ease-out;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.status-menu.hidden {
    display: none !important;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    text-align: left;
}

.status-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.status-icon {
    font-size: 10px;
    width: 14px;
    text-align: center;
}

.status-icon.available {
    color: #22c55e;
}

.status-icon.busy {
    color: #eab308;
}

.status-icon.break {
    color: #f97316;
}

.status-icon.external {
    color: #3b82f6;
}

.status-icon.dnd {
    color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2: PINNED MESSAGES — Fixed bar in chat
   ═══════════════════════════════════════════════════════════ */
.pinned-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(251, 191, 36, 0.08);
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
    font-size: 12px;
    color: #fbbf24;
    animation: fadeIn 0.2s;
}

.pinned-bar.hidden {
    display: none !important;
}

.pinned-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.pinned-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e2e8f0;
    font-weight: 500;
}

.pinned-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

.pinned-close:hover {
    color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2: TEAM PRESENCE — Agent status in chat
   ═══════════════════════════════════════════════════════════ */
.team-presence {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: none;
}

.team-presence::-webkit-scrollbar {
    display: none;
}

.presence-list {
    display: flex;
    gap: 6px;
    min-width: max-content;
}

.presence-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
}

.presence-chip:hover {
    background: rgba(228, 21, 12, 0.12);
    border-color: rgba(228, 21, 12, 0.3);
    color: #e2e8f0;
}

.presence-chip.self {
    border-color: rgba(228, 21, 12, 0.3);
    color: #e2e8f0;
}

.presence-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.presence-dot.available {
    background: #22c55e;
}

.presence-dot.busy {
    background: #eab308;
}

.presence-dot.break {
    background: #f97316;
}

.presence-dot.external {
    background: #3b82f6;
}

.presence-dot.dnd {
    background: #ef4444;
}

.presence-dot.offline {
    background: #4b5563;
}

.presence-name {
    cursor: pointer;
    flex: 1;
}

.presence-name:hover {
    color: #fff;
    text-decoration: underline;
}

.presence-chip.self .presence-name {
    cursor: default;
}

.presence-chip.self .presence-name:hover {
    text-decoration: none;
}

.presence-action {
    cursor: pointer;
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.15s;
    padding: 1px 2px;
    border-radius: 3px;
}

.presence-action:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.presence-chip.offline .presence-name {
    opacity: 0.5;
    cursor: default;
}

.presence-chip.offline .presence-name:hover {
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2: CALL LOG TAGS — Tag badges in call log entries
   ═══════════════════════════════════════════════════════════ */
.log-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
    vertical-align: middle;
}

.log-tag.reached {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.log-tag.mailbox {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.log-tag.not-reachable {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.log-tag.appointment {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.log-tag.no-interest {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.log-tag.callback {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.log-tag.wrong-number {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.log-note {
    font-size: 10px;
    color: #64748b;
    font-style: italic;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2: CONTEXT MENU — for pinning messages
   ═══════════════════════════════════════════════════════════ */
.msg-context-menu {
    position: fixed;
    background: rgba(10, 10, 12, 0.98);
    border: 1px solid rgba(228, 21, 12, 0.3);
    border-radius: 10px;
    padding: 4px;
    z-index: 3000;
    min-width: 160px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.15s ease-out;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.ctx-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.12s;
}

.ctx-option:hover {
    background: rgba(228, 21, 12, 0.15);
}

/* ═══════════════════════════════════════════════════════════
   PHASE 3: EXTRA CALL CONTROLS
   ═══════════════════════════════════════════════════════════ */

.call-extra-controls {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 8px 0;
}

.extra-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.extra-btn:hover {
    background: rgba(228, 21, 12, 0.15);
    border-color: rgba(228, 21, 12, 0.3);
    color: #e2e8f0;
}

.extra-btn.active {
    background: rgba(228, 21, 12, 0.2);
    border-color: #e4150c;
    color: #e4150c;
}


/* ═══════════════════════════════════════════════════════════
   PHASE 3: VOLUME CONTROLS
   ═══════════════════════════════════════════════════════════ */

.volume-controls {
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 10px;
    margin: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.vol-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.vol-slider {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e4150c;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 6px rgba(228, 21, 12, 0.4);
    transition: box-shadow 0.2s;
}

.vol-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 12px rgba(228, 21, 12, 0.6);
}

.vol-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e4150c;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.vol-value {
    font-size: 10px;
    color: #64748b;
    width: 30px;
    text-align: right;
    font-family: 'Inter', monospace;
}


/* ═══════════════════════════════════════════════════════════
   PHASE 3: TRANSFER TYPE BUTTONS
   ═══════════════════════════════════════════════════════════ */

.transfer-type-btns {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.transfer-type-btn {
    flex: 1;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.transfer-type-btn.active {
    background: rgba(228, 21, 12, 0.15);
    border-color: #e4150c;
    color: #e4150c;
}

.transfer-type-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06);
}


/* ═══════════════════════════════════════════════════════════
   PHASE 3: CONFERENCE PANEL
   ═══════════════════════════════════════════════════════════ */

.conference-panel {
    margin-top: 10px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.conference-panel h4 {
    color: #34d399;
    font-size: 12px;
    margin: 0 0 8px 0;
}

.conference-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.conference-input:focus {
    outline: none;
    border-color: #34d399;
}

.conference-agent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.conference-agent-list .transfer-agent-btn {
    font-size: 11px;
    padding: 4px 10px;
    border-color: rgba(52, 211, 153, 0.2);
}

.conference-agent-list .transfer-agent-btn:hover {
    border-color: #34d399;
    color: #34d399;
}

.conference-actions {
    display: flex;
    gap: 6px;
}

.conference-actions .call-btn {
    flex: 1;
    font-size: 12px;
    padding: 6px 10px;
}


/* ═══════════════════════════════════════════════════════════
   PHASE 3: TASK SYSTEM
   ═══════════════════════════════════════════════════════════ */

.task-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    margin: 12px 0;
}

.task-list {
    padding: 0 8px;
    max-height: 200px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.15s;
    cursor: pointer;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.task-item.done {
    opacity: 0.5;
    text-decoration: line-through;
}

.task-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.task-checkbox:hover {
    border-color: #34d399;
}

.task-item.done .task-checkbox {
    background: #34d399;
    border-color: #34d399;
}

.task-text {
    flex: 1;
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.3;
}

.task-meta {
    font-size: 9px;
    color: #475569;
    white-space: nowrap;
}

.task-delete {
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.task-item:hover .task-delete {
    opacity: 1;
}

.task-delete:hover {
    color: #ef4444;
}

.task-form {
    padding: 8px;
}

.task-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 8px;
}

.task-quick-btn {
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 10px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.task-quick-btn:hover {
    background: rgba(228, 21, 12, 0.1);
    border-color: rgba(228, 21, 12, 0.2);
    color: #e2e8f0;
}

.task-form input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    margin-bottom: 6px;
    box-sizing: border-box;
}

.task-form input[type="text"]:focus {
    outline: none;
    border-color: #e4150c;
}

.task-empty {
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: #475569;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 4: Daily Dashboard Stats
   ═══════════════════════════════════════════════════════════ */
.daily-dashboard {
    display: flex;
    justify-content: space-around;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(228, 21, 12, 0.15), rgba(118, 75, 162, 0.15));
    border-radius: 10px;
    margin: 0 16px 8px;
    border: 1px solid rgba(228, 21, 12, 0.2);
}

.dash-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.dash-num {
    font-size: 18px;
    font-weight: 700;
    color: #e4150c;
    line-height: 1;
}

.dash-label {
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 4: Chat Search
   ═══════════════════════════════════════════════════════════ */
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-header-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
}

.chat-header-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.chat-search {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    outline: none;
}

.chat-search-input:focus {
    border-color: #e4150c;
}

.chat-search-count {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

.chat-msg.search-highlight {
    background: rgba(228, 21, 12, 0.2) !important;
    border-left: 2px solid #e4150c;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 4: Emoji Picker
   ═══════════════════════════════════════════════════════════ */
.chat-emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.chat-emoji-btn:hover {
    transform: scale(1.2);
}

.emoji-picker {
    position: absolute;
    bottom: 52px;
    left: 8px;
    right: 8px;
    background: rgba(30, 30, 50, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 30;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}

.emoji-grid button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s, transform 0.15s;
}

.emoji-grid button:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.15);
}

/* ═══════════════════════════════════════════════════════════
   PHASE 4: Message Reactions
   ═══════════════════════════════════════════════════════════ */
.msg-reactions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.msg-reaction {
    background: rgba(228, 21, 12, 0.15);
    border: 1px solid rgba(228, 21, 12, 0.3);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 3px;
}

.msg-reaction:hover {
    background: rgba(228, 21, 12, 0.3);
}

.msg-reaction .reaction-count {
    font-size: 10px;
    color: #94a3b8;
}

.msg-react-btn {
    background: none;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.msg-react-btn:hover {
    border-color: #e4150c;
    color: #e4150c;
    background: rgba(228, 21, 12, 0.1);
}

/* Quick react popup on message hover */
.msg-quick-react {
    display: none;
    position: absolute;
    top: -32px;
    right: 8px;
    background: rgba(30, 30, 50, 0.95);
    border-radius: 20px;
    padding: 3px 6px;
    gap: 2px;
    z-index: 20;
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.chat-msg:hover .msg-quick-react {
    display: flex;
}

.msg-quick-react button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 3px;
    border-radius: 4px;
    transition: transform 0.15s;
}

.msg-quick-react button:hover {
    transform: scale(1.3);
}

/* ═══════════════════════════════════════════════════════════
   PHASE 4: Light Theme Overrides
   ═══════════════════════════════════════════════════════════ */
[data-theme="light"] body {
    background: var(--bg-gradient);
    color: var(--text-primary);
}

[data-theme="light"] .workspace {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .phone-center {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .top-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .top-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dial-input {
    background: rgba(0, 0, 0, 0.04);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .num-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .num-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .daily-dashboard {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(118, 75, 162, 0.08));
    border-color: rgba(79, 70, 229, 0.15);
}

[data-theme="light"] .chat-panel {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .chat-header {
    background: rgba(79, 70, 229, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .chat-msg {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .chat-msg-text {
    color: #1e293b;
}

[data-theme="light"] .chat-input {
    background: rgba(0, 0, 0, 0.04);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .call-log-entry {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .agent-name {
    color: #1e293b;
}

[data-theme="light"] .agent-phone {
    color: #475569;
}

[data-theme="light"] .emoji-picker {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .emoji-grid button:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .shortcuts-hint {
    color: #64748b;
}

[data-theme="light"] .wv-entry {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .sidebar-title {
    color: #1e293b;
}

/* Theme transition for smooth switching */
body,
.workspace,
.sidebar,
.phone-center,
.chat-panel,
.chat-header,
.chat-msg,
.chat-input,
.dial-input,
.num-btn,
.top-btn,
.daily-dashboard {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


/* ═══════════════════════════════════════════════════════════
   PHASE 5: Favorites / Speed Dial
   ═══════════════════════════════════════════════════════════ */
.favorites-list {
    padding: 4px 8px;
    max-height: 160px;
    overflow-y: auto;
}

.fav-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.fav-entry:hover {
    background: rgba(228, 21, 12, 0.12);
    border-color: rgba(228, 21, 12, 0.25);
}

.fav-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.fav-name {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
}

.fav-number {
    font-size: 10px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
}

.fav-actions {
    display: flex;
    gap: 4px;
}

.fav-action-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}

.fav-action-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.fav-input {
    width: 100%;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    margin-bottom: 6px;
    box-sizing: border-box;
}

.fav-input:focus {
    outline: none;
    border-color: #e4150c;
}

.fav-empty {
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: #475569;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 5: Typing Indicator
   ═══════════════════════════════════════════════════════════ */
.typing-indicator {
    padding: 4px 16px;
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dots span {
    animation: typingBounce 1.4s infinite;
    font-size: 18px;
    line-height: 1;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.typing-name {
    font-weight: 600;
    color: #e4150c;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 5: Quick Replies
   ═══════════════════════════════════════════════════════════ */
.quick-replies {
    position: absolute;
    bottom: 52px;
    left: 8px;
    right: 8px;
    background: rgba(30, 30, 50, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 30;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.quick-reply-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-reply-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #e2e8f0;
    transition: all 0.2s;
    text-align: left;
}

.quick-reply-item:hover {
    background: rgba(228, 21, 12, 0.12);
    border-color: rgba(228, 21, 12, 0.25);
}

.quick-reply-icon {
    margin-right: 6px;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 5: Termin Card in Chat
   ═══════════════════════════════════════════════════════════ */
.termin-card {
    background: linear-gradient(135deg, rgba(228, 21, 12, 0.15), rgba(118, 75, 162, 0.15));
    border: 1px solid rgba(228, 21, 12, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 6px;
}

.termin-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #e4150c;
    margin-bottom: 6px;
}

.termin-card-detail {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 2px;
}

.termin-card-detail strong {
    color: #e2e8f0;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 5: Light Theme additions
   ═══════════════════════════════════════════════════════════ */
[data-theme="light"] .fav-entry {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .fav-name {
    color: #1e293b;
}

[data-theme="light"] .fav-number {
    color: #475569;
}

[data-theme="light"] .fav-input {
    background: rgba(0, 0, 0, 0.04);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .quick-replies {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .quick-reply-item {
    background: rgba(0, 0, 0, 0.03);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .termin-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(118, 75, 162, 0.08));
    border-color: rgba(79, 70, 229, 0.2);
}

[data-theme="light"] .termin-card-detail strong {
    color: #1e293b;
}


/* ═══════════════════════════════════════════════════════════
   PHASE 6: RESPONSIVE DESIGN SYSTEM
   Mobile (<768px) · Tablet (768-1024px) · Desktop (>1024px)
   ═══════════════════════════════════════════════════════════ */

/* ─── Mobile Bottom Navigation ────────────────────────────── */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: rgba(10, 10, 12, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    font-family: inherit;
    transition: color 0.2s;
}

.mobile-nav-btn.active {
    color: var(--accent);
}

.mobile-nav-icon {
    font-size: 22px;
    line-height: 1;
}

.mobile-nav-label {
    font-size: 10px;
    font-weight: 500;
}

.mobile-nav-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(14px);
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

[data-theme="light"] .mobile-nav {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(0, 0, 0, 0.1);
}


/* ═══ MOBILE: < 768px ═══════════════════════════════════════ */
@media (max-width: 767px) {

    body {
        overflow: auto;
        align-items: flex-start;
    }

    /* Show mobile nav */
    .mobile-nav {
        display: flex;
    }

    /* Switch to stacked layout */
    .workspace {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        height: auto;
        min-height: 100vh;
        padding-bottom: 72px;
        /* space for mobile nav */
    }

    /* Sidebars become hidden panels */
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 72px;
        width: 100%;
        height: auto;
        border-right: none;
        border-left: none;
        overflow-y: auto;
        z-index: 9000;
        background: var(--bg-sidebar, rgba(10, 10, 12, 0.98));
    }

    .sidebar-right {
        border-left: none;
    }

    .sidebar.mobile-active {
        display: flex;
    }

    /* Phone center fills screen */
    .phone-center {
        height: auto;
        min-height: calc(100vh - 72px);
        padding-bottom: 20px;
    }

    .phone-center.mobile-hidden {
        display: none;
    }

    /* phone-center children: full width on mobile */
    .phone-center>.top-bar,
    .phone-center>.phone-header,
    .phone-center>.call-timer,
    .phone-center>.dial-area,
    .phone-center>.pin-change-panel {
        max-width: 100%;
    }

    /* ─── Top Bar Responsive ─── */
    .top-bar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
        justify-content: center;
    }

    .top-btn {
        font-size: 11px;
        padding: 6px 10px;
        min-height: 36px;
    }

    /* ─── Dashboard Responsive ─── */
    .daily-dashboard {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .dash-stat {
        min-width: 0;
        flex: 1 0 60px;
    }

    .dash-num {
        font-size: 18px;
    }

    .dash-label {
        font-size: 8px;
    }

    /* ─── Phone Header Responsive ─── */
    .phone-header {
        border-radius: 0;
        padding: 12px 16px;
    }

    .phone-header .agent-name {
        font-size: 16px;
    }

    /* ─── Dial Pad Responsive ─── */
    .dial-area {
        border-radius: 0;
        padding: 12px 16px;
        border-left: none;
        border-right: none;
    }

    .dial-grid {
        gap: 8px;
    }

    .dial-btn {
        padding: 14px 8px;
        font-size: 22px;
    }

    .dial-btn sub {
        font-size: 8px;
    }

    .call-btn {
        padding: 14px;
        font-size: 16px;
    }

    /* ─── Chat Panel Responsive ─── */
    .chat-panel {
        width: 100%;
        height: calc(100vh - 72px);
        right: 0;
        bottom: 72px;
        border-radius: 0;
        max-height: none;
    }

    /* ─── Modals: full-width on mobile ─── */
    .call-result-modal {
        width: 95%;
        max-width: 400px;
    }

    /* ─── Wiedervorlage items ─── */
    .wv-item {
        padding: 10px 14px;
    }

    /* ─── Audio Settings ─── */
    .audio-panel {
        width: 95%;
        max-width: 340px;
    }

    /* ─── Mini Bar ─── */
    .mini-bar {
        bottom: 72px;
    }

    /* ─── Chat Bubble / Float Button ─── */
    .chat-toggle-btn {
        bottom: 82px;
        right: 16px;
    }

    /* ─── Conference Panel ─── */
    .conference-panel {
        width: 95%;
        max-width: 340px;
    }

    /* ─── Sidebar content: full-width overrides ─── */
    .sidebar-header {
        padding: 14px 16px;
    }

    /* ─── Right sidebar sections ─── */
    .call-log-list {
        max-height: none;
        overflow-y: auto;
    }

    /* ─── Favorites section ─── */
    .favorites-section .sidebar-header {
        padding: 12px 16px;
    }

    /* ─── Task items ─── */
    .task-item {
        padding: 10px 14px;
    }
}


/* ═══ TABLET: 768px – 1024px ════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {

    /* 2-column layout: left + center */
    .workspace {
        grid-template-columns: 220px 1fr;
    }

    .sidebar-right {
        display: none;
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1100;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar-right.mobile-active {
        display: flex;
    }

    /* Top bar wrap */
    .top-bar {
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px 12px;
    }

    .top-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* Dashboard fits on one row */
    .daily-dashboard {
        padding: 8px 12px;
        gap: 8px;
    }

    .dash-num {
        font-size: 20px;
    }

    /* Phone center children */
    .phone-center>.top-bar,
    .phone-center>.phone-header,
    .phone-center>.call-timer,
    .phone-center>.dial-area,
    .phone-center>.pin-change-panel {
        max-width: 380px;
    }

    /* Sidebar left tighter */
    .sidebar {
        width: 100%;
    }

    .sidebar-header {
        padding: 12px 14px;
    }

    .sidebar-title {
        font-size: 11px;
    }

    /* Chat panel */
    .chat-panel {
        width: 360px;
    }
}


/* ═══ LARGE DESKTOP: > 1400px ═══════════════════════════════ */
@media (min-width: 1400px) {
    .workspace {
        grid-template-columns: 320px 1fr 320px;
    }

    .phone-center>.top-bar,
    .phone-center>.phone-header,
    .phone-center>.call-timer,
    .phone-center>.dial-area,
    .phone-center>.pin-change-panel {
        max-width: 500px;
    }

    .dial-btn {
        font-size: 28px;
        padding: 18px 14px;
    }
}


/* ═══ DESKTOP: Hide mobile nav ══════════════════════════════ */
@media (min-width: 768px) {
    .mobile-nav {
        display: none !important;
    }
}


/* ═══ PHASE 6: DESKTOP NOTIFICATIONS BUTTON ═════════════════ */
.notif-granted {
    color: #22c55e !important;
}


/* ═══ PHASE 6: CALL NOTES INLINE ════════════════════════════ */
.call-note-inline {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.call-note-inline input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.call-note-inline input::placeholder {
    color: var(--text-muted);
}

.call-note-inline button {
    background: var(--accent);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}


/* ═══ PHASE 6: SHORTCUTS OVERLAY ════════════════════════════ */
.shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.shortcuts-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--text-primary);
}

.shortcuts-panel h3 {
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shortcut-key kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

.shortcut-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

[data-theme="light"] .shortcut-key kbd {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
}


/* ═══ Smooth transitions for mobile panels ══════════════════ */
.sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

@media (max-width: 767px) {
    .sidebar.mobile-active {
        animation: slideUp 0.3s ease forwards;
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Chat panel full-screen on mobile */
    .chat-panel.mobile-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 72px;
        width: 100%;
        height: auto;
        border-radius: 0;
        z-index: 9900;
    }
}


/* ═══ Touch-friendly sizing adjustments ═════════════════════ */
@media (pointer: coarse) {
    .sidebar-action {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .wv-item,
    .task-item {
        min-height: 48px;
    }

    .call-log-entry {
        min-height: 44px;
    }

    .fav-entry {
        min-height: 44px;
    }

    .top-btn {
        min-height: 40px;
        min-width: 44px;
    }

    .dial-btn {
        min-height: 52px;
    }
}


/* ═══ Safe area for notched phones ══════════════════════════ */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-nav {
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    @media (max-width: 767px) {
        .workspace {
            padding-bottom: calc(72px + env(safe-area-inset-bottom));
        }
    }
}


/* ═══ Print stylesheet ══════════════════════════════════════ */
@media print {

    .mobile-nav,
    .top-bar,
    .chat-panel,
    .chat-toggle-btn,
    .mini-bar {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .workspace {
        display: block;
    }
}

/* ═══════════════════════════════════════════════════════════
   APPLE FUTURISTIC REDESIGN (Responsive + Side Buttons)
   ═══════════════════════════════════════════════════════════ */

body,
button,
input {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#softphone-layout {
    display: flex;
    justify-content: center;
    background: var(--bg-primary);
    /* Use theme bg rather than pure black */
}

.phone-center {
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 600px !important;
    margin: 20px auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .phone-center {
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.dial-input {
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-size: 36px !important;
    text-align: center;
    font-weight: 200;
    margin-bottom: 20px;
}

.dial-input::placeholder {
    color: var(--text-muted) !important;
}

.dial-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.side-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.side-actions.left-actions {
    align-items: flex-end;
}

.side-actions.right-actions {
    align-items: flex-start;
}

.side-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-primary);
    cursor: pointer;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.side-btn:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(255, 57, 85, 0.4);
}

.side-btn.active {
    background: #eab308;
    color: #000;
}

.side-btn .icon {
    font-size: 20px;
}

.side-btn .label {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.8;
}

.side-btn.primary-call {
    background: var(--accent) !important;
    color: #fff !important;
    width: 70px;
    height: 70px;
}

.side-btn.primary-call .icon {
    font-size: 26px;
}

.side-btn.primary-call:hover {
    box-shadow: 0 0 20px rgba(255, 57, 85, 0.5);
    background: #ff4a65 !important;
}

.side-btn.danger-hangup {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 70px;
    height: 70px;
}

.side-btn.danger-hangup:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.3);
}

.numpad {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
    flex: 0 0 auto;
}

.num-btn {
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    background: var(--bg-hover) !important;
    border: 1px solid transparent !important;
    color: var(--text-primary);
    font-size: 28px !important;
    font-weight: 300 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.num-btn:hover {
    background: rgba(228, 21, 12, 0.15) !important;
    color: var(--accent) !important;
    transform: scale(1.05);
}

.num-btn:active {
    background: var(--bg-hover) !important;
    transform: scale(0.95);
}

.num-btn .sub {
    font-size: 10px !important;
    letter-spacing: 2px !important;
    opacity: 0.4 !important;
    color: var(--text-muted) !important;
}

/* Fix chat panel */
.chat-panel {
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

/* Modernize Chat inputs */
.chat-input {
    border-radius: 20px;
    background: var(--bg-primary);
}

.chat-send-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .phone-center {
        padding: 15px;
    }

    .dial-container {
        flex-direction: column;
        gap: 20px;
    }

    .side-actions {
        flex-direction: row;
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .side-actions.left-actions {
        order: 2;
    }

    .numpad {
        order: 1;
        gap: 10px !important;
    }

    .side-actions.right-actions {
        order: 3;
    }

    .side-btn {
        width: 55px;
        height: 55px;
    }

    .side-btn.primary-call,
    .side-btn.danger-hangup {
        width: 60px;
        height: 60px;
    }

    .num-btn {
        width: 60px !important;
        height: 60px !important;
    }
}

.phone-center.mobile-hidden {
    display: none !important;
}

#softphone {
    background: var(--bg-primary);
}

@media (max-width: 768px) {
    .chat-panel.mobile-chat-active {
        display: flex !important;
        position: fixed;
        inset: 0;
        width: 100%;
        max-height: 100%;
        z-index: 1000;
        border-radius: 0;
        bottom: 60px;
        height: calc(100vh - 60px);
    }
}