/**
 * CityOS Portal - Custom Styles
 *
 * Brand palette: single source of truth. Change these to rebrand.
 * Email templates (HTML emails) cannot use CSS variables; keep their hex
 * in sync with --brand-primary etc. when you change colors here.
 */
:root {
    --brand-primary: #2563eb;
    --brand-secondary: #3b82f6;
    --brand-dark: #1e3a8a;
    --brand-heading: #1e293b;
    --brand-gradient-start: #1e3a8a;
    --brand-gradient-end: #2563eb;
    --brand-shadow-rgb: 37, 99, 235;
    --brand-bg-light: #eff6ff;
}

/* Override cityos theme: violet → blue (main page color) */
:root,
[data-bs-theme="light"] {
    --bs-primary: var(--brand-primary);
    --bs-primary-rgb: var(--brand-shadow-rgb);
    --bs-secondary: var(--brand-secondary);
    --bs-secondary-rgb: 59, 130, 246;
    --bs-indigo: var(--brand-primary);
    --bs-accent: var(--brand-primary);
    --bs-accent-rgb: var(--brand-shadow-rgb);
    --bs-code-color: var(--brand-primary);
}

[data-bs-theme="dark"] {
    --bs-primary: #3b82f6;
    --bs-secondary: #60a5fa;
    --bs-code-color: #60a5fa;
}

/* Force primary buttons and dropdowns to brand blue (merchant/portal) */
.portal-body .btn-primary,
.portal-body .btn-primary:hover,
.portal-body .btn-primary:focus,
.portal-body .btn-primary:active,
.portal-body .btn-primary.show,
.portal-body .btn-primary:first-child:active {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}
.portal-body .btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}
.portal-body .btn-primary:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(var(--brand-shadow-rgb), 0.5);
}

.portal-body .btn-outline-primary,
.portal-body .btn-outline-primary:hover,
.portal-body .btn-outline-primary:focus,
.portal-body .btn-outline-primary:active,
.portal-body .btn-outline-primary.active {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}
.portal-body .btn-outline-primary:hover,
.portal-body .btn-outline-primary:focus,
.portal-body .btn-outline-primary:active,
.portal-body .btn-outline-primary.active {
    background-color: var(--brand-primary);
    color: #fff;
}
.portal-body .btn-outline-primary:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(var(--brand-shadow-rgb), 0.5);
}

code {
    color: var(--bs-code-color);
}

/* Brand utility classes (use in templates instead of inline hex) */
.text-brand-primary { color: var(--brand-primary) !important; }
.text-brand-heading { color: var(--brand-heading) !important; }
.bg-brand-primary { background-color: var(--brand-primary) !important; }
.bg-brand-secondary { background-color: var(--brand-secondary) !important; }
.bg-brand-light { background-color: var(--brand-bg-light) !important; }
.border-brand-primary { border-color: var(--brand-primary) !important; }
.bg-brand-primary-subtle { background-color: rgba(var(--brand-shadow-rgb), 0.1) !important; }

/* Also style code in pre blocks */
pre code {
    color: inherit;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.hover:hover {
    cursor: pointer !important;
}

.hover-bg-light:hover {
    background-color: var(--bs-gray-100) !important;
}

.b2t {
    position: fixed !important;
    bottom: 21px;
    right: 21px;
    z-index: 99;
    opacity: 0.6;
    display: none;
}

.b2t:hover {
    background-color: var(--bs-secondary);
}

/* Prevent text selection utility class */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.no-select * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ==========================================
   PORTAL LAYOUT VARIABLES
   ========================================== */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 64px;
    --sidebar-bg-start: var(--brand-dark);
    --sidebar-bg-end: #1d4ed8;
    --sidebar-text: #a0aec0;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
    --portal-bg: #f0f9ff;
    --card-shadow: 0 1px 3px rgba(var(--brand-shadow-rgb), 0.08);
    --card-shadow-hover: 0 4px 12px rgba(var(--brand-shadow-rgb), 0.12);
}

/* ==========================================
   PORTAL BODY
   ========================================== */

body.portal-body {
    background-color: var(--portal-bg);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
}

.portal-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.portal-sidebar.collapsed .sidebar-text,
.portal-sidebar.collapsed .sidebar-section-title,
.portal-sidebar.collapsed .sidebar-toggle-text,
.portal-sidebar.collapsed .sidebar-brand-text,
.portal-sidebar.collapsed .sidebar-merchant-info {
    display: none;
}

.portal-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.portal-sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
}

/* Sidebar Brand */
.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.portal-sidebar.collapsed .sidebar-brand {
    padding: 1.25rem 0.75rem;
    justify-content: center;
}

.portal-sidebar.collapsed .sidebar-brand-icon {
    margin-right: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-active-bg);
}

.sidebar-nav .nav-link.active {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-active-bg);
    border-left-color: #3b82f6;
}

.sidebar-nav .nav-link i {
    margin-right: 0.75rem;
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

.sidebar-section-title {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: color 0.2s;
    border-radius: 0.5rem;
}

.sidebar-toggle:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-active-bg);
}

.sidebar-toggle i {
    margin-right: 0.75rem;
    transition: transform 0.3s;
}

.portal-sidebar.collapsed .sidebar-toggle {
    justify-content: center;
    padding: 0.5rem;
}

.portal-sidebar.collapsed .sidebar-toggle i {
    margin-right: 0;
    transform: rotate(180deg);
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 14, 44, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Sidebar Dropdown Submenu */
.sidebar-nav .dropdown-menu {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

.sidebar-nav .dropdown-item {
    color: var(--sidebar-text);
    padding: 0.5rem 1.5rem 0.5rem 3.5rem;
}

.sidebar-nav .dropdown-item:hover {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-hover);
}

.sidebar-nav .dropdown-toggle::after {
    margin-left: auto;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */

.portal-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.portal-main.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* ==========================================
   TOPBAR
   ========================================== */

.portal-topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #EEEDF5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1020;
}

.topbar-search {
    position: relative;
}

.topbar-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9994B3;
}

.topbar-search input {
    padding-left: 2.5rem;
    width: 280px;
    border: 1px solid #EEEDF5;
    background: #F8F7FC;
    transition: all 0.2s;
}

.topbar-search input:focus {
    background: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(139, 126, 200, 0.1);
}

/* User Dropdown */
.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Avatar Circle Styles */
.avatar-circle {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.avatar-circle-lg {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.75rem;
    flex-shrink: 0;
}

/* ==========================================
   CONTENT AREA
   ========================================== */

.portal-content {
    padding: 1.5rem;
}

/* ==========================================
   PORTAL CARDS
   ========================================== */

.portal-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    border: none;
}

.portal-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #EEEDF5;
    background: transparent;
}

.portal-card-body {
    padding: 1.5rem;
}

/* ==========================================
   STATS CARDS
   ========================================== */

.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: #6E6892;
}

/* ==========================================
   CHAT INTERFACE - SHARED STYLES
   ========================================== */

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height) - 3rem);
    max-height: 800px;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #EEEDF5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
}

.chat-header-title {
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    font-size: 1rem;
}

.chat-header-subtitle {
    font-size: 0.8125rem;
    color: #6E6892;
    margin: 0;
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Merchant Selector in Header */
.merchant-selector {
    min-width: 200px;
}

.merchant-selector .form-select {
    border-color: #EEEDF5;
    font-size: 0.875rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
}

.merchant-selector .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(139, 126, 200, 0.1);
}

/* Conversation Selector */
.conversation-selector {
    padding: 0.75rem 1.5rem;
    background: #F8F7FC;
    border-bottom: 1px solid #EEEDF5;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.conversation-selector label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6E6892;
    margin: 0;
    white-space: nowrap;
}

.conversation-selector .form-select {
    flex: 1;
    min-width: 180px;
    font-size: 0.875rem;
    border-color: #DEDCE8;
}

.conversation-selector .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(139, 126, 200, 0.1);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #FAFAFA;
}

/* Individual Chat Bubble */
.chat-bubble {
    max-width: 75%;
    padding: 0.875rem 1.125rem;
    border-radius: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
    opacity: 0;
    transform: translateY(8px);
    animation: bubbleFadeIn 0.3s ease forwards;
    position: relative;
}

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

/* User Message Bubble */
.chat-bubble.user {
    background: linear-gradient(135deg, #E8E5F5 0%, #F0EDF8 100%);
    color: #1e293b;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* AI Message Bubble */
.chat-bubble.ai {
    background: #fff;
    color: #030303;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.06);
}

.chat-bubble .sender-name {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
    display: block;
}

.chat-bubble.user .sender-name {
    color: #2563eb;
}

.chat-bubble.ai .sender-name {
    color: #1e293b;
}

.chat-bubble .message-text {
    font-size: 0.9375rem;
}

.chat-bubble .message-text a {
    color: #2563eb;
    text-decoration: underline;
}

.chat-bubble .message-text a:hover {
    color: #1e293b;
}

/* Message Timestamp */
.chat-bubble .message-time {
    font-size: 0.6875rem;
    opacity: 0.6;
    margin-top: 0.375rem;
}

.chat-bubble.user .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Result Cards (Venues, Events, Promotions) */
.result-card {
    background: #fff;
    border: 1px solid #EEEDF5;
    border-radius: 0.625rem;
    padding: 0.875rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.04);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
}

.result-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.result-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.result-card p {
    margin: 0.25rem 0;
}

.result-card a {
    color: #2563eb;
}

.result-card a:hover {
    color: #1e293b;
}

/* Chat Input Area */
.chat-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid #EEEDF5;
    background: #fff;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 1px solid #DEDCE8;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(139, 126, 200, 0.1);
}

.chat-input::placeholder {
    color: #9994B3;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(82, 53, 208, 0.3);
}

.chat-send-btn:active {
    transform: scale(0.98);
}

.chat-send-btn i {
    font-size: 1.125rem;
}

/* Chat Footer Hint */
.chat-footer-hint {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: #9994B3;
    background: #F8F7FC;
}

/* ==========================================
   MESSAGE ACTIONS (Report Button)
   ========================================== */

.message-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.report-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    border: 1px solid #D64161;
    border-radius: 0.375rem;
    background: transparent;
    color: #D64161;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.report-btn:hover {
    background: #D64161;
    color: #fff;
}

.report-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reported-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    border-radius: 0.375rem;
    background: #FDEAED;
    color: #D64161;
    font-weight: 600;
}

/* ==========================================
   STAFF BADGE
   ========================================== */

.staff-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.staff-badge.admin {
    background: linear-gradient(135deg, #D4A017 0%, #E0B03E 100%);
    color: #000;
}

.staff-badge.staff {
    background: linear-gradient(135deg, #5B8DEE 0%, #7AA3F5 100%);
    color: #fff;
}

/* ==========================================
   EMPTY STATE
   ========================================== */

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    color: #6E6892;
}

.chat-empty-state i {
    font-size: 3rem;
    color: #C4C1D4;
    margin-bottom: 1rem;
}

.chat-empty-state h5 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.chat-empty-state p {
    font-size: 0.9375rem;
    max-width: 300px;
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */

@media (max-width: 991.98px) {
    .portal-sidebar {
        transform: translateX(-100%);
    }

    .portal-sidebar.show {
        transform: translateX(0);
    }

    .portal-main {
        margin-left: 0;
    }

    .portal-main.sidebar-collapsed {
        margin-left: 0;
    }

    .topbar-search {
        display: none !important;
    }

    .chat-container {
        height: calc(100vh - var(--topbar-height) - 2rem);
        max-height: none;
        border-radius: 0.5rem;
    }

    .chat-bubble {
        max-width: 85%;
    }

    .conversation-selector {
        flex-wrap: wrap;
    }

    .merchant-selector {
        min-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .portal-content {
        padding: 1rem;
    }

    .chat-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .chat-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .chat-messages {
        padding: 1rem;
    }

    .chat-input-area {
        padding: 0.875rem 1rem;
    }

    .conversation-selector {
        padding: 0.625rem 1rem;
        gap: 0.5rem;
    }
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #DEDCE8;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #C4C1D4;
}

/* ==========================================
   REPORT MODAL OVERRIDES
   ========================================== */

.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.2);
}

.modal-header {
    border-bottom-color: #EEEDF5;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: #1e293b;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top-color: #EEEDF5;
    padding: 1rem 1.5rem;
}

/* ==========================================
   KEYBOARD HINTS
   ========================================== */

.keyboard-hints {
    font-size: 0.75rem;
    color: #9994B3;
    margin-top: 0.5rem;
    text-align: center;
}

.keyboard-hints kbd {
    background: #EEEDF5;
    color: #6E6892;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-family: inherit;
}

/* =============================================================================
   Sidebar Badge Styles
   ============================================================================= */

/* Sidebar badge for pending counts */
.sidebar-badge {
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    transition: opacity 0.2s ease;
}

/* When sidebar is collapsed, hide badge text but keep indicator */
.portal-sidebar.collapsed .sidebar-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 8px;
    width: 8px;
    height: 8px;
    padding: 0;
    font-size: 0;
    border-radius: 50%;
}

/* Badge pulse animation for new items */
@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.sidebar-badge.pulse {
    animation: badge-pulse 2s infinite;
}

/* Ensure nav link can accommodate badge properly */
.portal-sidebar .nav-link {
    display: flex;
    align-items: center;
    position: relative;
}

/* Push badge to the right */
.portal-sidebar .nav-link .sidebar-badge {
    margin-left: auto;
}

/* =============================================================================
   Pending Approval List Styles
   ============================================================================= */

/* Table improvements for approval list */
.table-hover tbody tr:hover {
    background-color: rgba(82, 53, 208, 0.05);
}

/* Action button group */
.table .btn-group .btn {
    padding: 0.25rem 0.5rem;
}

/* Modal improvements */
.modal-header {
    border-bottom: 1px solid #eee;
}

.modal-footer {
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

/* Alert within modals */
.modal-body .alert {
    margin-bottom: 1rem;
}

/* Schedule badge in table */
.table .badge {
    font-weight: 500;
}

/* =============================================================================
   Dashboard Goal Metric Cards
   ============================================================================= */

.goal-metric-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
    height: 100%;
}

.goal-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(139, 126, 200, 0.2);
}

.goal-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goal-value {
    color: #1e293b;
    font-weight: 700;
}

.goal-label {
    font-size: 0.8125rem;
}

/* Stat card description */
.stat-description {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Goal progress indicator animation */
@keyframes goalPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.goal-value.highlight {
    animation: goalPulse 0.5s ease-in-out;
}

/* Win-back alert styling */
.goal-metric-card.attention {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%) !important;
    border-color: rgba(212, 160, 23, 0.3);
}

/* Success metric styling */
.goal-metric-card.success {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%) !important;
    border-color: rgba(46, 158, 110, 0.3);
}

/* Responsive adjustments for goal cards */
@media (max-width: 767.98px) {
    .goal-metric-card {
        margin-bottom: 1rem;
    }
    
    .goal-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    
    .goal-value {
        font-size: 1.25rem !important;
    }
}

/* Dashboard empty state for metrics */
.metric-empty-state {
    text-align: center;
    padding: 2rem;
    color: #6E6892;
}

.metric-empty-state i {
    font-size: 2.5rem;
    color: #C4C1D4;
    margin-bottom: 0.75rem;
}

.metric-empty-state p {
    margin: 0;
    font-size: 0.875rem;
}

/* =============================================================================
   AI Assistant Card (Dashboard)
   ============================================================================= */

/* Collapse icon rotation */
.portal-card-header .collapse-icon {
    transition: transform 0.3s ease;
    font-size: 0.875rem;
    color: #6E6892;
}

.portal-card-header[aria-expanded="false"] .collapse-icon {
    transform: rotate(-90deg);
}

/* Clickable header styling */
.portal-card-header[data-bs-toggle="collapse"] {
    user-select: none;
}

.portal-card-header[data-bs-toggle="collapse"]:hover {
    background-color: rgba(139, 126, 200, 0.05);
}

/* Assistant avatar */
.assistant-avatar {
    transition: transform 0.2s ease;
}

.assistant-avatar:hover {
    transform: scale(1.05);
}

/* Quick shortcut buttons */
.portal-card .btn-outline-secondary {
    border-color: #d1cde4;
    color: #4a4564;
}

.portal-card .btn-outline-secondary:hover {
    background-color: #1e293b;
    border-color: #1e293b;
    color: #fff;
}

/* =============================================================================
   Notification Badge Styles
   ============================================================================= */

/* Adjust notification badge position to prevent being cut off */
#notificationBadge {
    top: 0.25rem !important;
}