/* Basic Reset & Globals */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Prevent body scroll */
}

/* =============================
   LOGIN PAGE STYLES (moved from index.html inline)
   ============================= */

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #fff382;
    padding: 20px;
    font-family: 'Montserrat', sans-serif;
}

.login-box {
    background-color: rgba(255, 255, 255, 0.95);
    width: 100%;
    max-width: 420px;
    border-radius: 6px;
    padding: 40px 35px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

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

.login-header h1 {
    color: #1f2a33;
    margin-bottom: 10px;
    font-size: 2.2em;
    font-weight: 300;
    letter-spacing: 1px;
}

.login-form-group {
    margin-bottom: 25px;
    position: relative;
}

.login-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
    color: #555;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    box-sizing: border-box;
}

.login-form-group input:focus {
    outline: none;
    border-color: #8dbcf3;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
    transform: translateY(-2px);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: #ffdcd5;
    color: #56322b;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: none;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.6);
}

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

.google-signin-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.google-signin-btn {
    width: 100%;
    padding: 16px;
    background: white;
    color: #757575;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.google-signin-btn:hover {
    border-color: #ffcdc2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.google-logo {
    width: 20px;
    height: 20px;
}

.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #999;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e8e8;
}

.divider span {
    padding: 0 15px;
    background: rgba(255, 255, 255, 0.95);
}

.company-logo {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.company-logo::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 3px;
    background: #111;
    border-radius: 6px;
}

.company-logo h1 {
    background: none;
    -webkit-background-clip: text;
    -webkit-text-fill-color: currentColor;
    background-clip: text;
    font-size: 2.5em;
    font-weight: 600;
    margin: 0;
    letter-spacing: 2px;
}

.company-logo img {
    max-height: 60px;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(231, 76, 60, 0.2);
    font-size: 0.9em;
    display: none;
}

.error-message.show {
    display: block;
}

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

@media (max-width: 480px) {
    .login-container {
        padding: 15px;
    }
    .login-box {
        padding: 30px 25px;
    }
    .company-logo h1 {
        font-size: 2em;
    }
}

a {
    color: #0a66d9;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

.icon-small {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    color: #555;
}

/* Hide any chevron polylines */
.agent-name svg[data-feather="chevron-down"] polyline,
.agent-name .feather-chevron-down polyline,
polyline[points="6 9 12 15 18 9"] {
    display: none !important;
}


/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full viewport height */
    width: 100%;
}

/* Top Bar */
.top-bar {
    background-color: #fff382;
    color: #111;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #222f3e;
    height: 60px; /* Increased height */
    position: relative; /* For absolute positioning of timer */
}
.logo-area .logo-img {
    height: 30px;
    filter: invert(1);
}
.agent-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: 25px;
}
.status-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}
.agent-name {
    font-weight: 500;
    margin-right: 5px;
}
.agent-name .icon-small {
    color: #bdc3c7;
}

/* Logout button styling */
.logout-btn {
    background-color: #ffdcd5;
    color: #56322b;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}
.logout-btn:hover {
    background-color: #e74c3c;
}

/* Scenario Navigation */
.scenario-nav {
    display: none; /* Hide the scenario dropdown menu */
    align-items: center;
    justify-content: flex-start; /* revert to original alignment */
    margin-right: 60px;          /* revert original spacing */
}

.scenario-dropdown {
    background: linear-gradient(135deg, #a32d2d 0%, #000000 100%);
    color: rgb(255, 255, 255);
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.9em;
    font-weight: 500;
    min-width: 180px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    background-image: linear-gradient(135deg, #fffbe6 0%, #fffbe6 100%), url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2a33' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0 center, right 12px center; /* restore original gradient position */
    background-size: 100% 100%, 18px;
    padding-right: 16px;
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.2);
    letter-spacing: 0.5px;

    /* Center the visible selected text */
    text-align: center;
    text-align-last: center;
    -moz-text-align-last: center;
}

/* Keep dropdown list items left-aligned for readability */
.scenario-dropdown option {
    background-color: #2d3748;
    color: white;
    padding: 12px 16px;
    font-weight: 500;
    border: none;
    text-align: left;
}

/* Ensure the internal text box occupies the full width so centering is true */
.scenario-dropdown {
    display: block;           /* use native select rendering */
    width: 100%;              /* make the inner text box span the pill width */
    box-sizing: border-box;   /* include padding in width calculation */
}
.scenario-dropdown::-ms-value { /* IE/Edge legacy */
    text-align: center;
}

.scenario-dropdown:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.3);
    background: #fffbe6;
}

.scenario-dropdown:focus {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.4), 0 8px 25px rgba(135, 206, 235, 0.3);
}

.scenario-dropdown:active {
    transform: translateY(0);
}

.scenario-dropdown option {
    background-color: #2d3748;
    color: white;
    padding: 12px 16px;
    font-weight: 500;
    border: none;
}

.scenario-dropdown option:hover,
.scenario-dropdown option:focus {
    background: #fffbe6;
    color: #1f2a33;
}

/* Timer Display */
.timer-display {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    padding: 5px 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

/* Top Bar Action Buttons */
.top-bar-actions {
    position: absolute;
    right: 390px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 15px;
    z-index: 5;
}

.action-btn {
    background-color: #ffdcd5;
    color: #56322b;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

.action-btn:hover {
    background-color: #84b3e2;
}

.action-btn:active {
    background-color: #1a252f;
}

/* Switch for Unavailable toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}
.switch input { display:none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
}
input:checked + .slider {
  background-color: #2ecc71; /* Green for available */
}
input:focus + .slider {
  box-shadow: 0 0 1px #2ecc71;
}
input:checked + .slider:before {
  transform: translateX(14px);
}
.slider.round { border-radius: 999px; }
.slider.round:before { border-radius: 50%; }


/* Main Content Area */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background-color: #ffffff;
    min-height: 0;
}

.left-panel {
    width: 400px;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}
.company-header {
    margin-bottom: 20px;
}
.company-header h3 {
    font-size: 1.2em;
    margin-bottom: 2px;
}
.company-header span {
    font-size: 0.9em;
    color: #666;
}
.company-info {
    margin-bottom: 20px;
}
.company-info h4 {
    font-size: 0.8em;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.company-name-display {
    font-weight: 500;
}

.info-box {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 15px;
}
.info-box-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.info-box ul li {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #555;
    position: relative;
    padding-left: 15px;
}
.info-box ul li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: #888;
}

.agent-profile {
    margin-top: 20px;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}
.agent-profile p {
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.message-tone-display {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.tone-tag {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid #bbdefb;
}

.tone-info {
    color: #1976d2;
    opacity: 0.7;
}
.status-indicator {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    display: inline-flex; /* Use inline-flex for alignment */
    align-items: center;
}
.status-indicator .icon-small {
    color: #1890ff;
}

.offer-status {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    color: #555;
}

/* Chat Panel (Middle) */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    min-height: 0;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 0;
    max-height: none;
    min-height: 0;
}
.system-message {
    text-align: center;
    color: #888;
    font-size: 0.85em;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.system-message .timestamp {
    margin-left: 8px;
    font-style: italic;
}

.message {
    padding: 10px 15px;
    border-radius: 6px;
    max-width: 70%;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}
.message-sender-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    align-self: center;
}
.message-sender-icon.self {
    background-color: #dcf8c6;
}

.message-content {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.message-content p {
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}
.message-content p:last-child {
    margin-bottom: 0;
}
.message .timestamp {
    font-size: 0.75em;
    color: #999;
    margin-top: 5px;
    display: block;
}
.message.received {
    background-color: #f0f0f0;
    align-self: flex-start;
}
.message.sent {
    background-color: #e6fffb;
    align-self: flex-end;
}
.message.sent .message-sender-icon {
    order: 1;
}
.message.sent .message-content {
    order: 0;
}

/* System messages - right-aligned with white background */
.message.system {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    align-self: flex-end;
    margin: 10px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.message.system .message-sender-icon {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e0e0e0;
    font-weight: bold;
}

.message.system .message-sender-icon.self {
    background-color: #f8f9fa;
}

.message.system .message-content p {
    color: #333;
    font-weight: 500;
}

/* Hide timestamps for system messages */
.message.system .timestamp {
    display: none;
}

/* Agent messages - right-aligned with green background (like sent messages) */
.message.agent {
    background-color: #e6fffb;
    align-self: flex-end;
    margin: 10px 0;
}

.message.agent .message-sender-icon {
    background-color: #dcf8c6;
    color: #333;
    font-weight: bold;
}

.message.agent .message-sender-icon.self {
    background-color: #dcf8c6;
}

.message-options {
    position: absolute;
    top: 10px;
    right: -25px;
    cursor: pointer;
    color: #aaa;
}
.message.sent .message-options {
    left: -25px;
    right: auto;
}


.chat-input-area {
    display: flex;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    flex-shrink: 0;
    align-items: flex-end;
}
#chatInput::placeholder { /* cleared since we use custom overlay */
    color: transparent;
}
.chat-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
}
.textarea-placeholder {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    user-select: none;
}
.chat-input-wrapper:focus-within .textarea-placeholder,
#chatInput:not(:placeholder-shown) + .textarea-placeholder {
    display: none;
}
#chatInput {
    flex-grow: 1;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-right: 15px;
    font-size: 1em;
    min-height: 60px;
    max-height: 150px;
    resize: vertical;
    font-family: 'Montserrat', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.4;
}
#chatInput:focus {
    outline: none;
    border-color: #8dbcf3;
    box-shadow: 0 0 0 0.2rem rgba(141,188,243,.25);
}
#sendButton {
    background-color: #1f1f1f;
    color: #f4f4f4;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

/* Custom top-right resize handle removed by request */
#sendButton:hover {
    background-color: #2d2d2d;
}
#sendButton .feather {
    width: 20px;
    height: 20px;
}

.right-panel {
    width: 400px;
    background-color: #f8f9fa;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Customer Information Panel */
.customer-info-panel {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0; /* Allow flex shrinking */
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.templates-panel.expanded {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background-color: #ffffff;
}

.customer-info-panel.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}


/* Templates Panel */
.templates-panel {
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0; /* Don't shrink */
    display: flex;
    flex-direction: column;
    transition: flex 0.3s ease;
}

.templates-panel.expanded {
    flex: 1; /* Take up all available space */
    min-height: 0;
}

.templates-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
    order: 2; /* Header comes after content */
}

.templates-header:hover {
    background-color: #f0f0f0;
}

.expand-icon {
    transition: transform 0.2s ease;
    transform: rotate(0deg); /* Start pointing up (normal state) */
}

.templates-header.expanded .expand-icon {
    transform: rotate(180deg); /* Rotate down when expanded */
}

.templates-content {
    max-height: 300px;
    overflow-y: auto;
    transition: all 0.3s ease;
    order: 1; /* Content comes before header */
}

.templates-content.expanded {
    max-height: calc(100vh - 200px); /* Use viewport height instead of flex */
    flex: 1; /* Take up all available space */
}
.panel-controls {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 5px;
}
.control-btn {
    padding: 6px 10px;
    border: 1px solid #ccc;
    background-color: white;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.control-btn:hover {
    background-color: #f0f0f0;
}
.control-btn.icon-btn {
    padding: 6px;
}
.control-btn .icon-small {
    margin-right: 0;
}
.control-btn:not(.icon-btn) .icon-small {
    margin-left: 4px;
    margin-right: 0;
}


.info-block {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}
.panel-block {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
}

#ordersSection.panel-block {
    background-color: transparent;
    border: none;
    margin-bottom: 0;
}

#ordersSection .info-block-header {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
}
.info-block-header {
    padding: 8px 12px;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}
.info-block-header span:first-child {
    display: flex;
    align-items: center;
}
.info-block-content {
    padding: 10px 12px;
    font-size: 0.9em;
}
.info-list {
    padding: 0;
}
.info-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.info-list li:last-child {
    border-bottom: none;
}
.browsing-history .time-ago {
    color: #888;
    font-size: 0.9em;
    margin-left: auto;
    margin-right: 10px;
}
.browsing-history .icon-small {
    color: #888;
}

.browsing-history-link {
    color: #0a66d9;
    text-decoration: underline;
    cursor: pointer;
}

.browsing-history-link:hover {
    color: #084fa8;
    text-decoration: none;
}

.search-templates {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
}
.search-templates .icon-small {
    margin-right: 8px;
    color: #888;
}
.search-templates input {
    border: none;
    outline: none;
    flex-grow: 1;
    font-size: 0.9em;
    background: transparent;
}
.template-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    margin: 0; /* eliminate external gaps */
    border-bottom: 1px solid #e9ecef; /* in-item divider for seamless hover */
}
.template-item:hover,
.template-item:focus {
    background-color: #f3f8ff; /* subtle blue tint */
    box-shadow: 0 1px 0 rgba(0,0,0,0.04) inset;
    outline: none;
}
.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 400;
    margin-bottom: 5px;
    font-size: 0.9em;
}
.template-header span:first-child {
    font-weight: 550;
}
.template-shortcut {
    background-color: #e0e0e0;
    color: #555;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: normal;
}
.template-item p {
    font-size: 0.85em;
    color: #555;
    line-height: 1.4;
}

/* Global template styling - very light blue background */
.template-item.global-template {
    background-color: #f8fbff; /* Very light blue background */
    border-left: 3px solid #e3f2fd; /* Subtle left border */
}

.template-item.global-template:hover,
.template-item.global-template:focus {
    background-color: #f0f7ff; /* Slightly darker light blue on hover */
    box-shadow: 0 1px 0 rgba(0,0,0,0.04) inset;
}

/* subtle separator line between template boxes (not on the first) */
.template-item:last-child {
    border-bottom: none; /* no divider after the last item */
}

/* Search highlighting */
mark {
    background-color: #c2e3f5;
    color: #000;
    padding: 0 2px;
    border-radius: 6px;
}

/* No results message */
.no-results {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
    font-size: 0.9em;
}

/* Scrollbar styling (optional, for a more polished look) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ===================
   NEW FEATURES STYLES
   =================== */

/* Promotions/Gifts Section */
.promotions-section {
    background: #8198b6;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    color: white;
}

.promotions-header {
    position: relative;
}

.promotions-icon {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.promotions-icon i {
    width: 10px;
    height: 10px;
}

.promotions-info {
    margin-left: 32px;
}

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

.promotions-title span {
    font-weight: 600;
    font-size: 14px;
}

.active-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.promotions-description {
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.9;
    margin-top: 8px;
    margin-left: -32px;
    padding-left: 0;
}

.promotions-description p {
    margin: 0 0 6px 0;
    padding-left: 0;
}

.promotions-description p:last-child {
    margin-bottom: 0;
}

.promotions-description ul {
    padding-left: 0;
    margin: 0;
}

.promotions-description ul li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.4;
}

.promotions-description ul li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: rgba(255, 255, 255, 0.8);
}

/* Enhanced template search with keyboard shortcut support */
.search-templates {
    position: relative;
}

#templateSearch {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#templateSearch:focus {
    outline: none;
    border-color: #8dbcf3;
    box-shadow: 0 0 0 2px rgba(141, 188, 243, 0.25);
}

#templateSearch::placeholder {
    color: #999;
    font-style: italic;
}

/* ================================
   RESPONSIVE DESIGN FOR ACTION BUTTONS
   ================================ */

@media (max-width: 1200px) {
    .top-bar-actions {
        right: 20px;
        gap: 10px;
    }
    
    .action-btn {
        padding: 5px 8px;
        font-size: 0.8em;
    }
}

@media (max-width: 768px) {
    .top-bar {
        position: relative;
        height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 10px 15px;
    }
    
    .agent-status {
        order: 1;
        margin-bottom: 10px;
        align-self: flex-start;
    }
    
    .timer-display {
        order: 2;
        position: static;
        transform: none;
        margin: 10px 0;
        align-self: center;
    }
    
    .scenario-nav {
        order: 3;
        width: 100%;
        margin: 10px 0;
    }
    
    .scenario-dropdown {
        width: 100%;
        min-width: unset;
    }
    
    .top-bar-actions {
        order: 4;
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        gap: 8px;
    }
    
    .action-btn {
        flex: 1;
        max-width: 80px;
        padding: 8px 4px;
        font-size: 0.75em;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .action-btn {
        font-size: 0.7em;
        padding: 6px 2px;
        max-width: 70px;
    }
    
    .top-bar-actions {
        gap: 5px;
    }
    
    .top-bar {
        padding: 8px 10px;
    }
}

/* Dynamic Notes Styles */
.notes-section {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 15px;
}

.notes-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.notes-header .icon-small {
    margin-right: 8px;
    width: 12px;
    height: 12px;
    color: #d4841c;
}

.notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notes-list li {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #555;
    position: relative;
    padding-left: 15px;
}

.notes-list li:before {
    content: "\2022";
    color: #888;
    font-weight: bold;
    position: absolute;
    left: 0;
}

#dynamic-notes-container {
    margin-bottom: 20px;
}

.message-media {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.message-media img {
    display: block;
    width: min(220px, 100%);
    max-height: 260px;
    border-radius: 6px;
    object-fit: contain;
    cursor: pointer;
}

.coupon-card {
    padding: 11px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.coupon-card:last-child {
    border-bottom: 0;
}

.coupon-card-heading,
.order-heading {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.coupon-card-heading {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.coupon-code {
    overflow-wrap: anywhere;
    color: #1967a9;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.coupon-status {
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 1px solid #d6d9de;
    border-radius: 6px;
    color: #666;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.coupon-status.is-active {
    border-color: #b9dec6;
    background: #edf8f0;
    color: #23733c;
}

.coupon-status.is-inactive {
    border-color: #e2c1c1;
    background: #fff2f2;
    color: #9a3434;
}

.coupon-card p {
    margin: 5px 0 0;
    color: #555;
    font-size: 12px;
    line-height: 1.4;
}

/* =============================
   ORDERS SECTION STYLES
   ============================= */

.order-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    padding: 12px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 8px;
}

.order-date {
    color: #777;
    font-size: 11px;
    font-weight: 400;
}

.order-header:hover {
    opacity: 0.8;
}

.order-number {
    font-weight: 600;
    color: #333;
    text-decoration: underline;
    font-size: 14px;
}

.order-number::before {
    content: "Order ";
    font-weight: 600;
}

.order-number:hover {
    color: #0a66d9;
}

.order-expand-icon {
    color: #333;
    transition: transform 0.2s ease;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.order-expand-icon.expanded {
    transform: rotate(180deg);
}

.order-details {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.order-details.expanded {
    display: block;
}

.order-summary-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 14px;
}

.order-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #555;
    font-size: 12px;
}

.order-meta-row span,
.order-meta-row a {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.order-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.order-item-details {
    flex: 1;
}

.order-item-name {
    font-weight: 500;
    color: #333;
    text-decoration: underline;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.3;
}

.order-item-name:hover {
    color: #0a66d9;
}


.order-item-price {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.order-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.order-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ================================
   SMOOTH QA-INSPIRED STYLE MIGRATION
   ================================ */

:root {
    --qa-yellow: #fff382;
    --qa-yellow-soft: #fffbe6;
    --qa-yellow-border: #e9e0ab;
    --qa-coral: #ffdcd5;
    --qa-coral-hover: #ffcdc2;
    --qa-coral-active: #f7b9aa;
    --qa-coral-text: #56322b;
    --qa-bg: #f8f9fa;
    --qa-surface: #ffffff;
    --qa-surface-alt: #f2f4f7;
    --qa-border: #d8dde4;
    --qa-border-soft: #e6e8ef;
    --qa-text: #1f2a33;
    --qa-muted: #5f6b76;
    --qa-link: #0a66d9;
    --qa-link-hover: #084fa8;
    --qa-focus: #8dbcf3;
    --qa-success-bg: #eaf7df;
    --qa-success-border: #bddd98;
    --qa-success-text: #2a5b24;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--qa-bg);
    color: var(--qa-text);
}

.login-container {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: var(--qa-yellow);
}

.login-container::before,
.login-container::after {
    content: '';
    position: absolute;
    inset: -10%;
    pointer-events: none;
}

.login-container::before {
    z-index: 0;
    opacity: 0.58;
    background:
        radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 46%),
        radial-gradient(circle at 82% 18%, rgba(244, 218, 90, 0.18) 0%, rgba(244, 218, 90, 0) 44%),
        radial-gradient(circle at 52% 82%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 52%),
        linear-gradient(125deg, rgba(255, 243, 130, 0.96) 0%, rgba(255, 242, 126, 0.98) 48%, rgba(250, 229, 110, 0.97) 100%);
    background-size: 150% 150%;
    background-position: 0% 50%;
    animation: smoothGradientDrift 4.5s linear infinite alternate;
}

.login-container::after {
    z-index: 0;
    opacity: 0.032;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    animation: smoothNoiseDrift 18s linear infinite;
}

.login-box {
    position: relative;
    z-index: 1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 18px 50px rgba(96, 82, 30, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.company-logo::after {
    background: #111;
    height: 2px;
    width: 220px;
}

.company-logo h1 {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: #111;
    font-weight: 700;
    letter-spacing: 0;
}

.login-form-group input,
.google-signin-btn,
.login-btn {
    border-radius: 6px;
    font-family: inherit;
}

.login-form-group input {
    background: #fff;
    border: 1px solid var(--qa-border);
    color: var(--qa-text);
    box-shadow: none;
}

.login-form-group input:focus {
    border-color: var(--qa-focus);
    transform: none;
    box-shadow:
        0 0 0 1px rgba(141, 188, 243, 0.22),
        0 0 0 4px rgba(141, 188, 243, 0.10);
}

.google-signin-btn {
    border: 1px solid var(--qa-border);
    color: var(--qa-text);
    box-shadow: 0 1px 2px rgba(20, 24, 31, 0.05);
}

.google-signin-btn:hover {
    border-color: var(--qa-coral-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(116, 67, 55, 0.10);
}

.login-btn,
.logout-btn,
.action-btn,
.smooth-action-btn {
    appearance: none;
    background: var(--qa-coral);
    color: var(--qa-coral-text);
    border: 1px solid rgba(116, 67, 55, 0.15);
    border-radius: 6px;
    box-shadow: none;
    font-family: inherit;
    font-weight: 700;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.login-btn:hover,
.logout-btn:hover,
.action-btn:hover,
.smooth-action-btn:hover {
    background: var(--qa-coral-hover);
    border-color: rgba(116, 67, 55, 0.22);
    color: var(--qa-coral-text);
    transform: translateY(-1px);
    box-shadow: none;
}

.login-btn:active,
.logout-btn:active,
.action-btn:active,
.smooth-action-btn:active {
    background: var(--qa-coral-active);
    border-color: rgba(116, 67, 55, 0.25);
    transform: translateY(0);
}

.login-btn:focus-visible,
.logout-btn:focus-visible,
.action-btn:focus-visible,
.smooth-action-btn:focus-visible,
.scenario-dropdown:focus-visible,
#chatInput:focus,
#sendButton:focus-visible,
#templateSearch:focus {
    outline: none;
    box-shadow:
        0 0 0 1px rgba(141, 188, 243, 0.22),
        0 0 0 4px rgba(141, 188, 243, 0.10);
}

.error-message {
    border-color: rgba(193, 39, 63, 0.22);
    background: #fde8e8;
    color: #8a2c2c;
}

.app-container,
.main-content {
    background: var(--qa-bg);
}

.top-bar {
    justify-content: flex-start;
    gap: 16px;
    overflow: hidden;
    isolation: isolate;
    background: var(--qa-yellow);
    color: #111;
    border-bottom: 1px solid #eadb58;
    box-shadow: none;
}

.top-bar::before {
    content: '';
    position: absolute;
    inset: -40% -8% 1px -8%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background:
        radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 46%),
        radial-gradient(circle at 82% 18%, rgba(244, 218, 90, 0.18) 0%, rgba(244, 218, 90, 0) 44%),
        radial-gradient(circle at 52% 82%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 52%),
        linear-gradient(125deg, rgba(255, 243, 130, 0.96) 0%, rgba(255, 242, 126, 0.98) 48%, rgba(250, 229, 110, 0.97) 100%);
    background-size: 150% 150%;
    background-position: 0% 50%;
    animation: smoothGradientDrift 4.5s linear infinite alternate;
}

.top-bar > * {
    position: relative;
    z-index: 1;
}

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

.agent-name {
    color: #111;
    font-weight: 700;
}

.logout-btn {
    min-height: 35px;
    padding: 0 16px;
}

.logout-btn .icon-small {
    color: currentColor;
}

.top-bar-actions {
    position: static;
    transform: none;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn {
    min-height: 35px;
    padding: 0 16px;
    font-size: 0.9em;
}

.report-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.report-btn .icon-small {
    width: 15px;
    height: 15px;
    color: currentColor;
}

.scenario-nav {
    margin-right: 0;
}

.scenario-dropdown {
    background: #fffbe6;
    color: var(--qa-text);
    border: 1px solid #d4c75e;
    border-radius: 6px;
    box-shadow: none;
    font-family: inherit;
}

.scenario-dropdown:hover,
.scenario-dropdown:focus {
    background: #fffbe6;
    transform: none;
    box-shadow:
        0 0 0 1px rgba(141, 188, 243, 0.22),
        0 0 0 4px rgba(141, 188, 243, 0.10);
}

.left-panel,
.right-panel,
.chat-panel,
.chat-input-area,
.templates-header {
    background: var(--qa-bg);
}

.left-panel,
.right-panel {
    border-color: var(--qa-border-soft);
}

.chat-panel {
    border-color: var(--qa-border-soft);
}

.company-header {
    margin-bottom: 12px;
}

.company-header h3 {
    color: var(--qa-text);
    font-weight: 700;
}

.company-info h4,
.info-block-header,
.templates-header {
    color: var(--qa-text);
}

.info-box,
.notes-section {
    background: var(--qa-yellow-soft);
    border: 1px solid #ffe58f;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.notes-header,
.info-box-title {
    color: var(--qa-text);
}

.notes-list li,
.info-box ul li {
    color: var(--qa-muted);
}

.agent-profile {
    border-top-color: var(--qa-border-soft);
}

.tone-tag {
    background: #4a4a4a;
    border-color: #3b3b3b;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
}

.tone-info {
    color: var(--qa-muted);
}

.offer-status,
.status-indicator {
    background: var(--qa-surface);
    border-color: var(--qa-border);
    border-radius: 6px;
    color: var(--qa-muted);
}

.chat-messages {
    gap: 10px;
}

.system-message {
    color: var(--qa-muted);
    margin: 0;
}

.message {
    border-radius: 6px;
    max-width: 76%;
    padding: 11px 16px;
    line-height: 1.5;
    box-shadow: none;
}

.message-content p {
    font-size: 13px;
    margin: 0 0 5px;
}

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

.message.received {
    background: #f1f3f6;
    border: 1px solid #dbe1e8;
}

.message.sent,
.message.agent {
    background: var(--qa-yellow-soft);
    border: 1px solid var(--qa-yellow-border);
}

.message.system {
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    box-shadow: none;
}

.message-sender-icon,
.message.system .message-sender-icon {
    background: #e0e0e0;
    border: 0;
    color: var(--qa-muted);
}

.message-sender-icon.self,
.message.agent .message-sender-icon,
.message.agent .message-sender-icon.self {
    background: #dcf8c6;
    color: var(--qa-text);
}

.message .timestamp {
    color: #6b7280;
}

.chat-input-area {
    border-top: 1px solid var(--qa-border-soft);
    padding: 16px 20px;
}

#chatInput {
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    border-radius: 6px;
    color: var(--qa-text);
    font-family: inherit;
    box-shadow: none;
}

#chatInput:focus {
    border-color: var(--qa-focus);
}

.textarea-placeholder {
    color: #9a9a9a;
}

#sendButton {
    width: 42px;
    height: 42px;
    background: #1f1f1f;
    color: #f4f4f4;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

#sendButton:hover {
    background: #2d2d2d;
    transform: translateY(-1px);
}

#sendButton:active {
    background: #161616;
    transform: translateY(0);
}

.customer-info-panel {
    gap: 12px;
}

.templates-panel {
    background: var(--qa-surface);
    border-top-color: var(--qa-border-soft);
}

.templates-panel.expanded {
    background: var(--qa-bg);
}

.templates-header {
    border-bottom-color: var(--qa-border-soft);
}

.templates-header:hover {
    background: var(--qa-surface-alt);
}

.info-block,
.panel-block {
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(20, 24, 31, 0.04);
}

#ordersSection .info-block-header {
    background: var(--qa-surface);
    border-color: var(--qa-border);
    border-radius: 6px;
}

.info-block-header {
    border-bottom-color: var(--qa-border-soft);
}

.info-list li {
    align-items: flex-start;
    border-bottom-color: #f0f0f0;
    color: #2d3748;
    font-size: 0.85em;
}

.browsing-history .time-ago,
.browsing-history .icon-small {
    color: #6b7280;
}

.browsing-history-link,
.order-number,
.order-item-name {
    color: var(--qa-link);
    text-decoration: none;
}

.browsing-history-link:hover,
.order-number:hover,
.order-item-name:hover {
    color: var(--qa-link-hover);
    text-decoration: none;
}

.search-templates {
    border-bottom-color: var(--qa-border-soft);
    padding: 8px 12px;
}

.search-templates .icon-small {
    display: none;
}

#templateSearch {
    width: 100%;
    padding: 8px 12px 8px 38px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: var(--qa-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 14px 14px;
    font-family: inherit;
}

#templateSearch:focus {
    border-color: var(--qa-focus);
}

#templateSearch::placeholder {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

#templateItems {
    background: var(--qa-bg);
    padding: 5px;
}

.template-item,
.template-item.global-template {
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(20, 24, 31, 0.05);
    margin: 0 0 10px;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 12px 14px;
}

.template-item.global-template {
    background: var(--qa-yellow-soft);
    border-left: 1px solid var(--qa-border);
}

.template-item:hover,
.template-item:focus,
.template-item.global-template:hover,
.template-item.global-template:focus {
    background: #fff;
    border-color: #cfd6df;
    box-shadow: 0 2px 8px rgba(20, 24, 31, 0.07);
    outline: none;
}

.template-header {
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.template-header span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.template-shortcut {
    background: #e0e0e0;
    border-radius: 6px;
    color: #555;
    flex: 0 0 auto;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-item p {
    color: #555;
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

mark {
    background: rgba(194, 227, 245, 0.9);
    border-radius: 6px;
    color: inherit;
    padding: 0;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.promotions-section {
    background: #efefef;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: #111;
    margin-bottom: 10px;
    padding: 10px 12px;
}

.promotions-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.promotions-icon {
    position: static;
    width: 36px;
    height: 36px;
    background: transparent;
}

.promotions-icon i {
    width: 18px;
    height: 18px;
    color: #1f2328;
}

.promotions-info,
.promotions-description {
    margin-left: 0;
}

.promotions-title {
    margin-bottom: 2px;
}

.promotions-title span {
    color: #111;
    font-weight: 700;
}

.active-badge {
    background: var(--qa-success-bg);
    border: 1px solid var(--qa-success-border);
    color: var(--qa-success-text);
}

.promotions-description {
    color: var(--qa-text);
    opacity: 1;
}

.order-card {
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(20, 24, 31, 0.05);
}

.order-header:hover {
    opacity: 1;
}

.order-details,
.order-subtotal {
    border-top-color: var(--qa-border-soft);
}

.order-expand-icon {
    color: #9a9a9a;
}

.order-item {
    border-bottom-color: #f0f0f0;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(130, 130, 130, 0.20) transparent;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(130, 130, 130, 0.16);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(130, 130, 130, 0.28);
}

.smooth-state-card,
.completion-message {
    max-width: 640px;
    margin: 6rem auto;
    text-align: center;
    padding: 2.5rem;
    border: 1px solid var(--qa-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 34px rgba(20, 24, 31, 0.10);
    color: var(--qa-text);
}

.completion-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    max-width: min(640px, 86vw);
    z-index: 1000;
}

.smooth-state-card h2,
.completion-message h2 {
    margin: 0 0 0.75rem;
    color: var(--qa-text);
    font-size: 1.8rem;
}

.smooth-state-card p,
.completion-message p {
    margin: 0 0 2rem;
    color: var(--qa-muted);
    line-height: 1.6;
}

.smooth-state-card p:last-child {
    margin-bottom: 0;
}

.smooth-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: min(360px, calc(100vw - 40px));
    padding: 14px 18px;
    border: 1px solid var(--qa-success-border);
    border-radius: 6px;
    background: var(--qa-success-bg);
    color: var(--qa-success-text);
    box-shadow: 0 10px 28px rgba(20, 24, 31, 0.14);
    font-weight: 600;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-4px);
}

.smooth-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.smooth-toast.is-clickable {
    cursor: pointer;
}

@keyframes smoothGradientDrift {
    from {
        background-position: 0% 50%;
    }
    to {
        background-position: 100% 50%;
    }
}

@keyframes smoothNoiseDrift {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-3%, 2%, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-container::before,
    .login-container::after,
    .top-bar::before {
        animation: none;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}

@media (max-width: 1200px) {
    .top-bar-actions {
        margin-left: auto;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
    }

    .top-bar {
        align-items: stretch;
        flex-shrink: 0;
        gap: 8px;
    }

    .top-bar-actions {
        margin-left: 0;
    }

    .action-btn {
        max-width: none;
    }

    .message {
        max-width: 86%;
    }

    .main-content {
        flex: none;
        flex-direction: column;
        overflow: visible;
    }

    .left-panel,
    .chat-panel,
    .right-panel {
        width: 100%;
        height: auto;
        flex: none;
    }

    .left-panel {
        overflow-y: visible;
    }

    .chat-panel {
        min-height: 70vh;
    }

    .chat-messages {
        height: auto;
        min-height: 50vh;
        max-height: 65vh;
    }

    .right-panel {
        min-height: 70vh;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 24px;
    }

    .company-logo h1 {
        font-size: 2em;
    }

    .smooth-state-card,
    .completion-message {
        padding: 2rem 1.25rem;
    }
}

/* ================================
   QA SITE LAYOUT REFRESH
   ================================ */

.main-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--qa-bg);
}

.left-panel,
.chat-panel,
.right-panel {
    min-height: 0;
    background: var(--qa-bg);
}

.left-panel {
    flex: 1 1 0;
    width: auto;
    min-width: 240px;
    max-width: none;
    padding: 20px;
    border-right: 1px solid var(--qa-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.chat-panel {
    flex: 2 1 0;
    min-width: 300px;
    border-left: 0;
    border-right: 0;
    background: var(--qa-bg);
}

.right-panel {
    flex: 1 1 0;
    width: auto;
    min-width: 240px;
    padding: 15px;
    border-left: 1px solid var(--qa-border);
    display: grid;
    grid-template-rows: minmax(0, 2fr) minmax(220px, 3fr);
    gap: 15px;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.top-bar {
    position: relative;
}

.agent-status {
    gap: 8px;
}

.logout-btn,
.action-btn,
.smooth-action-btn {
    text-transform: uppercase;
}

.report-btn {
    background: #e0e0e0;
    border-color: #c8c8c8;
    color: #333;
}

.report-btn:hover {
    background: #d4d4d4;
    border-color: #bdbdbd;
    color: #222;
}

.top-bar-actions {
    position: absolute;
    left: var(--top-actions-left, 75%);
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-header {
    margin-bottom: 10px;
}

.company-header h3 {
    font-size: 1.2em;
    margin-bottom: 2px;
}

.company-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.company-header a {
    color: inherit;
    text-decoration: none;
}

.company-header a:hover {
    text-decoration: none;
}

.company-shopify-badge {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    line-height: 1;
}

.company-shopify-logo {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

#dynamic-guidelines-container,
#dynamic-notes-container {
    margin-bottom: 12px;
}

.guidelines-section,
.notes-section {
    font-family: inherit;
    font-size: 12px;
    background: var(--qa-yellow-soft);
    border: 1px solid #ffe58f;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
}

.guidelines-header,
.notes-header {
    display: flex;
    align-items: center;
    font-size: inherit;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--qa-text);
}

.guidelines-header .icon-small,
.notes-header .icon-small {
    margin-right: 8px;
    width: 12px;
    height: 12px;
    color: #d4841c;
}

.guidelines-list,
.notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guidelines-list li,
.notes-list li {
    margin-bottom: 2px;
    font-size: inherit;
    font-weight: 400;
    color: var(--qa-muted);
    position: relative;
    padding-left: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.guidelines-list li:last-child,
.notes-list li:last-child {
    margin-bottom: 0;
}

.guidelines-list li::before,
.notes-list li::before {
    content: "\2022";
    color: #888;
    font-weight: 700;
    position: absolute;
    left: 0;
}

.guidelines-sublist {
    list-style: none;
    margin: 2px 0 0 0;
    padding: 0;
}

.guidelines-sublist li {
    margin-bottom: 2px;
    padding-left: 14px;
    color: var(--qa-muted);
}

.guidelines-sublist li::before {
    content: "\279C";
    color: #888;
    font-weight: 700;
    position: absolute;
    left: 0;
}

.agent-profile {
    margin-top: 12px;
    margin-bottom: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--qa-border-soft);
}

.agent-profile p,
.agent-meta-row {
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.agent-meta-row {
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.agent-meta-left {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.agent-tone-inline,
.tone-tag {
    background: #4a4a4a;
    color: #fff;
    border: 1px solid #3b3b3b;
    border-radius: 6px;
    padding: 2px 8px;
    font-weight: 600;
    font-size: 0.82em;
    white-space: nowrap;
    margin-left: auto;
    transition: none;
    cursor: default;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 0;
    max-height: none;
    min-height: 0;
}

.chat-messages > .message,
.chat-messages > .system-message {
    margin: 0 !important;
}

.message {
    margin: 0;
    padding: 11px 16px;
    border-radius: 6px;
    max-width: 76%;
    line-height: 1.5;
    box-shadow: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: left;
}

.message-content {
    flex: 1;
    min-width: 0;
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: left;
    align-items: flex-start;
}

.message.has-date-time .message-content {
    padding-top: 19px;
}

.message-content p {
    margin: 0 0 5px;
    font-size: 13px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

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

.message.received {
    background: #f1f3f6;
    border: 1px solid #dbe1e8;
    align-self: flex-start;
}

.message.sent,
.message.agent {
    background: var(--qa-yellow-soft);
    border: 1px solid var(--qa-yellow-border);
    align-self: flex-end;
}

.message.system {
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    align-self: flex-end;
}

.message.sent.system-message {
    background: var(--qa-surface) !important;
    border: 1px solid var(--qa-border);
}

.message.center-system-note {
    align-self: center;
    max-width: 88%;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 2px 6px;
}

.message.center-system-note .message-content {
    align-items: center;
    text-align: center;
    background: transparent !important;
}

.message.center-system-note .message-content p {
    color: #666;
    font-size: 11px;
    margin: 0;
}

.message-sender-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 0;
    color: var(--qa-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    align-self: center;
}

.message.agent .message-sender-icon,
.message.sent .message-sender-icon,
.message-sender-icon.self {
    background: #dcf8c6;
    color: var(--qa-text);
}

.message.center-system-note .message-sender-icon {
    display: none;
}

.message .timestamp {
    font-size: 0.7em;
    color: #999;
    margin-top: 5px;
    display: block;
}

.message-date-time {
    position: absolute;
    top: 14px;
    left: 16px;
    display: block;
    width: max-content;
    max-width: calc(100% - 32px);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    color: #6b7280;
    pointer-events: none;
    overflow: visible;
}

.chat-input-area {
    padding: 12px 20px 20px;
    border-top: 0;
    background: var(--qa-bg);
}

#chatInput {
    border: 1px solid var(--qa-border);
    border-radius: 6px;
    background: var(--qa-surface);
    color: var(--qa-text);
    box-shadow: none;
}

#sendButton {
    border-radius: 50%;
}

.right-panel-scroll,
.customer-info-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    gap: 10px;
}

.empty-info-row {
    padding: 8px 12px;
    color: var(--qa-muted);
    font-size: 0.85em;
    font-style: italic;
}

.coupon-codes-block {
    margin-top: 12px;
    margin-bottom: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

.coupon-codes-block #couponCodesContainer {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.coupon-code-card {
    background: #f2f4f7;
    border: 1px solid var(--qa-border);
    border-radius: 6px;
    padding: 4px 8px;
    margin-bottom: 4px;
}

.coupon-code-card:last-child {
    margin-bottom: 0;
}

.coupon-code-header {
    margin-bottom: 4px;
}

.coupon-code-card > .coupon-code-header:last-child {
    margin-bottom: 0;
}

.coupon-code-title-wrap {
    min-width: 0;
}

.coupon-code-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.coupon-code-title {
    color: var(--qa-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.coupon-code-title:hover {
    color: var(--qa-link-hover);
    text-decoration: none;
}

.coupon-code-status {
    flex-shrink: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.coupon-code-status--active {
    background: var(--qa-success-bg);
    border-color: var(--qa-success-border);
    color: var(--qa-success-text);
}

.coupon-code-status--inactive {
    background: #fde8e8;
    border-color: #f3b6b6;
    color: #8a2c2c;
}

.coupon-code-line {
    color: var(--qa-muted);
    font-size: 11px;
    line-height: 1.35;
    margin-bottom: 2px;
    overflow-wrap: anywhere;
}

.coupon-code-line:last-child {
    margin-bottom: 0;
}

.right-panel-templates,
.templates-panel {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    background: transparent;
    border-top: 0;
}

.templates-panel.expanded {
    position: static;
    inset: auto;
    z-index: auto;
    flex: 1;
    background: transparent;
}

.templates-panel.expanded .templates-content {
    max-height: none;
}

.customer-info-panel.hidden {
    display: none;
}

.info-block,
.panel-block,
.templates-block {
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    border-radius: 6px;
    box-shadow: none;
    margin-bottom: 10px;
    overflow: hidden;
}

.customer-info-panel > .info-block,
.customer-info-panel > .panel-block,
.right-panel-scroll > .info-block,
.right-panel-scroll > .panel-block {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.templates-block {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    margin-bottom: 0;
}

.right-panel-scroll .info-block:last-child,
.right-panel-scroll .panel-block:last-child {
    margin-bottom: 0;
}

#ordersSection.panel-block {
    background: var(--qa-surface);
    border: 1px solid var(--qa-border);
    margin-bottom: 10px;
}

#ordersSection .info-block-header,
.info-block-header {
    padding: 8px 12px;
    font-weight: 600;
    margin-bottom: 0;
    border: 0;
    border-bottom: 1px solid var(--qa-border-soft);
    border-radius: 6px;
    background: var(--qa-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: var(--qa-text);
}

.info-block-header span:first-child {
    display: flex;
    align-items: center;
}

.info-block-header .icon-small {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    color: #666;
    stroke-width: 1.8;
}

.info-list {
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #2d3748;
}

.info-list li.browsing-history-row {
    align-items: center;
    gap: 10px;
}

.empty-info-row,
.info-list li.empty-info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    text-align: center;
    color: var(--qa-muted);
    font-size: 0.85em;
    font-style: italic;
    line-height: 1.2;
}

.order-history-list li.order-list-item {
    display: block;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-history-list li.order-list-item .order-card {
    margin: 0;
}

.order-history-list li.order-list-item:last-child {
    border-bottom: 0;
}

.empty-info-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
}

.info-list li:last-child {
    border-bottom: 0;
}

.browsing-history-name {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.browsing-history-meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

.browsing-history .time-ago {
    color: #6b7280;
    font-size: 0.95em;
    margin: 0;
    white-space: nowrap;
    flex: 0 0 auto;
    align-self: center;
}

.browsing-history .icon-small {
    color: #888;
    width: 12px;
    height: 12px;
    min-width: 12px;
    flex: 0 0 12px;
    margin-right: 0;
    align-self: center;
}

.browsing-history-link {
    display: inline;
    text-align: left;
}

.templates-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: none;
    overflow: hidden;
    order: 0;
}

.templates-header {
    order: 0;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--qa-border-soft);
}

.search-templates {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--qa-border-soft);
}

.search-templates .icon-small {
    display: none;
}

#templateSearch {
    width: 100%;
    padding: 8px 12px 8px 38px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: var(--qa-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 14px 14px;
    font-family: inherit;
}

#templateItems {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    background: var(--qa-bg);
    padding: 5px;
}

.template-item,
.template-item.global-template {
    padding: 12px 14px;
    border: 1px solid var(--qa-border);
    margin: 0 0 10px;
    background: var(--qa-surface);
    border-radius: 6px;
    box-shadow: none;
    min-width: 0;
    overflow-wrap: anywhere;
}

.template-item.global-template {
    background: var(--qa-yellow-soft);
    border-left: 1px solid var(--qa-border);
}

.template-item:hover,
.template-item:focus {
    background: var(--qa-surface);
}

.template-item.global-template:hover,
.template-item.global-template:focus {
    background: var(--qa-yellow-soft);
}

.template-shortcut,
mark {
    border-radius: 6px;
}

.promotions-section {
    background: #efefef;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: #111;
    margin-bottom: 10px;
    padding: 10px 12px;
}

.promotions-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.promotions-icon {
    position: static;
    width: 36px;
    height: 36px;
    background: transparent;
    border-radius: 50%;
}

.promotions-info,
.promotions-description {
    margin-left: 0;
    min-width: 0;
}

.promotions-description {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.promotions-description .promotions-description-row {
    position: relative;
    margin: 0 0 3px;
    padding: 0 0 0 12px;
    border-top: 0;
    font-size: 11px;
    line-height: 1.35;
}

.promotions-description .promotions-description-row::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: #555;
    font-weight: 700;
}

.promotions-description .promotions-description-row:last-child {
    margin-bottom: 0;
}

.active-badge,
.coupon-status {
    border-radius: 6px;
}

.coupon-card,
.order-card {
    background: var(--qa-surface);
}

.order-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 8px 12px;
}

.order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
    min-width: 0;
}

.order-heading {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.order-number {
    display: inline;
    color: var(--qa-link);
    font-size: inherit;
    font-weight: 500;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: left;
}

.order-number::before {
    content: "Order ";
    font-weight: inherit;
}

.order-meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

.order-date {
    color: #6b7280;
    font-size: 0.95em;
    font-weight: 400;
    line-height: 1.2;
}

.order-expand-icon {
    color: #888;
    width: 12px;
    height: 12px;
    min-width: 12px;
    flex: 0 0 12px;
    margin-right: 0;
    align-self: center;
}

.order-details {
    margin-top: 10px;
}

.order-summary-title,
.order-meta-row,
.order-item-name,
.order-item-price,
.order-subtotal {
    font-size: inherit;
}

.order-item:has(+ .order-subtotal) {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.order-subtotal {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--qa-border-soft);
}

.message-media img,
.smooth-state-card,
.completion-message,
.smooth-toast,
.login-box,
.login-form-group input,
.google-signin-btn,
.login-btn,
.logout-btn,
.action-btn,
.smooth-action-btn,
.scenario-dropdown,
.error-message,
.status-indicator,
.offer-status,
.coupon-code-card {
    border-radius: 6px;
}

@media (max-width: 768px) {
    .main-content {
        flex: none;
        flex-direction: column;
        overflow: visible;
    }

    .left-panel,
    .chat-panel,
    .right-panel {
        width: 100%;
        height: auto;
        flex: none;
    }

    .left-panel {
        overflow-y: visible;
    }

    .right-panel {
        display: flex;
        min-height: 70vh;
    }

    .chat-panel {
        min-height: 70vh;
    }

    .chat-messages {
        height: auto;
        min-height: 50vh;
        max-height: 65vh;
    }
}
