html { zoom: 0.93; }
/* ============================================================
   CLOUDFLARE ENTERPRISE SYSTEM STYLESHEET
   Brand Anchor: Energetic Orange (#F6821F)
   Canvas: Crisp White (#FFFFFF) / Neutrals (#F8F8F8)
   Sidebar: Serious Dark Navy (#0C0D11 / #161821)
   Border Radii: Spaced Minimal 4px - 6px
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #ffffff;
    --bg-surface: #f8f8f8;
    --bg-card: #ffffff;
    --bg-sidebar: #0C0D11;
    --bg-sidebar-hover: #161821;
    --border-color: #e2e8f0;
    --border-focus: #F6821F;
    
    --text-main: #1D1D1F;
    --text-muted: #64748b;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;
    
    --color-primary: #F6821F; /* Cloudflare Orange */
    --color-secondary: #0051c3; /* Cloudflare Deep Blue */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-soft: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --transition-fast: all 0.15s ease;
    --bg-hover: #f1f5f9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auth Login Page Styling */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0C0D11;
    padding: 20px;
}

.auth-card {
    background: #161821;
    border: 1px solid #27272a;
    border-radius: 6px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.auth-logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-logo span {
    color: var(--color-primary);
}

.auth-subtitle {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-card .form-label {
    color: #cbd5e1;
}

.form-control {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.auth-card .form-control {
    background: #0c0d11;
    border-color: #3f3f46;
    color: #ffffff;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(246, 130, 31, 0.2);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    padding: 11px 18px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background: #e06d15;
    border-color: #e06d15;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Dashboard Core Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition-fast);
    height: 106.4vh !important; /* Resolves browser zoom height calculation gaps */
    min-height: 106.4vh !important;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 20px;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: #ffffff;
}

.brand-name span {
    color: var(--color-primary);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-group-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 14px 14px 4px 14px;
    user-select: none;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.menu-item a:hover {
    background: var(--bg-sidebar-hover);
    color: #ffffff;
}

.menu-item.active a {
    background: var(--bg-sidebar-hover);
    color: #ffffff;
    border-left: 3px solid var(--color-primary);
    padding-left: 11px;
}

.menu-item a i {
    width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid #1e293b;
}

.user-profile-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

.profile-info h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
}

.profile-info span {
    font-size: 0.7rem;
    color: #94a3b8;
}

.logout-btn {
    margin-left: auto;
    color: var(--color-danger);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Workspace */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 32px;
    background-color: var(--bg-base);
    min-height: 100vh;
    animation: fadeIn 0.3s ease-out;
}

/* Navbar Top Header - Sticky premium style */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    position: sticky;
    top: 0;
    background-color: var(--bg-base);
    z-index: 99;
}

.header-title h1 {
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Grid Stats */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 24px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(246, 130, 31, 0.3);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(246, 130, 31, 0.05);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: background 0.25s ease;
}

/* Hover anchor borders based on standard panel classes */
.stat-card:nth-child(1):hover::after { background: var(--color-primary); }
.stat-card:nth-child(2):hover::after { background: var(--color-success); }
.stat-card:nth-child(3):hover::after { background: var(--color-secondary); }
.stat-card:nth-child(4):hover::after { background: #8b5cf6; }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border: none;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* Panels and Cards */
.panel-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.panel-title {
    font-weight: 600;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    color: var(--color-primary);
}

/* Premium Visual Data Table Styling */
.table-responsive {
    width: 100%;
    max-height: 550px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
}

.table-responsive::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-track {
    background: var(--bg-hover);
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-premium th {
    background: var(--bg-surface);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table-premium td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.85rem;
}

.table-premium tr:last-child td {
    border-bottom: none;
}

.table-premium tr:hover td {
    background: var(--bg-surface);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-member { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.badge-ctv { background: #e0f2fe; color: var(--color-secondary); border: 1px solid #bae6fd; }
.badge-admin { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }

.badge-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-pending { background: #fffbeb; color: #92400e; border: 1px solid #fef3c7; }
.badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Quick Action Buttons */
.btn-icon {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-icon:hover {
    border-color: #cbd5e1;
    color: var(--text-main);
    background: var(--bg-surface);
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-surface);
    border-color: #cbd5e1;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 13, 17, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 100%;
    max-width: 550px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: var(--transition-fast);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-danger);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* Custom Scrollbar system-wide */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #ffffff;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Form Helper text */
.form-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.danger-box {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.info-box {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

/* ============================================================
   PREMIUM DETAILED SYSTEM UI ADDITIONS
   ============================================================ */

/* 1. Profile detailed view layout */
.user-profile-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 16px;
}

@media (max-width: 992px) {
    .user-profile-layout {
        grid-template-columns: 1fr;
    }
}

.profile-card-left {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: var(--transition-fast);
}

.profile-card-left:hover {
    box-shadow: var(--shadow-card);
}

.profile-avatar-bubble {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px auto;
    background: linear-gradient(135deg, var(--color-primary) 0%, #e06d15 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(246, 130, 31, 0.25);
    border: 3px solid #ffffff;
}

.profile-fullname {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.profile-username {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.profile-meta-list {
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.profile-meta-list .meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    align-items: center;
}

.profile-meta-list .meta-label {
    color: var(--text-muted);
    font-weight: 500;
}

.profile-meta-list .meta-val {
    color: var(--text-main);
    font-weight: 600;
}

.profile-actions-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.profile-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}

.profile-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.profile-action-btn:active {
    transform: translateY(0);
}

.profile-action-btn.telegram {
    background: #0088cc;
    color: #ffffff;
    border-color: #0088cc;
}
.profile-action-btn.telegram:hover {
    background: #0077b5;
}

.profile-action-btn.botapp {
    background: var(--bg-sidebar);
    color: #ffffff;
    border-color: var(--bg-sidebar);
}
.profile-action-btn.botapp:hover {
    background: var(--bg-sidebar-hover);
}

.profile-action-btn.balance {
    background: var(--color-success);
    color: #ffffff;
    border-color: var(--color-success);
}
.profile-action-btn.balance:hover {
    background: #059669;
}

.profile-action-btn.role {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}
.profile-action-btn.role:hover {
    background: #e06d15;
}

.profile-action-btn.delete {
    background: var(--color-danger);
    color: #ffffff;
    border-color: var(--color-danger);
}
.profile-action-btn.delete:hover {
    background: #dc2626;
}

.profile-content-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.profile-tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 8px;
}

.profile-tab-btn {
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-tab-btn:hover {
    color: var(--text-main);
}

.profile-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.profile-tab-content {
    animation: fadeIn 0.2s ease-out;
}


/* 2. Split screen layout for Category manager */
.split-screen-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 992px) {
    .split-screen-layout {
        grid-template-columns: 1fr;
    }
}

.split-column-left {
    display: flex;
    flex-direction: column;
}

.split-column-right {
    display: flex;
    flex-direction: column;
}


/* 3. Progressive Broadcast UI */
.progress-bar-wrapper {
    background: #e2e8f0;
    border-radius: 9999px;
    height: 12px;
    overflow: hidden;
    position: relative;
    margin: 10px 0;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--color-primary) 0%, #ff9e42 100%);
    height: 100%;
    border-radius: 9999px;
    width: 0%;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.log-console-box {
    background: #0C0D11;
    border-radius: 6px;
    padding: 16px;
    font-family: "Courier New", Courier, monospace;
    color: #a1a1aa;
    font-size: 0.8rem;
    line-height: 1.6;
    height: 220px;
    overflow-y: auto;
    margin-top: 15px;
    border: 1px solid #27272a;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.console-line {
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding-bottom: 2px;
    word-break: break-all;
}

.console-line.success {
    color: #4ade80;
}

.console-line.warning {
    color: #facc15;
}

.console-line.system {
    color: #60a5fa;
}

.console-line.error {
    color: #f87171;
}

.console-line.info {
    color: #e4e4e7;
}


/* 4. Warning Card Alert box */
.warning-alert-card {
    display: flex;
    gap: 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.warning-alert-card .alert-icon {
    color: #d97706;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-alert-card .alert-content h4 {
    font-weight: 700;
    font-size: 0.9rem;
    color: #92400e;
    margin-bottom: 4px;
}

.warning-alert-card .alert-content p {
    font-size: 0.825rem;
    color: #b45309;
    line-height: 1.4;
}


/* 5. Notification Switches sliders (Premium switches) */
.premium-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.premium-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.premium-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.premium-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.premium-switch input:checked + .premium-slider {
    background-color: var(--color-primary);
}

.premium-switch input:checked + .premium-slider:before {
    transform: translateX(20px);
}


/* 6. Settings Subtabs navigation */
.settings-sub-navigation {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 1px;
}

.settings-sub-navigation::-webkit-scrollbar {
    height: 4px;
}

.settings-sub-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-sub-btn:hover {
    color: var(--text-main);
}

.settings-sub-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.settings-sub-content {
    display: none;
}

.settings-sub-content.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}


/* 7. Overridden Messages Portal layout */
.settings-messages-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 768px) {
    .settings-messages-layout {
        grid-template-columns: 1fr;
    }
}

.msg-sub-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-surface);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.msg-tab-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.msg-tab-link:hover {
    background: rgba(246, 130, 31, 0.04);
    color: var(--text-main);
}

.msg-tab-link.active {
    background: rgba(246, 130, 31, 0.08);
    color: var(--color-primary);
    font-weight: 600;
}

.msg-sub-panels {
    display: flex;
    flex-direction: column;
}

.msg-slot-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
}

.msg-slot-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-card);
}

.msg-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.msg-slot-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.msg-slot-key {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

.msg-slot-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.msg-slot-textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-main);
    line-height: 1.5;
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
    transition: var(--transition-fast);
}

.msg-slot-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(246, 130, 31, 0.15);
}

/* Extra Overview Link Card styling */
.overview-link-card {
    flex: 1 1 300px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
}

.overview-link-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-card);
}

.link-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.link-card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.overview-link-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.overview-link-card code {
    display: block;
    background: #0C0D11;
    color: #a1a1aa;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.75rem;
    word-break: break-all;
    border: 1px solid #27272a;
}

/* Inline collapsible form and elements */
.premium-add-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    transition: var(--transition-fast);
}

.premium-add-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.premium-add-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.premium-add-header h3 i {
    color: #5c67f2;
}

.inline-form-toggle-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.premium-add-card.collapsed .premium-add-body {
    display: none;
}

.premium-add-card.collapsed .inline-form-toggle-icon {
    transform: rotate(-90deg);
}

/* Custom switch toggles */
.switch-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .3s;
    border-radius: 24px;
    border: 1px solid #cbd5e1;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.switch-toggle input:checked + .switch-slider {
    background-color: #5c67f2;
    border-color: #5c67f2;
}

.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(22px);
}

/* Filters Card */
.filters-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

/* Filters Panel Header (Requirement 2) */
.filters-panel-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    border-radius: 6px;
    padding: 6px 10px;
    margin-left: -10px;
    margin-right: -10px;
}
.filters-panel-header:hover {
    background-color: var(--bg-hover);
}


/* Table cells styling */
.product-title-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name-bold {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.9rem;
}

.product-cat-tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.75rem;
    color: #4f46e5;
    background: #e0e7ff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Pink badge for stock count */
.badge-pink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: #fce7f3;
    color: #db2777;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Row Action Buttons */
.btn-action-yellow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fef3c7;
    color: #d97706;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
    margin-right: 6px;
}
.btn-action-yellow:hover {
    background: #fde68a;
    color: #b45309;
    transform: translateY(-1px);
}

.btn-action-red {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}
.btn-action-red:hover {
    background: #fecaca;
    color: #b91c1c;
    transform: translateY(-1px);
}

/* Edit Modal Layout improvements */
#productModal textarea.form-control {
    background: #0f172a !important;
    color: #38bdf8 !important;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    border-color: #334155 !important;
}

/* Text Hierarchy */
.text-main-val {
    font-weight: 700;
    color: var(--text-main);
}

.text-sub-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* PREMIUM COLLAPSIBLE INLINE ADD CARD */
.premium-add-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.03);
}
.premium-add-header {
    padding: 16px 20px;
    background: rgba(246, 130, 31, 0.03);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}
.premium-add-header:hover {
    background: rgba(246, 130, 31, 0.06);
}
.premium-add-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.premium-add-header h3 i {
    color: #F6821F;
}
.inline-form-toggle-icon {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}
.premium-add-body {
    padding: 20px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}
.premium-add-card.collapsed .premium-add-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    border: none;
}
.premium-add-card.collapsed {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.premium-add-card.collapsed .premium-add-header {
    border-bottom: none;
}
.premium-add-card.collapsed .inline-form-toggle-icon {
    transform: rotate(-90deg);
}

/* PREMIUM 5-COLUMN FILTERS BAR */
.filters-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Pink Circular Stock Badge */
.badge-pink {
    background: #fff0f6 !important;
    color: #d91b5c !important;
    border: 1px solid #ffd6e7 !important;
}

/* Switch styling for inline and forms */
.switch-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}
.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 20px;
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .3s;
    border-radius: 50%;
}
.switch-toggle input:checked + .switch-slider {
    background-color: #5c67f2;
}
.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(18px);
}

/* Premium switches for modal */
.switch-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.premium-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}
.premium-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.premium-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 20px;
}
.premium-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .3s;
    border-radius: 50%;
}
.premium-switch input:checked + .premium-slider {
    background-color: #5c67f2;
}
.premium-switch input:checked + .premium-slider:before {
    transform: translateX(18px);
}

/* ============================================================
   VIBRANT AESTHETICS & RESPONSIVE LAYOUT ADDITIONS
   ============================================================ */

/* Primary and Secondary button transitions & glow */
.btn-primary {
    background: linear-gradient(135deg, #ff7e40 0%, #f6821f 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(246, 130, 31, 0.2) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(246, 130, 31, 0.3) !important;
    opacity: 0.95;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    border: 1px solid rgba(246, 130, 31, 0.3) !important;
    color: #f6821f !important;
    background: #ffffff !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-secondary:hover {
    background: rgba(246, 130, 31, 0.04) !important;
    border-color: #f6821f !important;
    transform: translateY(-1px);
}

/* Premium micro-interactions for sidebar user profile avatar and link keys */
.user-profile-status .profile-avatar:hover {
    transform: scale(1.05) rotate(5deg);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #ffffff;
}

#profileKeyBtn:hover {
    color: var(--color-primary) !important;
    transform: scale(1.1) rotate(-10deg);
}

/* Highly vibrant custom badges */
.badge-member { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #cbd5e1 !important; }
.badge-ctv { background: #f3e8ff !important; color: #7c3aed !important; border: 1px solid #ddd6fe !important; }
.badge-admin { background: #fff7ed !important; color: #ea580c !important; border: 1px solid #ffedd5 !important; }
.badge-success { background: #f0fdf4 !important; color: #16a34a !important; border: 1px solid #dcfce7 !important; }
.badge-pending { background: #fefce8 !important; color: #ca8a04 !important; border: 1px solid #fef9c3 !important; }
.badge-danger { background: #fef2f2 !important; color: #dc2626 !important; border: 1px solid #fee2e2 !important; }

/* Dynamic compact grid for app events switches */
.noti-switches-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 16px !important;
    margin-top: 15px !important;
    max-width: 1000px !important;
}

.noti-switches-grid .switch-item-row {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 14px 18px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 15px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
    transition: all 0.2s ease !important;
}

.noti-switches-grid .switch-item-row:hover {
    border-color: var(--color-primary) !important;
    box-shadow: 0 4px 12px rgba(246, 130, 31, 0.05) !important;
}

.noti-switches-grid .switch-item-info h4 {
    margin: 0 0 4px 0 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
}

.noti-switches-grid .switch-item-info p {
    margin: 0 !important;
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    line-height: 1.3 !important;
}

/* Compact realtime feed tables and list classes */
.compact-table th, .compact-table td {
    padding: 8px 10px !important;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.825rem;
    transition: background 0.15s ease;
}

.activity-list li:last-child {
    border-bottom: none;
}

.activity-list li:hover {
    background: rgba(246, 130, 31, 0.02);
}

.activity-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

.activity-title {
    font-weight: 600;
    color: var(--text-main);
}

.activity-time {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.activity-val {
    font-weight: 700;
    text-align: right;
}

/* API Connection Card Premium Styles */
.api-connection-card {
    width: 100%;
    margin-bottom: 16px;
    background: var(--bg-card, #ffffff) !important;
    border: 1px solid var(--border-color) !important;
    padding: 20px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.25s ease;
}
.api-connection-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}
.api-stat-pill {
    background: var(--bg-surface, #f1f5f9) !important;
    color: var(--text-main, #1D1D1F) !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}
.api-stat-pill-success {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.15) !important;
    color: var(--color-success) !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}
.api-card-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-color) !important;
    padding-top: 14px;
}
.api-empty-card {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    border: 2px dashed var(--border-color) !important;
    border-radius: 12px !important;
    background: var(--bg-card, #ffffff) !important;
}

/* Sidebar Hamburger and layout drawers for smartphone mobile support */
@media (max-width: 768px) {
    .mobile-toggle-btn {
        display: block !important;
    }
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        position: fixed;
        top: 0;
        left: 0;
        height: 106.4vh !important; /* Fixes zoom gap scale on mobile screen views */
        z-index: 1000;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        padding: 16px !important;
    }
    .top-header {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .table-responsive {
        border: none;
        overflow-x: auto;
    }
    .table-premium th, .table-premium td {
        padding: 10px 12px !important;
    }
    .grid-stats {
        grid-template-columns: 1fr !important;
    }
    .split-screen-layout {
        grid-template-columns: 1fr !important;
    }
    .settings-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   PREMIUM IMPROVEMENTS & DARK THEME CONFIG
   ============================================================ */

/* 1. Custom alert dialog modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    display: flex !important;
    opacity: 1;
}

.modal-overlay .modal-content {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

@keyframes popAlertIcon {
    0% { transform: scale(0) rotate(-20deg); }
    70% { transform: scale(1.25) rotate(10deg); }
    100% { transform: scale(1) rotate(0); }
}

/* 2. Premium toolbar icons */
.btn-toolbar-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.2rem !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-toolbar-icon:hover {
    color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(246, 130, 31, 0.22);
}

.btn-toolbar-icon:active {
    transform: translateY(0) scale(0.95);
}

/* Spin animation for refresh button */
.refresh-btn-premium i {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.refresh-btn-premium:hover i {
    transform: rotate(180deg);
}

.refresh-btn-premium.spinning i {
    animation: premiumSpin 0.8s linear infinite;
}

@keyframes premiumSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 3. LIVE pulsing real-time indicator */
.premium-live-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-live 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

@keyframes pulse-live {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* 4. Complete Premium Dark Theme */
body.dark-theme {
    --bg-base: #0f172a !important; /* Deep Slate canvas */
    --bg-surface: #1e293b !important; /* Medium Slate surfaces */
    --bg-card: #1e293b !important; /* Slate card */
    --border-color: #334155 !important; /* Border color */
    --text-main: #f8fafc !important; /* Slate 50 text */
    --text-muted: #94a3b8 !important; /* Slate 400 */
    --bg-hover: #334155 !important;
}

/* Dark mode overrides for cards, tables, menus, inputs, profiles */
body.dark-theme .panel-card,
body.dark-theme .stat-card,
body.dark-theme .overview-link-card,
body.dark-theme .modal-content,
body.dark-theme .realtime-card {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1) !important;
}

body.dark-theme .btn-toolbar-icon {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-theme .btn-toolbar-icon:hover {
    color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 4px 12px rgba(246, 130, 31, 0.3) !important;
}

body.dark-theme .form-control {
    background-color: #0f172a !important;
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .form-control:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px rgba(246, 130, 31, 0.25) !important;
}

body.dark-theme .table-premium {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .table-premium th {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #f8fafc !important;
    border-bottom: 2px solid #334155 !important;
}

body.dark-theme .table-premium td {
    border-bottom: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-theme .table-premium tr:hover td {
    background-color: rgba(246, 130, 31, 0.04) !important;
}

body.dark-theme .activity-list li {
    border-bottom: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-theme .activity-list li:hover {
    background-color: rgba(246, 130, 31, 0.04) !important;
}

body.dark-theme code {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border: 1px solid #334155 !important;
}

body.dark-theme .top-header {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
}

body.dark-theme .breadcrumb span.bc-parent {
    color: #94a3b8 !important;
}

body.dark-theme .settings-sub-btn {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border: 1px solid #334155 !important;
}

body.dark-theme .settings-sub-btn.active {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #ffffff !important;
}

body.dark-theme .noti-switches-grid .switch-item-row {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
}

body.dark-theme .noti-switches-grid .switch-item-row:hover {
    border-color: var(--color-primary) !important;
}

body.dark-theme .switch-item-info h4 {
    color: #f8fafc !important;
}

body.dark-theme .switch-item-info p {
    color: #94a3b8 !important;
}

body.dark-theme .modal-header,
body.dark-theme .modal-footer {
    border-color: #334155 !important;
}

body.dark-theme .btn-secondary {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.dark-theme .btn-secondary:hover {
    background: #1e293b !important;
    color: #ffffff !important;
}

/* ============================================================
   CUSTOM TOAST, SCROLL CONTAINERS, & HORIZONTAL LAYOUT OVERRIDES
   ============================================================ */

.table-scroll-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    margin-bottom: 20px;
}
.table-scroll-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.table-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-surface);
}
.table-scroll-container::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}
body.dark-theme .table-scroll-container::-webkit-scrollbar-thumb {
    background: var(--color-primary);
}

#toastBox {
    position: fixed !important;
    top: 30px !important;
    right: 30px !important;
    bottom: auto !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    overflow: hidden !important;
}

.toast {
    width: 320px;
    padding: 18px 20px;
    background-color: #ffffff;
    border-left: 6px solid #28a745; /* Màu xanh lá biểu tượng thành công */
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.5s ease forwards; /* Hiệu ứng xuất hiện */
}

.toast.hide {
    animation: slideOut 0.5s ease forwards; /* Hiệu ứng biến mất */
}

.toast i {
    font-size: 24px;
    color: #28a745;
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.toast-message {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

/* Keyframes cho hiệu ứng */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Horizontal Switches & API rows Layouts */
.switches-horizontal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    width: 100%;
}
.switches-horizontal-grid .switch-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface, #f8f8f8);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 0 !important;
}

.api-connection-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.25s ease;
    margin-bottom: 16px;
}
.api-connection-row:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

body.dark-theme .toast {
    background-color: #1e293b !important;
    border-color: #28a745 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}
body.dark-theme .toast-title {
    color: #f8fafc !important;
}
body.dark-theme .toast-message {
    color: #cbd5e1 !important;
}
body.dark-theme .switches-horizontal-grid .switch-item-row {
    background: #0f172a !important;
    border-color: #334155 !important;
}
body.dark-theme .api-connection-row {
    background: #1e293b !important;
    border-color: #334155 !important;
}
body.dark-theme .filter-bar {
    background: #0f172a !important;
    border-color: #334155 !important;
}
body.dark-theme .msg-slot-card {
    background: #0f172a !important;
    border-color: #334155 !important;
}
body.dark-theme .msg-tab-link {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}
body.dark-theme .msg-tab-link.active {
    background: var(--color-primary) !important;
    color: #ffffff !important;
}

@media (max-width: 992px) {
    .api-connection-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Dark mode improvements & contrast fixes */
body.dark-theme .premium-add-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
body.dark-theme .premium-add-header {
    border-color: #334155 !important;
}
body.dark-theme .premium-add-header h3 {
    color: #f8fafc !important;
}
body.dark-theme .danger-box {
    background: #180d0d !important;
    border-color: #581c1c !important;
}
body.dark-theme .danger-box h4 {
    color: #fca5a5 !important;
}
body.dark-theme .danger-box p {
    color: #fca5a5 !important;
}
body.dark-theme .warning-alert-card {
    background: #1c150c !important;
    border-color: #5c3e16 !important;
}
body.dark-theme .warning-alert-card p {
    color: #fde047 !important;
}
body.dark-theme .table-scroll-container {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
body.dark-theme .profile-card-left {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
body.dark-theme .profile-card-left .meta-item {
    border-color: #334155 !important;
}
body.dark-theme .profile-card-left .meta-label {
    color: #cbd5e1 !important;
}
body.dark-theme .profile-card-left .meta-val {
    color: #f8fafc !important;
}
body.dark-theme .profile-tab-btn {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}
body.dark-theme .profile-tab-btn.active {
    background: var(--color-primary) !important;
    color: #ffffff !important;
}
body.dark-theme .form-control option {
    background: #1e293b !important;
    color: #f8fafc !important;
}
body.dark-theme select.form-control {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

/* Responsive grid layout for 5-column product fields */
.product-grid-five-columns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1200px) {
    .product-grid-five-columns {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .product-grid-five-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .product-grid-five-columns {
        grid-template-columns: 1fr;
    }
}

/* Dark mode improvements & contrast fixes for inputs, alert cards, status lists, and info boxes */
body.dark-theme .filters-card {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
body.dark-theme .profile-meta-list,
body.dark-theme .meta-item {
    border-color: #334155 !important;
}
body.dark-theme .meta-label {
    color: #cbd5e1 !important;
}
body.dark-theme .meta-val {
    color: #f8fafc !important;
}
body.dark-theme .warning-alert-card h4 {
    color: #fde047 !important;
}
body.dark-theme .info-box {
    background: #062412 !important;
    border-color: #14532d !important;
    color: #4ade80 !important;
}
body.dark-theme .info-box h4 {
    color: #4ade80 !important;
}
body.dark-theme .info-box p {
    color: #86efac !important;
}

/* Drag and drop sorting visual style */
tr.dragging {
    opacity: 0.5;
    background-color: rgba(246, 130, 31, 0.1) !important;
    border: 2px dashed #F6821F !important;
}

/* Masked sensitive input styles (Requirement 7) */
.masked-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.masked-input-container .form-control {
    padding-right: 85px !important; /* Space for eye & copy buttons */
}
.masked-input-container .masked-input-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    z-index: 10;
}
.masked-input-container .mask-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.1s;
}
.masked-input-container .mask-action-btn:hover {
    color: var(--color-primary);
    transform: scale(1.1);
}
.masked-input-container .mask-action-btn:active {
    transform: scale(0.95);
}

/* Sticky scroll settings sub-navigation (Requirement 8) */
.settings-sub-navigation {
    position: sticky !important;
    top: 56px !important;
    z-index: 98 !important;
    background: var(--bg-card);
    padding: 10px 0;
    margin-top: -10px;
    box-shadow: 0 4px 6px -4px rgba(0,0,0,0.1);
}
body.dark-theme .settings-sub-navigation {
    background: #1e293b !important;
    box-shadow: 0 4px 6px -4px rgba(0,0,0,0.3);
}

/* ============================================================
   COLLAPSIBLE SIDEBAR RULES & TRANSITIONS (Requirement 12)
   ============================================================ */
.sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease !important;
}
.main-content {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body.sidebar-collapsed .sidebar {
    width: 80px;
    padding: 24px 8px;
}
body.sidebar-collapsed .sidebar .brand-name,
body.sidebar-collapsed .sidebar .sidebar-group-title,
body.sidebar-collapsed .sidebar .menu-item span,
body.sidebar-collapsed .sidebar .profile-info,
body.sidebar-collapsed .sidebar #profileKeyBtn,
body.sidebar-collapsed .sidebar-footer h4,
body.sidebar-collapsed .sidebar-footer span {
    display: none !important;
}
body.sidebar-collapsed .sidebar-brand > div {
    display: none !important;
}
body.sidebar-collapsed #sidebarCollapseBtn {
    margin: 0 auto !important;
}
body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 10px 0;
    border-bottom: none;
}
body.sidebar-collapsed .sidebar .menu-item a {
    justify-content: center;
    padding: 12px 0;
}
body.sidebar-collapsed .sidebar .menu-item i {
    font-size: 1.35rem;
    margin-right: 0 !important;
}
body.sidebar-collapsed .main-content {
    margin-left: 80px;
}
body.sidebar-collapsed #sidebarCollapseBtn i {
    transform: rotate(180deg);
}

/* Hover expansion when collapsed */
body.sidebar-collapsed .sidebar:hover {
    width: 260px !important;
    padding: 24px 16px !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15) !important;
    z-index: 999 !important;
}
body.sidebar-collapsed .sidebar:hover .brand-name,
body.sidebar-collapsed .sidebar:hover .sidebar-group-title,
body.sidebar-collapsed .sidebar:hover .menu-item span,
body.sidebar-collapsed .sidebar:hover .profile-info,
body.sidebar-collapsed .sidebar:hover #profileKeyBtn,
body.sidebar-collapsed .sidebar:hover .sidebar-footer h4,
body.sidebar-collapsed .sidebar:hover .sidebar-footer span {
    display: block !important;
}
body.sidebar-collapsed .sidebar:hover .sidebar-brand > div {
    display: flex !important;
}
body.sidebar-collapsed .sidebar:hover #sidebarCollapseBtn {
    margin-left: auto !important;
}
body.sidebar-collapsed .sidebar:hover .sidebar-brand {
    justify-content: flex-start !important;
    padding: 10px 8px !important;
    padding-bottom: 20px !important;
    border-bottom: 1px solid #1e293b !important;
}
body.sidebar-collapsed .sidebar:hover .sidebar-menu .menu-item a {
    justify-content: flex-start !important;
    padding: 12px 16px !important;
}
body.sidebar-collapsed .sidebar:hover .sidebar-menu .menu-item i {
    font-size: 1.1rem !important;
    margin-right: 12px !important;
}


/* ============================================================
   HIGH DENSITY CUSTOM INVENTORY TABLES & SCROLLBARS (Requirement 11)
   ============================================================ */
.inventory-table-container {
    max-height: 550px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    background: var(--bg-card);
}
.inventory-table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.inventory-table-container::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 10px;
}
.inventory-table-container::-webkit-scrollbar-track {
    background: var(--bg-hover);
}

/* Image 2 Filter Card Premium Styling */
.premium-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.premium-filter-grid .form-group {
    margin-bottom: 0;
}
.premium-filter-grid .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
}
.premium-filter-grid .form-control {
    font-size: 0.8rem;
    height: 34px;
    padding: 6px 10px;
}

@media (max-width: 768px) {
    .order-details-grid {
        grid-template-columns: 1fr !important;
    }
}

