/* ==========================================================================
   Collection House BD (Collection House BD) Panel Premium CSS Design System
   ========================================================================== */

/* Design Tokens & Theme Variables */
 :root {
    --primary-color: #b91c1c;
    --primary-hover: #991b1b;
    --primary-light: #fff7ed;
    --primary-glow: rgba(185, 28, 28, 0.18);

    --bg-color: #f5f1e8;
    --panel-bg: #fffdf8;
    --sidebar-bg: #111111;

    --text-color: #171717;
    --text-muted: #6b6258;
    --text-light: #a39a90;

    --border-color: #e7ded2;
    --border-hover: #d6c7b8;

    --accent-green: #15803d;
    --accent-green-bg: #f0fdf4;
    --accent-red: #dc2626;
    --accent-red-bg: #fef2f2;
    --accent-orange: #d97706;
    --accent-orange-bg: #fffbeb;
    --accent-blue: #2563eb;
    --accent-blue-bg: #eff6ff;
    --accent-purple: #7c3aed;
    --accent-purple-bg: #f5f3ff;
    --accent-grey: #57534e;
    --accent-grey-bg: #f5f5f4;

    --font-bn: 'Anek Bangla', sans-serif;
    --font-en: 'Outfit', sans-serif;

    --shadow-sm: 0 1px 2px rgba(17,17,17,.06);
    --shadow-md: 0 8px 20px rgba(17,17,17,.08);
    --shadow-lg: 0 20px 45px rgba(17,17,17,.13);
    --shadow-glow: 0 0 22px rgba(185,28,28,.12);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    --transition: all .25s cubic-bezier(.4,0,.2,1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

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

/* Language Selection System (Dynamic Display) */
body.lang-bn {
    font-family: var(--font-bn);
    line-height: 1.6;
}
body.lang-bn .en-text {
    display: none !important;
}

body.lang-en {
    font-family: var(--font-en);
    line-height: 1.5;
}
body.lang-en .bn-text {
    display: none !important;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* App Container Layout */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
    background-color: var(--sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: #f5e7d0;
    animation: pulse 2s infinite;
}

.brand-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff7ed, #d6b98c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.menu-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(185, 28, 28, 0.28);
}

.menu-badge {
    margin-left: auto;
    background-color: var(--accent-red);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    padding: 0 5px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.menu-icon {
    width: 20px;
    height: 20px;
}

/* Sidebar Footer & User Profile Dropdown */
.sidebar-footer {
    position: relative;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile-menu-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.user-profile-menu-trigger:hover,
.user-profile-menu-trigger.active {
    background-color: rgba(255, 255, 255, 0.05);
}

.user-meta-details-sidebar {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex: 1;
    overflow: hidden;
}

.user-profile-name-sidebar {
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-profile-role-sidebar.badge {
    font-size: 9px;
    padding: 1px 6px;
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-top: 2px;
    display: inline-block;
    width: max-content;
    text-align: center;
}

.user-profile-role-sidebar.badge.owner { background-color: var(--accent-red-bg); color: var(--accent-red); }
.user-profile-role-sidebar.badge.admin { background-color: var(--accent-blue-bg); color: var(--accent-blue); }
.user-profile-role-sidebar.badge.staff { background-color: var(--accent-green-bg); color: var(--accent-green); }

.profile-dots-icon {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    transition: var(--transition);
}

.user-profile-menu-trigger:hover .profile-dots-icon,
.user-profile-menu-trigger.active .profile-dots-icon {
    color: #ffffff;
}

/* Dropdown Menu - Expanding Upwards */
.profile-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    background-color: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.dropdown-item.logout-btn-item {
    color: #f87171;
}

.dropdown-item.logout-btn-item:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.dropdown-icon {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Main Content Shell
   ========================================================================== */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.header {
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.view-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.system-clock {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-en);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--panel-bg);
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.system-clock:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.clock-icon {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

/* Language Toggle Switch styling */
.language-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--panel-bg);
    padding: 0 16px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.language-toggle-wrapper:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.lang-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

body.lang-bn #lang-bn-label {
    color: var(--primary-color);
}

body.lang-en #lang-en-label {
    color: var(--primary-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* View Container */
.view-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    min-height: 0;
}

/* Loading Spinner */
.loader-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(248, 250, 252, 0.7);
    z-index: 100;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   Dashboard Page Elements
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-info h3 {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
}

.stat-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
}

.stat-icon {
    width: 26px;
    height: 26px;
}

/* Stat card icon background variations */
.stat-card.sms .stat-icon-wrapper { background-color: #eff6ff; color: #2563eb; }
.stat-card.orders .stat-icon-wrapper { background-color: #fffbeb; color: #d97706; }
.stat-card.revenue .stat-icon-wrapper { background-color: #ecfdf5; color: #059669; }
.stat-card.products .stat-icon-wrapper { background-color: #f5f3ff; color: #7c3aed; }

/* Dashboard Recent Grid split */
.dashboard-recent-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

.panel-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

/* ==========================================================================
   Tables Style
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.custom-table th {
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background-color: var(--primary-light);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge.pending { background-color: var(--accent-orange-bg); color: var(--accent-orange); }
.badge.confirmed { background-color: var(--accent-purple-bg); color: var(--accent-purple); }
.badge.processing { background-color: var(--accent-blue-bg); color: var(--accent-blue); }
.badge.completed { background-color: var(--accent-green-bg); color: var(--accent-green); }
.badge.cancelled { background-color: var(--accent-red-bg); color: var(--accent-red); }
.badge.refunded { background-color: var(--accent-grey-bg); color: var(--accent-grey); }

.badge.instock { background-color: var(--accent-green-bg); color: var(--accent-green); }
.badge.outofstock { background-color: var(--accent-red-bg); color: var(--accent-red); }
.badge.lowstock { background-color: var(--accent-orange-bg); color: var(--accent-orange); }

/* ==========================================================================
   Chat Section UI
   ========================================================================== */
.chat-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--panel-bg);
    height: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Chat Sidebar */
.chat-sidebar {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background-color: #fafbfc;
    height: 100%;
    min-height: 0;
}

.chat-search-wrapper {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.chat-search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    background-color: #ffffff;
    transition: var(--transition);
}

.chat-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.chat-list-item:hover {
    background-color: #f1f5f9;
}

.chat-list-item.active {
    background-color: var(--primary-light);
    border-left: 4px solid var(--primary-color);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 16px;
}

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 11px;
    color: var(--text-light);
}

.chat-item-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mode-indicator-badge {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.mode-indicator-badge.ai { background-color: var(--accent-green-bg); color: var(--accent-green); }
.mode-indicator-badge.human { background-color: var(--accent-blue-bg); color: var(--accent-blue); }

/* Chat Logs Pane */
.chat-logs-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    min-height: 0;
}

.chat-logs-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    flex-shrink: 0;
}

.chat-active-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

/* Switch control for AI mode inside Header */
.chat-mode-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-mode-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.chat-mode-label.active {
    color: var(--primary-color);
}

.chat-logs-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.message-bubble-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.message-bubble-wrapper.received {
    align-self: flex-start;
}

.message-bubble-wrapper.sent {
    align-self: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    word-break: break-word;
    box-shadow: var(--shadow-sm);
}

.message-bubble-wrapper.received .message-bubble {
    background-color: #ffffff;
    color: var(--text-color);
    border-top-left-radius: 2px;
    border: 1px solid var(--border-color);
}

.message-bubble-wrapper.sent .message-bubble {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    border-top-right-radius: 2px;
}

.message-timestamp {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 4px;
    padding: 0 4px;
}

.message-bubble-wrapper.received .message-timestamp {
    align-self: flex-start;
}

.message-bubble-wrapper.sent .message-timestamp {
    align-self: flex-end;
}

/* Chat Input Bar */
.chat-input-bar {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: #ffffff;
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.chat-input-text {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    height: 48px;
    transition: var(--transition);
}

.chat-input-text:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.2);
}

.chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(30, 58, 138, 0.3);
}

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

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    background-color: #fafbfc;
}

.chat-empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-light);
    margin-bottom: 16px;
}

/* ==========================================================================
   Product Grid UI
   ========================================================================== */
.view-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.search-filter-bar {
    display: flex;
    gap: 16px;
    flex: 1;
    max-width: 500px;
}

.orders-filters-group {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 280px;
    flex-wrap: wrap;
}

.orders-filters-group .form-input {
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 14px;
    height: 42px;
}

.orders-filters-group input#order-search {
    max-width: 240px;
    flex: 1;
    min-width: 150px;
}

.orders-filters-group select {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
}


.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    background-color: #ffffff;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    border-color: var(--primary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.product-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.product-img-wrapper {
    height: 180px;
    background-color: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.product-card-actions-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(-5px);
    transition: var(--transition);
    z-index: 2;
}

.product-card:hover .product-card-actions-overlay {
    opacity: 1;
    transform: translateY(0);
}

.action-btn-circle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}

.action-btn-circle:hover {
    background-color: #ffffff;
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.action-btn-circle.delete:hover {
    color: var(--accent-red);
}

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

.product-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card-sku {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.product-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 8px;
}

.product-card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.product-card-old-price {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: line-through;
}

.product-card-stock {
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
}

/* ==========================================================================
   Order Management List
   ========================================================================== */
.orders-panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.order-actions-cell {
    display: flex;
    gap: 8px;
}

.order-status-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    background-color: #ffffff;
    cursor: pointer;
    transition: var(--transition);
}

.order-status-select:focus {
    border-color: var(--primary-color);
}

/* ==========================================================================
   FAQ Section UI
   ========================================================================== */
.faq-search-wrapper {
    margin-bottom: 24px;
    max-width: 600px;
}

.faq-list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

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

.faq-question-bar {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: #ffffff;
}

.faq-question-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
}

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

.faq-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.faq-card.open .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer-bar {
    padding: 0 24px 20px 24px;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid #f1f5f9;
    background-color: #fafbfc;
    display: none;
}

.faq-card.open .faq-answer-bar {
    display: block;
    animation: slideDown 0.2s ease-out;
}

/* ==========================================================================
   Settings Interface
   ========================================================================== */
.settings-container {
    max-width: 650px;
}

.settings-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    margin-bottom: 24px;
}

.instruction-box {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.instruction-box h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 8px;
}

.instruction-box ul {
    margin-left: 20px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.6;
}

/* ==========================================================================
   Documentation Interface
   ========================================================================== */
.docs-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
}

.docs-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 220px);
    overflow-y: auto !important;
    scrollbar-width: thin;
    padding-right: 8px;
}

.docs-nav-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-left: 12px;
}

.docs-nav-group {
    margin-bottom: 4px;
}

.docs-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 8px 12px;
    cursor: pointer;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.docs-nav-header:hover {
    background-color: rgba(0,0,0,0.03);
    color: var(--text-color);
}

.docs-nav-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.docs-nav-group.open .docs-nav-chevron {
    transform: rotate(180deg);
}

.docs-nav-items {
    display: none;
    flex-direction: column;
    padding-left: 8px;
    margin-top: 4px;
}

.docs-nav-group.open .docs-nav-items {
    display: flex;
}


.docs-nav-link {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.docs-nav-link:hover {
    background-color: #f1f5f9;
    color: var(--text-color);
}

.docs-nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.docs-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.doc-section {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.doc-section h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.doc-endpoint-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: monospace;
    font-weight: 700;
    margin-bottom: 16px;
}

.doc-endpoint-badge.get { background-color: #ecfdf5; color: #059669; }
.doc-endpoint-badge.post { background-color: #eff6ff; color: #2563eb; }
.doc-endpoint-badge.delete { background-color: #fef2f2; color: #dc2626; }

.doc-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.doc-table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.doc-table th {
    background-color: var(--bg-color);
    padding: 10px 12px;
    font-size: 13px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.doc-table td {
    padding: 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.doc-code-block {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 13px;
    overflow-x: auto;
    position: relative;
    border: 1px solid #1e293b;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5); /* Overlay */
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.modal.open {
    display: flex;
    animation: fadeIn 0.25s ease-out;
}

.modal-content {
    background-color: var(--panel-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 24px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-color);
}

/* ==========================================================================
   Forms and Inputs
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input, 
.form-group textarea, 
.form-group select,
.form-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background-color: #ffffff;
    color: var(--text-color);
    box-sizing: border-box;
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus,
.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
    outline: none;
}

/* Specific styling for select type of form-input */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' 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: right 14px center;
    background-size: 16px;
    padding-right: 40px !important;
    cursor: pointer;
}

/* Drag & Drop Upload */
.drag-drop-area {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    background-color: #fafbfc;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.drag-drop-area:hover {
    border-color: var(--primary-color);
    background-color: #f1f5f9;
}

.drag-icon {
    margin-bottom: 8px;
    color: var(--text-light);
}

.drag-drop-area p {
    font-size: 13px;
    color: var(--text-muted);
}

.drag-drop-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.preview-image-wrapper {
    position: relative;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background-color: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.remove-image-btn:hover {
    background-color: #ef4444;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.15);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(30, 58, 138, 0.25);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background-color: #f1f5f9;
    border-color: var(--border-hover);
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Order items custom builder styles */
.order-item-builder-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    align-items: center;
}

.order-item-builder-row select {
    flex: 2;
}

.order-item-builder-row input {
    flex: 1;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .7; transform: scale(0.95); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* ==========================================================================
   User Profile Details & Team Styles
   ========================================================================== */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 4px 16px 4px 6px;
    border-radius: var(--radius-full);
    height: 40px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.user-profile-badge:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 13px;
}

.user-meta-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.user-profile-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
}

.user-profile-role.badge {
    font-size: 9px;
    padding: 1px 6px;
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-top: 1px;
    display: inline-block;
    text-align: center;
}

/* User Role Color Variations */
.user-profile-role.badge.owner { background-color: var(--accent-red-bg); color: var(--accent-red); }
.user-profile-role.badge.admin { background-color: var(--accent-blue-bg); color: var(--accent-blue); }
.user-profile-role.badge.staff { background-color: var(--accent-green-bg); color: var(--accent-green); }

/* Logout Button Pill Style */
.logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-full);
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.logout-btn:hover {
    background-color: var(--accent-red-bg);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
    box-shadow: var(--shadow-md);
}

.logout-btn svg {
    width: 16px;
    height: 16px;
    transition: var(--transition);
}

.logout-btn:hover svg {
    transform: translateX(2px);
}

.doc-code-inline {
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 12px;
    color: var(--primary-color);
}

/* ==========================================================================
   Developer API Sandbox Console & Try it Out Styles
   ========================================================================== */
.sandbox-card {
    background-color: var(--bg-color);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
}

.sandbox-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.sandbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

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

.sandbox-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.sandbox-input {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-color);
    transition: var(--transition);
    width: 100%;
}

.sandbox-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.sandbox-textarea {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 13px;
    color: var(--text-color);
    font-family: monospace;
    transition: var(--transition);
    resize: vertical;
    width: 100%;
    min-height: 80px;
}

.sandbox-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.sandbox-btn {
    align-self: flex-start;
    display:inline-flex;
    align-items:center;
    gap: 8px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

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

.sandbox-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

.sandbox-response-panel {
    margin-top: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: #0f172a;
    overflow: hidden;
}

.sandbox-response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background-color: #1e293b;
    border-bottom: 1px solid #334155;
}

.sandbox-response-title {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}

.sandbox-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.sandbox-status.success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.sandbox-status.error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.sandbox-response-body {
    padding: 16px;
    margin: 0;
    font-family: monospace;
    font-size: 13px;
    color: #38bdf8;
    overflow-x: auto;
    max-height: 250px;
}

/* ==========================================================================
   Chat Transcript Export Styles
   ========================================================================== */
.chat-export-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.chat-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.chat-export-btn:hover {
    background-color: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chat-export-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    width: 140px;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-export-menu.open {
    display: flex;
}

.chat-export-item {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.chat-export-item:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

/* ==========================================================================
   System Backup and Restore Card Styles
   ========================================================================== */
.backup-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    margin-top: 24px;
}

.backup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .backup-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.backup-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.backup-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.backup-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-color);
    transition: var(--transition);
    position: relative;
}

.backup-dropzone:hover,
.backup-dropzone.dragover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.backup-dropzone-icon {
    width: 36px;
    height: 36px;
    color: var(--text-light);
    margin: 0 auto 12px;
    transition: var(--transition);
}

.backup-dropzone:hover .backup-dropzone-icon {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.backup-dropzone-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.backup-dropzone-subtext {
    font-size: 11px;
    color: var(--text-light);
}

/* ==========================================================================
   Mobile Responsiveness (Max Width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Global Layout */
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 260px;
        transition: left 0.3s ease;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        left: 0;
    }

    .mobile-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
    }

    .mobile-backdrop.open {
        display: block;
    }

    /* Header & Mobile Menu Button */
    .mobile-menu-btn {
        display: block !important;
        background: none;
        border: none;
        color: var(--text-color);
        padding: 8px;
        cursor: pointer;
        margin-right: 12px;
        border-radius: var(--radius-md);
    }

    .mobile-menu-btn svg {
        width: 24px;
        height: 24px;
    }

    .header-left {
        flex-direction: row;
        align-items: center;
    }

    .header-right {
        gap: 8px;
    }

    .view-title {
        font-size: 18px;
    }

    .header {
        padding: 12px 16px;
    }

    /* Dashboard Grids */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    @media (max-width: 480px) {
        .stats-grid {
            grid-template-columns: 1fr;
        }
    }

    .dashboard-recent-grid {
        grid-template-columns: 1fr;
    }

    .panel-card {
        padding: 16px;
    }

    /* Chat Layout */
    .chat-layout {
        grid-template-columns: 1fr;
        overflow: hidden;
        position: relative;
    }

    .chat-sidebar {
        width: 100%;
        border-right: none;
    }

    .chat-logs-pane {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 10;
        background: var(--panel-bg);
    }

    .chat-layout.chat-active .chat-logs-pane {
        transform: translateX(0);
    }

    .mobile-back-btn {
        display: flex !important;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        color: var(--text-color);
        padding: 8px;
        margin-right: 8px;
        cursor: pointer;
    }

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

    /* Chat Header Mobile Fixes */
    .chat-logs-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
        height: auto;
    }

    .chat-logs-header > div:first-child {
        width: 100%;
    }

    .chat-logs-header > div:last-child {
        width: 100%;
        justify-content: space-between;
    }

    .chat-active-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 80px); /* Leave room for back button */
        font-size: 15px;
    }

    .chat-export-btn span {
        display: none; /* Hide 'Export Chat' text on mobile */
    }

    .chat-export-btn {
        padding: 8px; /* Make it square with just the icon */
    }

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

    .chat-input-text {
        height: 40px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .chat-send-btn {
        width: 40px;
        height: 40px;
    }

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

    /* Hide the main header when actively chatting to maximize space */
    .main-content:has(.chat-layout.chat-active) .header {
        display: none;
    }

    /* Tables */
    .custom-table th, .custom-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .view-header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-box {
        max-width: none;
        width: 100%;
    }

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

/* Hide mobile elements by default on desktop */
.mobile-menu-btn, .mobile-backdrop, .mobile-back-btn {
    display: none;
}

/* Premium Pagination Styles */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border-radius: var(--radius-md, 6px);
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover:not([disabled]) {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(185, 28, 28, 0.28);
}

.pagination-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-color);
}

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

.pagination-ellipsis {
    color: var(--text-muted);
    font-size: 14px;
    padding: 0 4px;
    user-select: none;
}

/* Chat-specific pagination styling to fit inside sidebar */
.chat-pagination {
    margin-top: auto;
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    background-color: #fafbfc;
    justify-content: center;
    gap: 4px;
}

.chat-pagination .pagination-btn {
    min-width: 24px;
    height: 24px;
    font-size: 11px;
    border-radius: var(--radius-sm, 4px);
    padding: 0;
}

.chat-pagination .pagination-btn svg {
    width: 10px;
    height: 10px;
}

/* Prevent wrapping on table columns to prevent vertical text split and ensure readability */
.custom-table td {
    white-space: nowrap;
}

/* Make recent orders and chats section responsive on smaller desktop / tablet viewports */
@media (max-width: 1200px) {
    .dashboard-recent-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    min-width: 300px;
    max-width: 450px;
    transform: translateX(120%);
    animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transition: var(--transition);
}

.toast.success {
    border-left-color: var(--accent-green);
    background-color: var(--accent-green-bg);
    color: #065f46;
}

.toast.error {
    border-left-color: var(--accent-red);
    background-color: var(--accent-red-bg);
    color: #991b1b;
}

.toast.warning {
    border-left-color: var(--accent-orange);
    background-color: var(--accent-orange-bg);
    color: #92400e;
}

.toast.slide-out {
    animation: slideOut 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* ==========================================================================
   Chat Layout Fixes & Newline Preservation
   ========================================================================== */
.view-container.view-chat {
    padding: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.view-container.view-chat .chat-layout {
    position: relative;
    flex: 1;
    min-height: 0;
    height: auto;
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
}

.message-bubble {
    white-space: pre-wrap;
}

/* Chat Search Filter Row Styles */
.chat-filters-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.chat-filter-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    background-color: #ffffff;
    cursor: pointer;
    transition: var(--transition);
}

.chat-filter-select:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

/* Unread Chat Styles */
.chat-list-item.unread .chat-item-name {
    font-weight: 700;
    color: #000000;
}

.chat-list-item.unread .chat-item-preview {
    font-weight: 600;
    color: var(--text-color);
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background-color: var(--primary-color);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 5px rgba(30, 58, 138, 0.25);
    text-align: center;
    line-height: 1;
    animation: badgePop 0.2s ease-out;
}

@keyframes badgePop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}


/* Collection House BD fashion-brand enhancements */
body { background-image: radial-gradient(circle at 90% 10%, rgba(185,28,28,.07), transparent 28%), linear-gradient(135deg,#f8f4ec 0%,#f1ebe1 100%); }
.sidebar { background-image: linear-gradient(180deg,#171717 0%,#090909 100%); }
.main-content { background: transparent; }
.card, .stat-card, .panel-card, .content-card { backdrop-filter: blur(8px); }
.btn-primary { background: linear-gradient(135deg,#b91c1c,#7f1d1d); border-color: transparent; }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(185,28,28,.25); transform: translateY(-1px); }
.auth-body { background-image: radial-gradient(circle at 15% 15%,rgba(185,28,28,.12),transparent 30%), radial-gradient(circle at 85% 80%,rgba(17,17,17,.09),transparent 30%), linear-gradient(135deg,#f7f1e7,#ede3d5) !important; }
.auth-card { border-top: 4px solid var(--primary-color) !important; }


/* Collection House BD order workflow enhancements */
.orders-bulk-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0;padding:12px 14px;background:#fff7ed;border:1px solid #fed7aa;border-radius:14px;box-shadow:0 8px 20px rgba(15,23,42,.06)}
.orders-bulk-toolbar .bulk-status-select{width:auto;min-width:175px}
.orders-source-summary{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;margin:12px 0}
.orders-source-summary button{background:#fff;border:1px solid var(--border-color);border-radius:14px;padding:12px;text-align:left;cursor:pointer;transition:.2s}
.orders-source-summary button:hover{transform:translateY(-1px);border-color:var(--primary-color);box-shadow:0 8px 18px rgba(0,0,0,.06)}
.orders-source-summary span{display:block;font-size:22px;font-weight:800;color:var(--primary-color)}
.orders-source-summary small{color:var(--text-muted);font-weight:600}
.duplicate-order-row{background:#fff1f2!important;box-shadow:inset 4px 0 0 #e11d48}
.duplicate-order-row:hover{background:#ffe4e6!important}
.duplicate-order-badge{display:inline-block;margin-top:5px;padding:3px 7px;border-radius:999px;background:#e11d48;color:#fff;font-size:10px;font-weight:800;text-transform:uppercase}
.order-source-badge{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800;text-transform:capitalize}
.source-messenger{background:#dbeafe;color:#1d4ed8}.source-website{background:#dcfce7;color:#15803d}.source-whatsapp{background:#d1fae5;color:#047857}.source-manual{background:#f3e8ff;color:#7e22ce}
@media(max-width:900px){.orders-source-summary{grid-template-columns:repeat(2,1fr)}.orders-bulk-toolbar{align-items:stretch}.orders-bulk-toolbar>*{flex:1 1 auto}}

/* Fraud / Courier history checking */
.fraud-check-btn,
.fraud-result {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--panel-bg, #fff);
    padding: 7px 10px;
    cursor: pointer;
    font: inherit;
    min-width: 112px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.fraud-check-btn { color: var(--primary-color); font-weight: 700; }
.fraud-check-btn:hover,
.fraud-result:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0,0,0,.08); }
.fraud-result { display: flex; flex-direction: column; gap: 2px; text-align: left; font-size: 11px; }
.fraud-result span { white-space: nowrap; }
.fraud-result small { font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.fraud-safe { background: #ecfdf3; border-color: #a7f3d0; color: #166534; }
.fraud-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.fraud-high { background: #fff1f2; border-color: #fecdd3; color: #b91c1c; }
.fraud-unknown { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.fraud-bulk-btn { border-color: #7c3aed !important; color: #6d28d9 !important; }

@media (max-width: 900px) {
    .fraud-result { min-width: 98px; padding: 6px 8px; }
}

/* Fraud summary: safe = green, every other result = pink */
.fraud-unsafe {
    background: #fff0f5;
    border-color: #f9a8c4;
    color: #9d174d;
}
.fraud-result {
    min-width: 132px;
    padding: 8px 10px;
    line-height: 1.35;
}
#orders-table tbody tr[data-order-id] {
    cursor: default;
}
#orders-table tbody tr[data-order-id]:hover {
    background: rgba(59, 130, 246, 0.035);
}

/* ==========================================================================
   Orders UI Fix Patch
   - Styles source summary cards
   - Improves order table layout
   - Hides legacy View column/button as a visual fallback
   ========================================================================== */

.orders-source-summary {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(180px, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    margin: 18px 0 22px !important;
}

.orders-source-summary > button {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;

    width: 100% !important;
    min-height: 88px !important;
    margin: 0 !important;
    padding: 16px 18px !important;

    background: var(--panel-bg) !important;
    color: var(--text-color) !important;

    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;

    font-family: inherit !important;
    text-align: left !important;
    cursor: pointer !important;

    transition: var(--transition) !important;
}

.orders-source-summary > button:hover {
    transform: translateY(-2px) !important;
    border-color: var(--border-hover) !important;
    box-shadow: var(--shadow-md) !important;
}

.orders-source-summary > button:focus-visible {
    outline: 3px solid var(--primary-glow) !important;
    outline-offset: 2px !important;
}

.orders-source-summary > button span {
    display: block !important;
    margin: 0 0 7px !important;

    color: var(--primary-color) !important;
    font-size: 30px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

.orders-source-summary > button small {
    display: block !important;

    color: var(--text-muted) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

/* Source-specific number colors */
.orders-source-summary > button:nth-child(1) span {
    color: var(--accent-blue) !important;
}

.orders-source-summary > button:nth-child(2) span {
    color: var(--accent-purple) !important;
}

.orders-source-summary > button:nth-child(3) span {
    color: var(--accent-green) !important;
}

.orders-source-summary > button:nth-child(4) span {
    color: var(--accent-orange) !important;
}

/* Orders table improvements */
.orders-panel {
    background-color: var(--panel-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden !important;
}

#orders-table {
    min-width: 1120px;
}

#orders-table th,
#orders-table td {
    vertical-align: middle;
}

#orders-table tbody tr {
    cursor: default;
    transition: var(--transition);
}

#orders-table tbody tr:hover td {
    background-color: var(--primary-light) !important;
}

#orders-table tbody tr[title*="Double-click"] {
    cursor: pointer;
}

/* Fraud result cards */
.fraud-result {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;

    min-width: 128px;
    padding: 8px 10px;

    border-radius: 12px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.35;
    cursor: pointer;
}

.fraud-result span {
    display: block;
    white-space: nowrap;
}

.fraud-result small {
    display: block;
    margin-top: 3px;
    font-weight: 800;
}

.fraud-result.fraud-safe {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.fraud-result.fraud-unsafe {
    background: #fff1f5;
    color: #be123c;
    border-color: #fecdd3;
}

.fraud-check-btn {
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: #ffffff;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.fraud-check-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

/* Responsive */
@media (max-width: 1100px) {
    .orders-source-summary {
        grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    .orders-source-summary {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .orders-source-summary > button {
        min-height: 78px !important;
        padding: 14px 16px !important;
    }

    .orders-source-summary > button span {
        font-size: 26px !important;
    }
}
/* ========================================================================== 
   Dashboard analytics upgrade
   ========================================================================== */
.dashboard-filterbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.dashboard-filter-control,
.dashboard-date-jump {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.dashboard-filter-control .form-input,
.dashboard-date-jump .form-input {
    width: auto;
    min-width: 160px;
    height: 40px;
    padding: 7px 12px;
    border-radius: 10px;
}

.dashboard-pending-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.dashboard-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-chart-card {
    min-height: 355px;
}

.dashboard-chart-card .panel-header {
    gap: 12px;
}

.dashboard-chart-hint {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.dashboard-chart-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.dashboard-chart-svg {
    display: block;
    width: 100%;
    height: 260px;
    overflow: visible;
}

.dashboard-chart-gridline {
    stroke: var(--border-color);
    stroke-width: 1;
}

.dashboard-chart-axis-label {
    fill: var(--text-muted);
    font-size: 10px;
    font-family: inherit;
}

.dashboard-revenue-bar {
    fill: #10b981;
    opacity: .82;
    transition: opacity .15s ease;
}

.dashboard-revenue-bar:hover {
    opacity: 1;
}

.dashboard-order-line,
.dashboard-chat-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-order-line { stroke: #d97706; }
.dashboard-chat-line { stroke: #2563eb; }
.dashboard-order-dot { fill: #d97706; }
.dashboard-chat-dot { fill: #2563eb; }

.dashboard-chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.dashboard-chart-legend span::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
}

.dashboard-chart-legend .orders::before { background: #d97706; }
.dashboard-chart-legend .conversations::before { background: #2563eb; }

.dashboard-chart-empty {
    min-height: 245px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
}

@media (max-width: 1100px) {
    .dashboard-chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .dashboard-filterbar {
        justify-content: stretch;
        align-items: stretch;
    }
    .dashboard-filter-control,
    .dashboard-date-jump {
        width: 100%;
        justify-content: space-between;
    }
    .dashboard-filter-control .form-input,
    .dashboard-date-jump .form-input {
        min-width: 0;
        width: 58%;
    }
    .dashboard-chart-card { padding: 16px; min-height: 330px; }
    .dashboard-chart-card .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .dashboard-chart-svg { height: 235px; }
}

/* Multi-channel chat controls */
.channel-control-bar{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 18px;background:var(--bg-card,#fff);border-bottom:1px solid var(--border-color);flex-wrap:wrap}
.channel-tabs{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.channel-tab{border:1px solid var(--border-color);background:var(--bg-card,#fff);color:var(--text-muted);padding:8px 14px;border-radius:999px;font-size:12px;font-weight:700;cursor:pointer;transition:.18s ease}
.channel-tab:hover,.channel-tab.active{border-color:var(--accent-red);color:var(--accent-red);background:rgba(185,18,31,.06)}
.channel-master-switches{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.channel-switch-item{display:flex;align-items:center;gap:7px;padding:6px 9px;border:1px solid var(--border-color);border-radius:10px;background:var(--bg-card,#fff)}
.channel-switch-name{font-size:11px;font-weight:700}
.channel-state{min-width:24px;font-size:9px;font-weight:800;color:var(--text-muted)}
.channel-state.on{color:#15803d}.channel-state.off{color:#b91c1c}
.switch.switch-sm{width:36px;height:20px}.switch.switch-sm .slider:before{height:14px;width:14px;left:3px;bottom:3px}.switch.switch-sm input:checked + .slider:before{transform:translateX(16px)}
.platform-pill{display:inline-flex;align-items:center;margin-left:7px;padding:3px 7px;border-radius:999px;font-size:9px;text-transform:uppercase;letter-spacing:.04em;border:1px solid var(--border-color);color:var(--text-muted)}
.platform-pill.messenger{color:#0b5bd3}.platform-pill.instagram{color:#a21caf}.platform-pill.whatsapp{color:#15803d}
@media(max-width:850px){.channel-control-bar{padding:9px 10px}.channel-master-switches{gap:6px}.channel-switch-item{padding:5px 6px}.channel-switch-name{display:none}.channel-tab{padding:7px 10px}}


/* Team-member collision / live chat presence overlay - scoped to one customer window */
.chat-logs-pane { position: relative; }
.chat-presence-overlay {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 18px 18px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .14s ease, visibility .14s ease;
    background: rgba(15, 23, 42, .10);
    backdrop-filter: blur(1px);
    border-radius: inherit;
}
.chat-presence-overlay.show { opacity: 1; visibility: visible; }
.chat-presence-overlay-card {
    min-width: 290px;
    max-width: min(470px, calc(100% - 28px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.4;
}
.chat-presence-overlay-card strong { display:block; margin-bottom:2px; font-size:14px; }
.chat-presence-dot {
    width: 11px; height: 11px; flex: 0 0 11px; border-radius: 50%;
    background: #16a34a; box-shadow: 0 0 0 5px rgba(22,163,74,.12);
}
@media (max-width: 640px) {
    .chat-presence-overlay { padding: 60px 10px 10px; }
    .chat-presence-overlay-card { min-width: 0; width: calc(100% - 16px); }
}

/* Per-channel unread message notification badges */
.channel-tab{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.channel-unread-badge{min-width:19px;height:19px;padding:0 5px;border-radius:999px;background:var(--accent-red);color:#fff;font-size:10px;font-weight:800;line-height:19px;align-items:center;justify-content:center;box-shadow:0 0 0 2px var(--bg-card,#fff)}
.channel-tab.active .channel-unread-badge{box-shadow:0 0 0 2px rgba(185,18,31,.08)}

/* 2026-08-08: Chat single + bulk delete controls */
.chat-bulk-toolbar {
    margin-top: 10px;
    display: flex;
    align-items: center;
    min-width: 0;
}
.chat-bulk-select-btn,
.chat-bulk-cancel-btn,
.chat-bulk-delete-btn,
.chat-delete-current-btn {
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-color);
    border-radius: 9px;
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.chat-bulk-select-btn:hover,
.chat-bulk-cancel-btn:hover { background: #f8fafc; }
.chat-bulk-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.chat-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.chat-select-all-label input,
.chat-select-checkbox input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-color);
    cursor: pointer;
}
.chat-selected-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: auto;
}
.chat-bulk-delete-btn,
.chat-delete-current-btn {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff7f7;
}
.chat-bulk-delete-btn:hover:not(:disabled),
.chat-delete-current-btn:hover { background: #fee2e2; }
.chat-bulk-delete-btn:disabled { opacity: .45; cursor: not-allowed; }
.chat-delete-current-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 8px;
    flex: 0 0 36px;
}
.chat-delete-current-btn svg { width: 18px; height: 18px; }
.chat-select-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
}
.chat-list-item.bulk-selection-mode { cursor: pointer; }
.chat-list-item.bulk-selected {
    background: #fff1f2;
    box-shadow: inset 3px 0 0 #dc2626;
}

@media (max-width: 768px) {
    .chat-bulk-toolbar { margin-top: 8px; }
    .chat-bulk-actions { gap: 6px; }
    .chat-bulk-select-btn { width: 100%; }
    .chat-bulk-delete-btn,
    .chat-bulk-cancel-btn { padding: 6px 9px; min-height: 32px; }
    .chat-selected-count { font-size: 10px; }
    .chat-select-all-label { font-size: 11px; }
    .chat-logs-header > div:last-child { gap: 6px !important; }
    .chat-delete-current-btn { width: 34px; height: 34px; min-height: 34px; padding: 7px; }
}

/* 2026-08-08: Prevent chat filter controls from overflowing/cutting into message pane */
.view-container.view-chat .chat-sidebar,
.view-container.view-chat .chat-search-wrapper,
.view-container.view-chat .chat-filters-row {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.view-container.view-chat .chat-filters-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
}

.view-container.view-chat .chat-filter-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* At narrower desktop/tablet widths, stack filters so labels remain fully usable. */
@media (min-width: 769px) and (max-width: 1100px) {
    .view-container.view-chat .chat-filters-row {
        grid-template-columns: minmax(0, 1fr);
    }
}
