/* Absoluta Chatbot - New Brand Theme */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600&family=Onest:wght@500;600&family=Poppins:wght@500;600&display=swap');

:root {
    /* New Absoluta brand colors */
    --primary: #1e656e;
    --primary-dark: #165358;
    --primary-light: #2a7a84;
    --secondary: #331832;
    --accent: #fff375;

    /* Neutral palette */
    --bg-primary: #FAFBFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F5F6F7;
    --text-primary: #1A1A2E;
    --text-secondary: #636E72;
    --text-muted: #9CA3AF;

    /* Semantic */
    --border: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.06);
    --shadow-lg: rgba(0, 0, 0, 0.10);

    /* Sizing */
    --header-height: 72px;
    --input-height: 80px;
    --max-width: 800px;
    --border-radius: 24px;
    --border-radius-pill: 1000px;
    --border-radius-sm: 12px;

    /* Status colors */
    --color-pending: #FF9800;
    --color-in-progress: #2196F3;
    --color-resolved: #4CAF50;
    --color-low: #4CAF50;
    --color-medium: #FFC107;
    --color-high: #E53935;
}

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

html,
body {
    height: 100%;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: #f5f5f5;
    overflow: hidden;
}

/* ============================================================================
   HOMEPAGE IFRAME BACKGROUND
   ============================================================================ */

.homepage-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 1;
}

/* ============================================================================
   JOOST CHAT WIDGET
   ============================================================================ */

/* Widget Container */
.joost-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Collapsed Card - Using Figma Image */
.widget-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 8px 32px rgba(30, 101, 110, 0.35));
}

.widget-card:hover {
    transform: translateY(-4px) scale(1.02);
    filter: drop-shadow(0 12px 40px rgba(30, 101, 110, 0.5));
}

.widget-card-image {
    display: block;
    max-width: 100%;
    height: auto;
    width: 420px;
}

/* Expanded Panel */
.widget-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 580px;
    max-height: calc(100vh - 48px);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Widget States */
.joost-widget.expanded .widget-card {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
}

.joost-widget.expanded .widget-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Widget Header */
.widget-header {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    background: var(--primary);
    color: white;
    flex-shrink: 0;
    gap: 10px;
}

.widget-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.widget-header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.widget-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.widget-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-avatar svg {
    width: 22px;
    height: 22px;
}

.widget-header-text h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.widget-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    opacity: 0.85;
}

.widget-status-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.widget-header-actions {
    display: flex;
    gap: 4px;
}

.widget-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.widget-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.widget-btn svg {
    width: 16px;
    height: 16px;
}

.widget-type-select {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}
.widget-type-select option {
    color: #333;
    background: #fff;
}

.widget-close {
    background: rgba(255, 255, 255, 0.15);
}

.widget-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Widget Messages */
.widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-primary);
}

/* Widget Suggestions */
.widget-suggestions {
    padding: 0 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--bg-primary);
}

.widget-suggestions .suggestion-chip {
    padding: 8px 14px;
    font-size: 0.8rem;
}

/* Widget Input */
.widget-input {
    padding: 12px 16px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.widget-input-wrapper {
    display: flex;
    gap: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-pill);
    padding: 4px 4px 4px 16px;
    align-items: center;
}

.widget-input-wrapper input {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 4px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
}

.widget-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.widget-send {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--accent);
    border-radius: 50%;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.widget-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 243, 117, 0.5);
}

.widget-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.widget-send svg {
    width: 18px;
    height: 18px;
}

/* Widget Messages Styling (override for compact view) */
.widget-messages .message {
    max-width: 90%;
    gap: 10px;
}

.widget-messages .message-avatar {
    width: 32px;
    height: 32px;
}

.widget-messages .message-avatar svg {
    width: 16px;
    height: 16px;
}

.widget-messages .message-content {
    padding: 12px 16px;
    font-size: 0.9rem;
}

.widget-messages .message-content p {
    margin-bottom: 6px;
}

/* Widget Tablet Styles */
@media (max-width: 600px) {
    .widget-card-image {
        width: 340px;
    }

    .widget-panel {
        width: 360px;
    }
}

/* Widget Mobile Styles */
@media (max-width: 480px) {
    .joost-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .widget-card-image {
        width: 100%;
        max-width: 100%;
    }

    .widget-panel {
        position: fixed;
        width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(100vh - 32px);
        max-height: none;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .widget-header {
        padding: 12px 14px;
        gap: 8px;
    }

    .widget-messages {
        padding: 12px;
    }

    .widget-suggestions {
        padding: 0 12px 10px;
    }

    .widget-input {
        padding: 10px 12px 14px;
    }

    .widget-messages .message-content {
        padding: 10px 14px;
        font-size: 0.875rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .widget-card-image {
        width: 280px;
    }
}

/* ============================================================================
   FULLSCREEN CHAT MODE - Enhanced Responsive Design
   ============================================================================ */

.fullscreen-chat {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, var(--primary) 0%, var(--secondary) 60%, #1a1025 100%);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fullscreen-chat.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Background pattern overlay */
.fullscreen-chat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 243, 117, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(30, 101, 110, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.fullscreen-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-primary);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.3);
}

/* Desktop - Centered card with padding */
@media (min-width: 1024px) {
    .fullscreen-chat {
        padding: 40px;
    }

    .fullscreen-container {
        height: calc(100% - 80px);
        border-radius: 28px;
        overflow: hidden;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .fullscreen-chat {
        padding: 24px;
    }

    .fullscreen-container {
        height: calc(100% - 48px);
        border-radius: 24px;
        overflow: hidden;
    }
}

/* Fullscreen Header */
.fullscreen-header {
    display: flex;
    flex-direction: column;
    padding: 24px 32px;
    gap: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.fullscreen-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fullscreen-header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* Decorative header accent */
.fullscreen-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 243, 117, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.fullscreen-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.fullscreen-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.fullscreen-avatar svg {
    width: 28px;
    height: 28px;
}

.fullscreen-header-text h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.fullscreen-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.fullscreen-status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.fullscreen-header-actions {
    display: flex;
    gap: 10px;
}

.fullscreen-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    backdrop-filter: blur(8px);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.fullscreen-btn svg {
    width: 18px;
    height: 18px;
}

.fullscreen-minimize {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--secondary);
    font-weight: 600;
}

.fullscreen-minimize:hover {
    background: #ffe94d;
    border-color: #ffe94d;
    box-shadow: 0 4px 20px rgba(255, 243, 117, 0.4);
}

/* Fullscreen Messages Area */
.fullscreen-messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Custom scrollbar for messages */
.fullscreen-messages::-webkit-scrollbar {
    width: 6px;
}

.fullscreen-messages::-webkit-scrollbar-track {
    background: transparent;
}

.fullscreen-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.fullscreen-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Message styling in fullscreen */
.fullscreen-messages .message {
    max-width: 70%;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fullscreen-messages .message.assistant {
    align-self: flex-start;
}

.fullscreen-messages .message.user {
    align-self: flex-end;
}

.fullscreen-messages .message-avatar {
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fullscreen-messages .message-avatar svg {
    width: 24px;
    height: 24px;
}

.fullscreen-messages .message-content {
    padding: 20px 28px;
    font-size: 1.05rem;
    line-height: 1.7;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.fullscreen-messages .message.assistant .message-content {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.fullscreen-messages .message.user .message-content {
    background: white;
    border: 1px solid var(--border);
}

/* Fullscreen Suggestions */
.fullscreen-suggestions {
    padding: 0 40px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    background: transparent;
}

.fullscreen-suggestions .suggestion-chip {
    padding: 14px 24px;
    font-size: 0.95rem;
    background: white;
    border: 2px solid var(--border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.fullscreen-suggestions .suggestion-chip:hover {
    border-color: var(--primary);
    background: rgba(30, 101, 110, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 101, 110, 0.15);
}

/* Fullscreen Input Area */
.fullscreen-input {
    padding: 24px 40px 32px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.fullscreen-input-wrapper {
    display: flex;
    gap: 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--border-radius-pill);
    padding: 8px 8px 8px 28px;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    transition: all 0.2s ease;
}

.fullscreen-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 101, 110, 0.1);
}

.fullscreen-input-wrapper input {
    flex: 1;
    border: none;
    background: none;
    padding: 16px 8px;
    font-size: 1.1rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
}

.fullscreen-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.fullscreen-send {
    width: 56px;
    height: 56px;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, #ffe94d 100%);
    border-radius: 50%;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(255, 243, 117, 0.3);
}

.fullscreen-send:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(255, 243, 117, 0.5);
}

.fullscreen-send:active {
    transform: scale(1.02);
}

.fullscreen-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fullscreen-send svg {
    width: 24px;
    height: 24px;
}

.fullscreen-disclaimer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.fullscreen-disclaimer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.fullscreen-disclaimer a:hover {
    text-decoration: underline;
}

/* ============================================================================
   FULLSCREEN RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .fullscreen-chat {
        padding: 60px;
    }

    .fullscreen-container {
        max-width: 1100px;
    }

    .fullscreen-header {
        padding: 28px 48px;
    }

    .fullscreen-messages {
        padding: 48px 60px;
    }

    .fullscreen-input {
        padding: 28px 60px 36px;
    }

    .fullscreen-input-wrapper {
        max-width: 900px;
    }
}

/* Tablet Landscape (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .fullscreen-container {
        max-width: 900px;
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .fullscreen-header {
        padding: 20px 28px;
    }

    .fullscreen-header-text h1 {
        font-size: 1.5rem;
    }

    .fullscreen-avatar {
        width: 48px;
        height: 48px;
    }

    .fullscreen-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .fullscreen-messages {
        padding: 32px;
        gap: 20px;
    }

    .fullscreen-messages .message {
        max-width: 80%;
    }

    .fullscreen-messages .message-content {
        padding: 16px 22px;
        font-size: 1rem;
    }

    .fullscreen-suggestions {
        padding: 0 32px 20px;
    }

    .fullscreen-input {
        padding: 20px 28px 28px;
    }
}

/* Mobile Landscape & Small Tablets (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .fullscreen-chat {
        padding: 0;
    }

    .fullscreen-container {
        border-radius: 0;
        height: 100%;
    }

    .fullscreen-header {
        padding: 16px 24px;
    }

    .fullscreen-header-text h1 {
        font-size: 1.35rem;
    }

    .fullscreen-avatar {
        width: 44px;
        height: 44px;
    }

    .fullscreen-avatar svg {
        width: 22px;
        height: 22px;
    }

    .fullscreen-btn {
        padding: 10px 14px;
    }

    .fullscreen-btn span {
        display: none;
    }

    .fullscreen-messages {
        padding: 24px;
        gap: 16px;
    }

    .fullscreen-messages .message {
        max-width: 85%;
    }

    .fullscreen-messages .message-avatar {
        width: 40px;
        height: 40px;
    }

    .fullscreen-messages .message-content {
        padding: 14px 18px;
        font-size: 0.95rem;
    }

    .fullscreen-suggestions {
        padding: 0 24px 16px;
        gap: 10px;
    }

    .fullscreen-suggestions .suggestion-chip {
        padding: 12px 18px;
        font-size: 0.9rem;
    }

    .fullscreen-input {
        padding: 16px 24px 24px;
    }

    .fullscreen-input-wrapper {
        padding: 6px 6px 6px 20px;
    }

    .fullscreen-input-wrapper input {
        font-size: 1rem;
        padding: 12px 6px;
    }

    .fullscreen-send {
        width: 50px;
        height: 50px;
    }

    .fullscreen-send svg {
        width: 22px;
        height: 22px;
    }
}

/* Mobile Portrait (< 600px) */
@media (max-width: 599px) {
    .fullscreen-chat {
        padding: 0;
    }

    .fullscreen-container {
        border-radius: 0;
        height: 100%;
    }

    .fullscreen-header {
        padding: 14px 16px;
        gap: 10px;
    }

    .fullscreen-header::after {
        display: none;
    }

    .fullscreen-header-info {
        gap: 12px;
    }

    .fullscreen-avatar {
        width: 40px;
        height: 40px;
    }

    .fullscreen-avatar svg {
        width: 20px;
        height: 20px;
    }

    .fullscreen-header-text h1 {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .fullscreen-status {
        font-size: 0.8rem;
    }

    .fullscreen-status-dot {
        width: 6px;
        height: 6px;
    }

    .fullscreen-header-actions {
        gap: 6px;
    }

    .fullscreen-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .fullscreen-btn span {
        display: none;
    }

    .fullscreen-btn svg {
        width: 16px;
        height: 16px;
    }

    .fullscreen-minimize {
        padding: 8px 12px;
    }

    .fullscreen-messages {
        padding: 16px;
        gap: 14px;
    }

    .fullscreen-messages .message {
        max-width: 92%;
        gap: 8px;
    }

    .fullscreen-messages .message-avatar {
        width: 32px;
        height: 32px;
    }

    .fullscreen-messages .message-avatar svg {
        width: 16px;
        height: 16px;
    }

    .fullscreen-messages .message-content {
        padding: 12px 16px;
        font-size: 0.9rem;
        line-height: 1.6;
        border-radius: 16px;
    }

    .fullscreen-suggestions {
        padding: 0 16px 12px;
        gap: 8px;
    }

    .fullscreen-suggestions .suggestion-chip {
        padding: 10px 14px;
        font-size: 0.85rem;
        border-width: 1px;
    }

    .fullscreen-input {
        padding: 12px 16px 20px;
    }

    .fullscreen-input-wrapper {
        padding: 4px 4px 4px 16px;
        border-width: 1px;
    }

    .fullscreen-input-wrapper input {
        padding: 10px 4px;
        font-size: 1rem;
    }

    .fullscreen-send {
        width: 44px;
        height: 44px;
    }

    .fullscreen-send svg {
        width: 20px;
        height: 20px;
    }

    .fullscreen-disclaimer {
        margin-top: 12px;
        font-size: 0.75rem;
    }
}

/* Very small mobile (< 380px) */
@media (max-width: 379px) {
    .fullscreen-header {
        padding: 12px;
    }

    .fullscreen-avatar {
        width: 36px;
        height: 36px;
    }

    .fullscreen-header-text h1 {
        font-size: 1.1rem;
    }

    .fullscreen-btn {
        padding: 6px 8px;
    }

    .fullscreen-messages {
        padding: 12px;
        gap: 12px;
    }

    .fullscreen-messages .message-content {
        padding: 10px 14px;
        font-size: 0.875rem;
    }

    .fullscreen-input {
        padding: 10px 12px 16px;
    }

    .fullscreen-send {
        width: 40px;
        height: 40px;
    }
}

/* Expand Button in Widget Header */
.widget-expand-btn {
    background: var(--accent) !important;
    color: var(--secondary) !important;
}

.widget-expand-btn:hover {
    background: #ffe94d !important;
    transform: scale(1.05);
}

/* ============================================================================
   END WIDGET STYLES
   ============================================================================ */

/* Container (legacy - keeping for other pages) */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--bg-primary);
    box-shadow: 0 0 60px var(--shadow-lg);
}

@media (min-width: 840px) {
    .chat-container {
        height: calc(100vh - 40px);
        border-radius: var(--border-radius);
        overflow: hidden;
    }
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    min-height: var(--header-height);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.avatar {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.avatar svg {
    width: 24px;
    height: 24px;
}

.header-text h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.btn-clear {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: rgba(30, 101, 110, 0.1);
    color: var(--primary);
}

.btn-clear svg {
    width: 18px;
    height: 18px;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-primary);
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.message-avatar svg {
    width: 18px;
    height: 18px;
}

.message.user .message-avatar {
    background: var(--secondary);
}

.message-content {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 12px rgba(30, 101, 110, 0.15);
}

.message.user .message-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow);
}

.message-content p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    font-weight: 600;
}

.message-content a {
    color: var(--accent);
    text-decoration: underline;
}

.message.user .message-content a {
    color: var(--primary);
}

/* Sources */
.message-sources {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.message-sources-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-link {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    margin-right: 12px;
    margin-bottom: 4px;
}

.source-link:hover {
    text-decoration: underline;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* Suggestions */
.suggestions {
    padding: 0 24px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-primary);
}

.suggestion-chip {
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-pill);
    font-size: 0.875rem;
    font-family: 'Onest', sans-serif;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(30, 101, 110, 0.05);
}

.suggestion-chip:active {
    transform: scale(0.98);
}

/* Input Area */
.chat-input {
    padding: 16px 24px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-pill);
    padding: 6px 6px 6px 20px;
    align-items: center;
}

#messageInput {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.btn-send {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--accent);
    border-radius: 50%;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 243, 117, 0.5);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-send svg {
    width: 20px;
    height: 20px;
}

.disclaimer {
    margin-top: 12px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.disclaimer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.disclaimer a:hover {
    text-decoration: underline;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 8px;
}

.btn-sources {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-sources:hover {
    background: rgba(30, 101, 110, 0.1);
    color: var(--primary);
}

.btn-sources svg {
    width: 18px;
    height: 18px;
}

.btn-logout {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #FFE5E5;
    color: #E53935;
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(51, 24, 50, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 20px;
}

.login-avatar svg {
    width: 40px;
    height: 40px;
}

.login-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-input-wrapper {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-pill);
    padding: 4px 16px;
}

.login-input-wrapper input {
    width: 100%;
    border: none;
    background: none;
    padding: 14px 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
}

.login-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.login-error {
    color: #E53935;
    font-size: 0.875rem;
    text-align: center;
    padding: 10px;
    background: #FFEBEE;
    border-radius: var(--border-radius-sm);
}

.login-button {
    width: 100%;
    padding: 16px 24px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Onest', sans-serif;
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 101, 110, 0.4);
    background: var(--primary-dark);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .chat-header {
        padding: 12px 16px;
    }

    .brand-logo {
        font-size: 1.25rem;
    }

    .header-text h1 {
        font-size: 1rem;
    }

    .chat-messages {
        padding: 16px;
        gap: 12px;
    }

    .suggestions {
        padding: 0 16px 12px;
        gap: 8px;
    }

    .chat-input {
        padding: 12px 16px 16px;
    }

    .input-wrapper {
        padding: 4px 4px 4px 16px;
    }

    .btn-send {
        width: 44px;
        height: 44px;
    }

    .message {
        max-width: 90%;
    }

    .message-content {
        padding: 14px 16px;
    }

    .suggestion-chip {
        font-size: 0.8rem;
        padding: 8px 14px;
    }

    .login-card {
        padding: 24px;
    }

    .login-brand {
        font-size: 1.5rem;
    }
}

/* ============================================================================
   Analytics Dashboard Styles
   ============================================================================ */

.analytics-container,
.escalations-container {
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
    padding: 0;
}

body:has(.analytics-container),
body:has(.escalations-container) {
    overflow-x: hidden;
    overflow-y: auto;
}

@media (min-width: 1240px) {
    body:has(.analytics-container),
    body:has(.escalations-container) {
        padding: 20px;
    }

    .analytics-container,
    .escalations-container {
        border-radius: var(--border-radius);
        box-shadow: 0 0 60px var(--shadow-lg);
        min-height: calc(100vh - 40px);
    }
}

/* Analytics & Escalations Header */
.analytics-header,
.esc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.analytics-header .header-brand,
.esc-header .header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-back {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-back:hover {
    background: var(--border);
    color: var(--text-primary);
}

.btn-back svg {
    width: 20px;
    height: 20px;
}

.btn-run-analysis {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Onest', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-run-analysis:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 101, 110, 0.4);
    background: var(--primary-dark);
}

.btn-run-analysis svg {
    width: 18px;
    height: 18px;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-range-picker {
    display: flex;
    gap: 4px;
}

.date-btn {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-btn:hover {
    border-color: var(--border);
}

.date-btn.active {
    background: var(--primary);
    color: white;
}

.custom-date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.custom-date-inputs input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.custom-date-inputs span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-apply-dates {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-apply-dates:hover {
    background: var(--primary-dark);
}

.filter-group select {
    padding: 8px 32px 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636E72' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    padding: 24px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px var(--shadow);
}

.summary-card.warning .card-icon {
    background: rgba(30, 101, 110, 0.1);
    color: var(--primary);
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card-icon.conversations {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.card-icon.sessions {
    background: rgba(0, 184, 148, 0.1);
    color: var(--accent);
}

.card-icon.response-time {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
}

.card-icon.confidence {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.card-icon.low-confidence {
    background: rgba(30, 101, 110, 0.1);
    color: var(--primary);
}

.card-content {
    display: flex;
    flex-direction: column;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 0 24px 24px;
}

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

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

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.insight-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 12px;
}

/* Insights List */
.insights-section {
    min-height: 400px;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.insight-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    border-left: 4px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-lg);
}

.insight-card.critical {
    border-left-color: #E53935;
}

.insight-card.warning {
    border-left-color: #FF9800;
}

.insight-card.info {
    border-left-color: #2196F3;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.insight-severity {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

.severity-critical {
    background: #FFEBEE;
    color: #E53935;
}

.severity-warning {
    background: #FFF3E0;
    color: #FF9800;
}

.severity-info {
    background: #E3F2FD;
    color: #2196F3;
}

.insight-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.insight-status {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: auto;
}

.status-new {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.status-reviewed {
    background: #E3F2FD;
    color: #1976D2;
}

.status-resolved {
    background: #E8F5E9;
    color: #388E3C;
}

.insight-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.insight-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.insight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.affected-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.affected-count svg {
    width: 14px;
    height: 14px;
}

.btn-view-insight {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-insight:hover {
    background: rgba(30, 101, 110, 0.1);
}

/* Chart Section */
.trends-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
}

.chart-tabs {
    display: flex;
    gap: 4px;
}

.chart-tab {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-tab:hover {
    background: var(--border);
}

.chart-tab.active {
    background: var(--primary);
    color: white;
}

.chart-container {
    height: 300px;
    margin-top: 16px;
}

/* Analysis Runs Section */
.runs-section {
    padding: 0 24px 24px;
}

.runs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.run-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 1px 4px var(--shadow);
}

.run-status {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.run-status svg {
    width: 18px;
    height: 18px;
}

.run-status.status-completed {
    background: #E8F5E9;
    color: #388E3C;
}

.run-status.status-running {
    background: #FFF3E0;
    color: #FF9800;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.run-status.status-failed {
    background: #FFEBEE;
    color: #E53935;
}

.run-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.run-date {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.run-period {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.run-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Empty & Loading States */
.empty-state,
.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.btn-run-first {
    margin-top: 16px;
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-run-first:hover {
    background: var(--primary-dark);
}

/* Insight Modal */
.insight-modal,
.run-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.insight-modal-content,
.run-modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.insight-modal-header {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.insight-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.insight-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.insight-recommendation {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
}

.insight-recommendation strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.insight-recommendation p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.insight-samples {
    margin-bottom: 24px;
}

.insight-samples strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.insight-samples ul {
    list-style: none;
    padding: 0;
}

.insight-samples li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.insight-samples li:last-child {
    border-bottom: none;
}

.insight-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-status {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-status:hover {
    background: var(--border);
}

.btn-status.primary {
    background: var(--primary);
    color: white;
}

.btn-status.primary:hover {
    background: var(--primary-dark);
}

/* Run Modal */
.run-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.run-modal-content > p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-inputs input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    flex: 1;
}

.date-inputs span {
    color: var(--text-muted);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-cancel {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: var(--border);
}

.btn-primary {
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: 'Onest', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 101, 110, 0.4);
    background: var(--primary-dark);
}

.run-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.run-progress p {
    margin-top: 16px;
    color: var(--text-secondary);
}

/* Analytics Mobile Adjustments */
@media (max-width: 768px) {
    .analytics-header {
        padding: 12px 16px;
    }

    .analytics-header .header-text h1,
    .esc-header .header-text h1 {
        font-size: 1.1rem;
    }

    .btn-run-analysis span {
        display: none;
    }

    .filters-bar {
        padding: 16px;
        gap: 12px;
    }

    .date-range-picker {
        flex-wrap: wrap;
    }

    .summary-cards {
        padding: 16px;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .summary-card {
        padding: 14px;
    }

    .card-value {
        font-size: 1.4rem;
    }

    .analytics-grid {
        padding: 0 16px 16px;
    }

    .runs-section {
        padding: 0 16px 16px;
    }

    .insight-modal-content,
    .run-modal-content {
        padding: 24px;
    }
}

/* Analytics Button in Chat Header */
.btn-analytics {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-analytics:hover {
    background: rgba(30, 101, 110, 0.1);
    color: var(--primary);
}

.btn-analytics svg {
    width: 18px;
    height: 18px;
}

/* ============================================================================
   Escalation Dashboard Styles
   ============================================================================ */

/* Header overrides for escalation */
.esc-header .header-text h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--color-resolved);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.refresh-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Onest', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 101, 110, 0.4);
    background: var(--primary-dark);
}

.btn-refresh svg {
    width: 18px;
    height: 18px;
}

.btn-refresh.spinning svg {
    animation: spin 1s linear infinite;
}

/* Escalation-specific filters override */
.escalations-container .filters-bar {
    align-items: flex-end;
    padding: 16px 24px;
}

/* Card icon variants for escalation */
.card-icon.pending {
    background: rgba(255, 152, 0, 0.1);
    color: var(--color-pending);
}

.card-icon.in-progress {
    background: rgba(33, 150, 243, 0.1);
    color: var(--color-in-progress);
}

.card-icon.resolved-today {
    background: rgba(76, 175, 80, 0.1);
    color: var(--color-resolved);
}

.card-icon.total {
    background: rgba(30, 101, 110, 0.1);
    color: var(--primary);
}

/* Summary card hover */
.escalations-container .summary-card {
    transition: transform 0.2s ease;
}

.escalations-container .summary-card:hover {
    transform: translateY(-2px);
}

/* Escalation List Section */
.escalations-section {
    padding: 0 24px 24px;
}

.esc-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 12px;
}

.escalation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Escalation Card */
.escalation-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border-left: 4px solid var(--border);
    transition: all 0.2s ease;
}

.escalation-card:hover {
    box-shadow: 0 4px 16px var(--shadow-lg);
}

.escalation-card.urgency-high {
    border-left-color: var(--color-high);
    border-left-width: 5px;
    background: rgba(229, 57, 53, 0.03);
}

.escalation-card.urgency-medium {
    border-left-color: var(--color-medium);
}

.escalation-card.urgency-low {
    border-left-color: var(--color-low);
}

.esc-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-type {
    background: rgba(30, 101, 110, 0.1);
    color: var(--primary);
}

.badge-type.handoff {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.badge-type.quote {
    background: rgba(30, 101, 110, 0.1);
    color: var(--primary);
}

.badge-type.complaint {
    background: rgba(229, 57, 53, 0.1);
    color: var(--color-high);
}

.badge-type.complex_issue {
    background: rgba(156, 39, 176, 0.1);
    color: #9C27B0;
}

.badge-urgency.low {
    background: rgba(76, 175, 80, 0.1);
    color: var(--color-low);
}

.badge-urgency.medium {
    background: rgba(255, 193, 7, 0.15);
    color: #F57F17;
}

.badge-urgency.high {
    background: rgba(229, 57, 53, 0.1);
    color: var(--color-high);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-urgency.high::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-high);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.badge-status {
    margin-left: auto;
}

.badge-status.pending {
    background: rgba(255, 152, 0, 0.1);
    color: var(--color-pending);
}

.badge-status.in_progress {
    background: rgba(33, 150, 243, 0.1);
    color: var(--color-in-progress);
}

.badge-status.resolved {
    background: rgba(76, 175, 80, 0.1);
    color: var(--color-resolved);
}

.esc-summary {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Intake data grid */
.intake-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    font-size: 0.82rem;
}

.intake-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.intake-indicator {
    flex-shrink: 0;
    font-size: 0.75rem;
}

.intake-indicator.filled {
    color: var(--color-resolved);
}

.intake-indicator.missing {
    color: var(--color-high);
}

.intake-label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.intake-value {
    color: var(--text-primary);
    font-weight: 600;
}

.intake-value.missing {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
}

/* Escalation meta info */
.esc-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.esc-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.esc-meta-item svg {
    width: 14px;
    height: 14px;
}

/* Escalation card footer */
.esc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-expand {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-expand:hover {
    background: rgba(30, 101, 110, 0.1);
}

.btn-update-status {
    padding: 6px 14px;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-update-status:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-update-status:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Conversation snippet */
.esc-conversation {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    max-height: 300px;
    overflow-y: auto;
}

.esc-conversation.expanded {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conv-message {
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.conv-message.user {
    text-align: right;
}

.conv-message.assistant {
    text-align: left;
}

.conv-role {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.conv-role.user {
    color: var(--primary);
}

.conv-role.assistant {
    color: var(--text-muted);
}

.conv-bubble {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 12px;
    max-width: 85%;
    text-align: left;
    word-break: break-word;
}

.conv-message.user .conv-bubble {
    background: var(--primary);
    color: white;
    border-radius: 12px 12px 2px 12px;
}

.conv-message.assistant .conv-bubble {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 12px 12px 12px 2px;
    border: 1px solid var(--border);
}

.conv-text {
    color: var(--text-secondary);
}

/* Escalation Status Update Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-content .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-content .modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.modal-content h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-right: 40px;
}

.modal-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-content .form-group {
    margin-bottom: 16px;
}

.modal-content .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.modal-content .form-group select,
.modal-content .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: vertical;
}

.modal-content .form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636E72' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.modal-content .form-group textarea {
    min-height: 80px;
}

.modal-content .form-group select:focus,
.modal-content .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.btn-cancel {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: var(--border);
}

.btn-save {
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading state typing indicator for dashboards */
.loading-state .typing-indicator {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.loading-state .typing-indicator span {
    background: var(--primary);
    animation: bounceScale 1.4s ease-in-out infinite both;
}

.loading-state .typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-state .typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounceScale {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Dashboard empty/loading/error state overrides */
.escalations-container .empty-state,
.escalations-container .loading-state,
.escalations-container .error-state {
    padding: 60px 20px;
}

.escalations-container .error-state {
    color: var(--color-high);
}

.escalations-container .error-state p {
    margin-bottom: 12px;
}

/* Error state retry button */
.btn-retry {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-retry:hover {
    background: var(--primary-dark);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--secondary);
    color: white;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: slideUp 0.3s ease;
    transition: opacity 0.3s ease;
}

.toast.success {
    background: var(--color-resolved);
}

.toast.error {
    background: var(--color-high);
}

.toast.fade-out {
    opacity: 0;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover {
    color: white;
}

/* Search input in filters bar */
.search-input {
    width: 100%;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.filter-group-search {
    flex: 1 1 100%;
}

/* Active filter indicators */
.filter-group select.filter-active {
    border-color: var(--primary);
    background-color: rgba(12, 51, 56, 0.04);
}

/* Clear filters button */
.btn-clear-filters {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-clear-filters:hover {
    color: var(--primary-dark);
}

/* Logout button */
.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.22);
    color: white;
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

/* Load more button */
.btn-load-more {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 4px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover {
    background: rgba(12, 51, 56, 0.05);
    border-color: var(--primary);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 16px;
}

.empty-state-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.empty-state-action {
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.empty-state-action:hover {
    color: var(--primary-dark);
}

/* Login form */
.login-form {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.login-input {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    min-width: 200px;
}

.login-input:focus {
    border-color: var(--primary);
}

/* Escalation Responsive */
@media (max-width: 768px) {
    .esc-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .escalations-container .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .escalations-container .filters-bar {
        flex-direction: column;
        gap: 12px;
    }

    .escalations-container .filter-group select,
    .escalations-container .search-input {
        width: 100%;
    }

    .filter-group-search {
        order: -1;
    }

    .escalations-container .summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 16px;
    }

    .escalations-section {
        padding: 0 16px 16px;
    }

    .escalation-card {
        padding: 16px;
    }

    .esc-card-header {
        gap: 6px;
    }

    .badge-status {
        margin-left: 0;
    }

    .esc-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .escalations-container .summary-cards {
        grid-template-columns: 1fr;
    }

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

    .modal-content {
        max-width: 100%;
        margin: 10px;
        padding: 24px 20px;
    }

    .login-form {
        flex-direction: column;
    }

    .login-input {
        min-width: 0;
        width: 100%;
    }

    .btn-expand,
    .btn-update-status,
    .btn-retry {
        min-height: 44px;
    }
}

/* ============================================================
   HANDOFF: System messages & Agent messages (Shopify-style)
   ============================================================ */

/* System message — centered, muted, no avatar */
.message.system-message {
    align-self: center !important;
    max-width: 100% !important;
    background: none !important;
    box-shadow: none !important;
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.system-message-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted, #7a8f93);
    font-style: italic;
}

.system-message .message-avatar,
.system-message .message-content {
    display: none;
}

/* Pulsing dot for "connecting" state */
.system-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent, #B3C6B2);
    border-radius: 50%;
    animation: systemPulse 1.5s ease-in-out infinite;
}

@keyframes systemPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Agent message — human avatar + name label */
.message.agent-message .agent-avatar {
    background: var(--accent, #B3C6B2) !important;
    color: var(--primary, #0C3338) !important;
}

.message.agent-message .agent-avatar span {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 14px;
}

.message.agent-message .agent-avatar svg {
    display: none;
}

.agent-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent, #B3C6B2);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

/* Widget-specific overrides */
.widget-messages .message.system-message {
    padding: 4px 0;
}

.widget-messages .system-message-content {
    font-size: 0.7rem;
}

/* Fullscreen-specific overrides */
.fullscreen-messages .message.system-message {
    padding: 12px 0;
}

.fullscreen-messages .system-message-content {
    font-size: 0.85rem;
}

.fullscreen-messages .agent-name {
    font-size: 0.75rem;
}