/**
 * Gentelella Theme for PixelRec Pro
 * Authentic ColorlibHQ/gentelella Admin Template Architecture & Design System
 * https://github.com/ColorlibHQ/gentelella
 */

:root {
    --gentelella-sidebar: #2A3F54;
    --gentelella-sidebar-hover: #3E5367;
    --gentelella-sidebar-active: #334a60;
    --gentelella-active: #1ABB9C;
    --gentelella-active-hover: #169F85;
    --gentelella-brand: #172D44;
    --gentelella-bg: #F7F7F7;
    --gentelella-topnav: #EDEDED;
    --gentelella-text: #73879C;
    --gentelella-text-dark: #2A3F54;
    --gentelella-border: #E6E9ED;
    --gentelella-border-dark: #D9DEE4;
    --gentelella-blue: #3498DB;
    --gentelella-danger: #E74C3C;
    --gentelella-warning: #F39C12;
}

body.gentelella-layout {
    background: var(--gentelella-bg) !important;
    color: var(--gentelella-text) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.471 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* Canonical Gentelella Layout */
.container.body {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    background: var(--gentelella-bg);
}

.main_container {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    position: relative;
    background: var(--gentelella-bg);
}

/* ==========================================================================
   LEFT SIDEBAR (AUTHENTIC GENTELELLA)
   ========================================================================== */
.col-md-3.left_col {
    width: 230px;
    background: var(--gentelella-sidebar);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.18s ease;
    box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}

.left_col.scroll-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.left_col .navbar.nav_title {
    width: 100%;
    height: 57px;
    background: var(--gentelella-brand);
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
}

.left_col .site_title {
    font-weight: 700;
    font-size: 19px;
    color: #ECF0F1 !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.left_col .site_title i {
    color: var(--gentelella-active);
    font-size: 22px;
}

/* Profile Quick Info */
.profile {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile_pic {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #1ABB9C;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.profile_info {
    overflow: hidden;
}

.profile_info span {
    font-size: 11px;
    color: #BAB8B8;
    display: block;
}

.profile_info h2 {
    font-size: 14px;
    color: #ECF0F1;
    font-weight: 700;
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Side Menu */
.sidebar_section_title {
    padding: 18px 20px 6px 20px;
    font-size: 11px;
    font-weight: 700;
    color: #9aa8b6;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.main_menu_side {
    padding: 0;
    margin-bottom: 20px;
}

.nav.side-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav.side-menu > li {
    margin: 0;
    position: relative;
}

.nav.side-menu > li > a {
    display: flex;
    align-items: center;
    padding: 13px 20px;
    color: #E7E7E7;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
}

.nav.side-menu > li > a i {
    width: 26px;
    font-size: 16px;
    color: #C4C8CC;
    transition: color 0.2s ease;
}

.nav.side-menu > li > a:hover {
    background: var(--gentelella-sidebar-hover);
    color: #fff;
}

.nav.side-menu > li > a:hover i {
    color: var(--gentelella-active);
}

.nav.side-menu > li.active > a {
    background: var(--gentelella-sidebar-active);
    color: #fff;
    border-left: 4px solid var(--gentelella-active);
    font-weight: 700;
}

.nav.side-menu > li.active > a i {
    color: var(--gentelella-active);
}

.nav.side-menu .badge {
    margin-left: auto;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
}

/* Sidebar Collapsed State (.nav-sm) */
body.nav-sm .col-md-3.left_col {
    width: 70px;
}

body.nav-sm .profile_info,
body.nav-sm .site_title span,
body.nav-sm .sidebar_section_title {
    display: none !important;
}

body.nav-sm .profile {
    padding: 12px 10px;
    justify-content: center;
}

body.nav-sm .profile_pic {
    margin: 0 auto;
}

body.nav-sm .nav.side-menu > li > a {
    padding: 15px 0;
    justify-content: center;
    text-align: center;
}

body.nav-sm .nav.side-menu > li > a i {
    width: auto;
    font-size: 18px;
    margin: 0;
}

body.nav-sm .nav.side-menu > li > a span,
body.nav-sm .nav.side-menu > li > a .badge {
    display: none !important;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    background: var(--gentelella-brand);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-footer a {
    color: #5A738E;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
    padding: 4px 8px;
}

.sidebar-footer a:hover {
    color: #1ABB9C;
}

/* ==========================================================================
   TOP NAVIGATION BAR (AUTHENTIC GENTELELLA)
   ========================================================================== */
.top_nav {
    margin-left: 230px;
    height: 57px;
    background: #fff;
    border-bottom: 1px solid var(--gentelella-border-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 99;
    transition: margin-left 0.18s ease;
}

.nav_menu {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.nav_toggle_btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gentelella-sidebar);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav_toggle_btn:hover {
    background: #F2F5F7;
    color: var(--gentelella-active);
}

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

.status_pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F4F6F9;
    border: 1px solid #D9DEE4;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.status_pill.active {
    background: rgba(26, 187, 156, 0.12);
    border-color: #1ABB9C;
    color: #0E7864;
}

.user_profile_link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #5A738E;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.user_profile_link:hover {
    background: #F2F5F7;
    color: #2A3F54;
}

.user_profile_link .mini_avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gentelella-active);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ==========================================================================
   MAIN CONTENT AREA & GENTELELLA TILES
   ========================================================================== */
.right_col {
    margin-left: 230px;
    background: var(--gentelella-bg);
    min-height: calc(100vh - 57px);
    display: flex;
    flex-direction: column;
    padding: 15px 25px 40px 25px;
    transition: margin-left 0.18s ease;
}

footer {
    margin-left: 230px;
    background: #fff;
    padding: 15px 25px;
    border-top: 1px solid var(--gentelella-border);
    color: var(--gentelella-text);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: margin-left 0.18s ease;
}

/* Sidebar collapse overrides */
body.nav-sm .top_nav,
body.nav-sm .right_col,
body.nav-sm footer {
    margin-left: 70px !important;
}

@media (max-width: 991px) {
    .col-md-3.left_col {
        transform: translateX(-100%);
        transition: transform 0.25s ease-in-out;
    }
    body.nav-open .col-md-3.left_col {
        transform: translateX(0);
    }
    .top_nav,
    .right_col,
    footer {
        margin-left: 0 !important;
    }
}

/* Top Metric Tiles */
.row.tile_count {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--gentelella-border);
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 12px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.tile_stats_count {
    flex: 1;
    min-width: 140px;
    padding: 8px 18px;
    border-right: 1px solid var(--gentelella-border-dark);
}

.tile_stats_count:last-child {
    border-right: none;
}

.tile_stats_count .count_top {
    font-size: 12px;
    color: #73879C;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.tile_stats_count .count_top i {
    color: var(--gentelella-active);
}

.tile_stats_count .count {
    font-size: 24px;
    font-weight: 700;
    color: var(--gentelella-text-dark);
    margin: 4px 0;
    line-height: 1.2;
}

.tile_stats_count .count_bottom {
    font-size: 11px;
    color: #73879C;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tile_stats_count .count_bottom i.green {
    color: var(--gentelella-active);
}

/* ==========================================================================
   GENTELELLA X_PANEL CARD CONTAINERS
   ========================================================================== */
.x_panel {
    background: #fff;
    border: 1px solid var(--gentelella-border);
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 18px 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.x_title {
    border-bottom: 2px solid var(--gentelella-border);
    padding-bottom: 10px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.x_title h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gentelella-text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.x_title h2 small {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.panel_toolbox {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.panel_toolbox a, .panel_toolbox button {
    background: none;
    border: none;
    color: #C5C7CB;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 2px;
}

.panel_toolbox a:hover, .panel_toolbox button:hover {
    color: var(--gentelella-active);
}

.x_content {
    position: relative;
    width: 100%;
}

/* ==========================================================================
   BUTTONS (GENTELELLA DESIGN)
   ========================================================================== */
.btn-gentelella-primary, .btn-primary {
    background: var(--gentelella-active) !important;
    border: 1px solid var(--gentelella-active) !important;
    color: #fff !important;
    padding: 7px 16px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.btn-gentelella-primary:hover, .btn-primary:hover {
    background: var(--gentelella-active-hover) !important;
    border-color: var(--gentelella-active-hover) !important;
}

.btn-gentelella-danger, .btn-danger {
    background: var(--gentelella-danger) !important;
    border: 1px solid var(--gentelella-danger) !important;
    color: #fff !important;
    padding: 7px 16px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s !important;
}

.btn-gentelella-danger:hover, .btn-danger:hover {
    background: #D62C1A !important;
    border-color: #D62C1A !important;
}

.btn-gentelella-default, .btn-secondary, .btn-sm {
    background: #F7F7F7 !important;
    border: 1px solid var(--gentelella-border-dark) !important;
    color: #555 !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s !important;
}

.btn-gentelella-default:hover, .btn-secondary:hover, .btn-sm:hover {
    background: #E6E9ED !important;
    color: #333 !important;
}

/* ==========================================================================
   TABS TOGGLING IN GENTELELLA
   ========================================================================== */
.tab-pane {
    position: absolute;
    left: -99999px;
    top: -99999px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

.tab-pane.active {
    position: static;
    left: auto;
    top: auto;
    opacity: 1;
    pointer-events: auto;
    height: auto;
    overflow: visible;
    animation: fadeInGentelella 0.25s ease-in-out;
}

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

/* ==========================================================================
   NOTIFICATION BANNERS (ERGONOMIC GENTELELLA ALERTS)
   ========================================================================== */
.msg-banner, .screen-video-banner, .call-banner {
    display: none;
    border-radius: 4px;
    padding: 14px 20px;
    margin-bottom: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
}

.msg-banner.active-banner {
    display: flex !important;
    background: #EBF5FB;
    border-color: #AED6F1;
    color: #1B4F72;
}

.screen-video-banner {
    background: #FDEDEC;
    border-color: #FADBD8;
    color: #78281F;
}

.screen-video-banner.active-banner, .screen-video-banner[style*="display: flex"] {
    display: flex !important;
}

.call-banner.active-banner {
    display: flex !important;
    background: #E8F8F5;
    border-color: #A3E4D7;
    color: #0E6251;
}

.call-banner.active-ringing {
    background: #FEF9E7;
    border-color: #F9E79F;
    color: #7D6608;
    border-width: 2px;
}

@keyframes pulseBorder {
    0%, 100% { border-color: #F9E79F; }
    50% { border-color: #F39C12; }
}

/* ==========================================================================
   LIVE SCREEN & PHONE CARD (GENTELELLA FIT)
   ========================================================================== */
.live-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
}

@media (max-width: 991px) {
    .live-layout {
        grid-template-columns: 1fr;
    }
}

.phone-card {
    background: #fff;
    border: 1px solid var(--gentelella-border);
    border-radius: 4px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.phone-mockup {
    width: 100%;
    max-width: 360px;
    background: #111827;
    border: 4px solid #374151;
    border-radius: 26px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    aspect-ratio: 9 / 20;
}

.phone-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    display: block;
}

.phone-snapshot-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111827;
    z-index: 1;
    display: block;
    transition: opacity 0.3s ease;
}

#player.phone-screen {
    z-index: 2;
    background: transparent !important;
}

.touch-overlay {
    position: absolute;
    inset: 0;
    cursor: pointer;
    z-index: 10;
}

.phone-earpiece-indicator {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #334155;
    border-radius: 2px;
    z-index: 20;
    transition: background 0.3s ease;
}

/* ==========================================================================
   LIVE MOCKUP ON-DEMAND & 5-SECOND SYNCHRONIZATION OVERLAY
   ========================================================================== */
.live-control-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #0f172a;
    z-index: 15;
    text-align: center;
}

.live-idle-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.live-idle-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(26, 187, 156, 0.12);
    border: 2px solid rgba(26, 187, 156, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #1ABB9C;
    margin-bottom: 16px;
}

.live-idle-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 4px;
}

.live-idle-desc {
    font-size: 11.5px;
    color: #94a3b8;
    margin-bottom: 22px;
    max-width: 240px;
    line-height: 1.4;
}

.btn-launch-live {
    background: #1ABB9C;
    border: none;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-launch-live:hover {
    background: #169F85;
}

.live-idle-hint {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 14px;
    font-weight: 500;
}

/* 5s Synchronization Box */
.live-sync-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sync-spinner-ring {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 3px solid rgba(26, 187, 156, 0.2);
    border-top-color: #1ABB9C;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    animation: syncSpin 1s linear infinite;
    position: relative;
    will-change: transform;
}

@keyframes syncSpin {
    to { transform: rotate(360deg); }
}

.sync-countdown-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 800;
    color: #1ABB9C;
    animation: syncCounterSpin 1s linear infinite reverse;
    will-change: transform;
}

@keyframes syncCounterSpin {
    to { transform: rotate(-360deg); }
}

.sync-title {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 4px;
}

.sync-desc {
    font-size: 11.5px;
    color: #94a3b8;
    margin-bottom: 16px;
    min-height: 18px;
}

.sync-progress-wrap {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 14px;
}

.sync-progress-bar {
    height: 100%;
    background: #1ABB9C;
    transition: width 0.3s ease;
}

.sync-details {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #cbd5e1;
}

/* Live Active Header (Floating atop video) */
.live-active-header {
    position: absolute;
    top: 14px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 25;
    pointer-events: auto;
}

.live-badge-pulse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(26, 187, 156, 0.4);
    color: #1ABB9C;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1ABB9C;
    animation: livePulse 1.2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.btn-stop-stream {
    background: rgba(239, 68, 68, 0.95);
    border: none;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s;
}

.btn-stop-stream:hover {
    background: #dc2626;
}


.phone-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    margin-top: 14px;
}

.action-btn {
    background: #fff;
    border: 1px solid var(--gentelella-border-dark);
    color: var(--gentelella-text-dark);
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--gentelella-active);
    border-color: var(--gentelella-active);
    color: #fff;
}

.action-btn.active {
    background: var(--gentelella-danger);
    border-color: var(--gentelella-danger);
    color: #fff;
}

/* ==========================================================================
   AUDIO DSP & HARDWARE REMOTE INSIDE GENTELELLA
   ========================================================================== */
.visualizer-wrapper {
    background: #1A2226;
    border-radius: 4px;
    height: 70px;
    width: 100%;
    overflow: hidden;
    margin: 12px 0;
}

#audioVisualizerCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.dsp-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.dsp-toggle-box {
    background: #F9FAFB;
    border: 1px solid var(--gentelella-border);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: #555;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.key-btn {
    background: #fff;
    border: 1px solid var(--gentelella-border-dark);
    border-radius: 4px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--gentelella-text-dark);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.key-btn:hover {
    background: #F2F5F7;
    border-color: var(--gentelella-active);
    color: var(--gentelella-active);
}

/* ==========================================================================
   MESSENGER TWO-COLUMN (GOOGLE MESSAGES / SMS / RCS)
   ========================================================================== */
.messenger-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    border: 1px solid var(--gentelella-border);
    border-radius: 4px;
    background: #fff;
    min-height: 520px;
    overflow: hidden;
}

@media (max-width: 860px) {
    .messenger-container {
        grid-template-columns: 1fr;
    }
}

.threads-panel {
    border-right: 1px solid var(--gentelella-border);
    display: flex;
    flex-direction: column;
    background: #FAFAFA;
}

.threads-header {
    padding: 12px;
    border-bottom: 1px solid var(--gentelella-border);
    background: #fff;
}

.threads-search-wrap {
    position: relative;
    width: 100%;
}

.threads-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.threads-search-input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid var(--gentelella-border-dark);
    border-radius: 20px;
    font-size: 12px;
    outline: none;
    background: #fff;
    box-sizing: border-box;
}

.threads-search-input:focus {
    border-color: var(--gentelella-active);
}

.threads-list {
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
}

.thread-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #F0F2F4;
    cursor: pointer;
    transition: background 0.15s;
}

.thread-item:hover {
    background: #F2F5F7;
}

.thread-item.active {
    background: #E8F8F5;
    border-left: 3px solid var(--gentelella-active);
}

.thread-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #34495E;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.thread-meta {
    flex: 1;
    min-width: 0;
}

.thread-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--gentelella-text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-preview {
    font-size: 11px;
    color: #73879C;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
}

.chat-header {
    padding: 12px 18px;
    border-bottom: 1px solid var(--gentelella-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FDFDFD;
}

.chat-history {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #F9FAFC;
}

.msg-bubble, .chat-bubble {
    max-width: 78%;
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}

.msg-bubble-in, .chat-bubble.received {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--gentelella-border);
    color: #2A3F54;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.msg-bubble-out, .chat-bubble.sent {
    align-self: flex-end;
    background: var(--gentelella-active);
    color: #fff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 6px rgba(26, 187, 156, 0.25);
}

.msg-bubble-time, .chat-meta {
    font-size: 10.5px;
    margin-top: 4px;
    text-align: right;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
}

.chat-bubble-wrap {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.chat-bubble-wrap.sent {
    align-items: flex-end;
}

.chat-bubble-wrap.received {
    align-items: flex-start;
}

.thread-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.thread-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.thread-time {
    font-size: 10.5px;
    color: #999;
    font-family: 'JetBrains Mono', monospace;
}

.thread-unread-badge {
    background: var(--gentelella-active);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.chat-composer {
    padding: 12px 16px;
    border-top: 1px solid var(--gentelella-border);
    display: flex;
    gap: 10px;
    background: #fff;
}

.chat-input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid var(--gentelella-border-dark);
    border-radius: 20px;
    font-size: 12.5px;
    outline: none;
}

.chat-input:focus {
    border-color: var(--gentelella-active);
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gentelella-active);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--gentelella-active-hover);
}

/* ==========================================================================
   DROPZONE & MEDIA GALLERY GRID (GENTELELLA FIT)
   ========================================================================== */
.dropzone {
    border: 2px dashed #CBD5E1;
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    background: #FAFAFA;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.dropzone:hover {
    border-color: var(--gentelella-active);
    background: rgba(26, 187, 156, 0.04);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.media-card {
    background: #fff;
    border: 1px solid var(--gentelella-border);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}

.media-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.09);
}

.media-thumb {
    width: 100%;
    height: 150px;
    background: #1A2226;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.media-thumb video, .media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-info {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.media-title, .media-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--gentelella-text-dark);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-sub, .media-meta {
    font-size: 11px;
    color: #73879C;
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.media-meta span {
    background: #F2F5F7;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.85;
    transition: all 0.2s;
}

.media-card:hover .play-overlay {
    opacity: 1;
    background: rgba(26, 187, 156, 0.45);
}

.media-video-placeholder {
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 4px;
}

.media-badge-tag {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #1ABB9C;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
}

.media-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

/* ==========================================================================
   DATA TABLES (AUTHENTIC GENTELELLA)
   ========================================================================== */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

table th {
    background: #F7F7F7;
    color: var(--gentelella-text-dark);
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 2px solid var(--gentelella-border);
    text-align: left;
}

table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gentelella-border);
    color: #555;
}

table tr:hover td {
    background: #F9FAFB;
}

/* ==========================================================================
   MODALS & TOASTS
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-backdrop.active, .modal-backdrop[style*="display: flex"] {
    display: flex !important;
}

.modal-box {
    background: #fff;
    border-radius: 4px;
    width: 90%;
    max-width: 520px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--gentelella-border);
}

.modal-video-box {
    max-width: 800px;
    background: #111827;
    border: 1px solid #374151;
}

.modal-video-box video {
    width: 100%;
    max-height: 70vh;
    border-radius: 4px;
    background: #000;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: #2A3F54;
    color: #fff;
    padding: 12px 18px;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--gentelella-active);
    animation: slideInToast 0.3s ease;
}

.toast-error {
    border-left-color: var(--gentelella-danger);
}

.toast-info {
    border-left-color: var(--gentelella-blue);
}

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

/* ==========================================================================
   PLYR VIDEO PLAYER THEME OVERRIDES (GENTELELLA PALETTE)
   ========================================================================== */
:root {
    --plyr-color-main: #1ABB9C;
    --plyr-video-control-color-hover: #169F85;
    --plyr-control-radius: 4px;
    --plyr-video-control-background-hover: rgba(26, 187, 156, 0.85);
}

.plyr {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.plyr--video {
    border-radius: 6px;
    overflow: hidden;
    background: #0d1117;
}

.plyr__control--overlaid {
    background: rgba(26, 187, 156, 0.9) !important;
    border-radius: 50% !important;
    padding: 18px !important;
    transition: background 0.15s !important;
}

.plyr__control--overlaid:hover {
    background: #1ABB9C !important;
}

.plyr__menu__container .plyr__control[aria-checked=true]::before {
    background: #1ABB9C !important;
}

/* ==========================================================================
   GENTELELLA V4 AUTH & LOGIN STYLES
   ========================================================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #F4F6F9;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid var(--gentelella-border-dark);
    border-radius: 8px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.07);
    padding: 36px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1ABB9C, #3498DB);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-brand .brand-icon {
    width: 38px;
    height: 38px;
    background: #1ABB9C;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(26,187,156,0.35);
}

.auth-brand .brand-name {
    font-size: 18px;
    font-weight: 700;
    color: #2A3F54;
    letter-spacing: -0.3px;
}

.auth-brand .brand-name small {
    font-size: 11px;
    font-weight: 600;
    background: rgba(26,187,156,0.12);
    color: #0E7864;
    padding: 2px 7px;
    border-radius: 12px;
    margin-left: 6px;
}

.auth-title {
    font-size: 20px;
    font-weight: 700;
    color: #2A3F54;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 13px;
    color: #73879C;
    margin-bottom: 24px;
}

.auth-input-group {
    position: relative;
    margin-bottom: 18px;
}

.auth-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #2A3F54;
    margin-bottom: 6px;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrapper i {
    position: absolute;
    left: 12px;
    color: #73879C;
    font-size: 14px;
}

.auth-input-wrapper input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    background: #fff;
    border: 1px solid var(--gentelella-border-dark);
    border-radius: 6px;
    font-size: 13.5px;
    color: #2A3F54;
    outline: none;
    transition: all 0.2s;
}

.auth-input-wrapper input:focus {
    border-color: #1ABB9C;
    box-shadow: 0 0 0 3px rgba(26, 187, 156, 0.15);
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 20px;
    font-size: 12.5px;
    color: #73879C;
}

.auth-actions a {
    color: #1ABB9C;
    text-decoration: none;
    font-weight: 500;
}

.auth-actions a:hover {
    text-decoration: underline;
}

.auth-btn-submit {
    width: 100%;
    height: 42px;
    background: #1ABB9C;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 6px rgba(26,187,156,0.3);
}

.auth-btn-submit:hover {
    background: #169F85;
}

.auth-btn-submit:active {
    transform: translateY(1px);
}

.demo-credentials-box {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #E6E9ED;
}

.demo-credentials-box .demo-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #9aa8b6;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-align: center;
}

.demo-pills-row {
    display: flex;
    gap: 8px;
}

.demo-pill-btn {
    flex: 1;
    padding: 8px 10px;
    background: #F8F9FA;
    border: 1px solid #D9DEE4;
    border-radius: 4px;
    font-size: 11.5px;
    color: #5A738E;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-pill-btn:hover {
    background: rgba(26,187,156,0.08);
    border-color: #1ABB9C;
    color: #0E7864;
}

.auth-error-alert {
    display: none;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #c0392b;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    margin-bottom: 18px;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   BOTTOM NAVIGATION BAR — mobile uniquement
   ========================================================================== */

.mobile-bottom-nav {
    display: none; /* caché par défaut (desktop) */
}

@media (max-width: 768px) {

    /* ----- Cacher la sidebar desktop ----- */
    .col-md-3.left_col {
        display: none !important;
    }

    /* ----- Layout pleine largeur ----- */
    .top_nav   { margin-left: 0 !important; height: 50px; padding: 0 12px; }
    .right_col { margin-left: 0 !important; padding: 10px 12px 80px !important; }
    footer     { margin-left: 0 !important; margin-bottom: 64px; }

    /* ----- Topbar mobile ----- */
    .top_status_pills .status_pill:not(.always-show) { display: none !important; }
    #topNavUserName { display: none !important; }
    #btnSyncPhoneTop span { display: none !important; }
    #btnSyncPhoneTop { padding: 5px 9px !important; }
    .topbar-page-title { display: inline-block !important; }

    /* ----- Bottom Nav Bar ----- */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        background: rgba(10, 17, 34, 0.97);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        height: 64px;
        align-items: stretch;
        justify-content: space-around;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px); /* iPhone notch */
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        gap: 4px;
        color: #64748b;
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.02em;
        transition: color 0.15s;
        padding: 8px 4px;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item i {
        font-size: 20px;
        transition: transform 0.15s, color 0.15s;
    }

    .mobile-nav-item span {
        font-size: 9.5px;
        white-space: nowrap;
    }

    .mobile-nav-item:hover,
    .mobile-nav-item:active {
        color: #00f0ff;
    }

    .mobile-nav-item:active i {
        transform: scale(0.88);
    }

    /* Item actif */
    .mobile-nav-item.active {
        color: #00f0ff;
    }

    .mobile-nav-item.active i {
        color: #00f0ff;
        filter: drop-shadow(0 0 6px rgba(0,240,255,0.6));
    }

    /* Indicateur actif (trait en haut) */
    .mobile-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: #00f0ff;
        border-radius: 0 0 3px 3px;
        box-shadow: 0 0 8px rgba(0,240,255,0.7);
    }

    /* Badge notifications */
    .mobile-nav-badge {
        position: absolute;
        top: 6px;
        right: calc(50% - 16px);
        background: #ef4444;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        border-radius: 10px;
        padding: 1px 5px;
        min-width: 16px;
        text-align: center;
        line-height: 1.4;
    }

    /* Topbar mobile : page title */
    .topbar-page-title {
        font-weight: 700;
        font-size: 14px;
        color: #2A3F54;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px;
    }
}

/* ----- Très petit (≤ 400px) ----- */
@media (max-width: 400px) {
    .mobile-bottom-nav { height: 60px; }
    .mobile-nav-item i { font-size: 18px; }
    .mobile-nav-item span { font-size: 9px; }
    .right_col { padding: 8px 10px 76px !important; }
}

/* ----- Tablette (769px – 1024px) : sidebar plus étroite ----- */
@media (min-width: 769px) and (max-width: 1024px) {
    .col-md-3.left_col { width: 200px; }
    .top_nav            { margin-left: 200px; }
    .right_col          { margin-left: 200px; padding: 12px 18px 30px; }
    footer              { margin-left: 200px; }
    .mobile-bottom-nav  { display: none !important; }
}

/* ----- nav-sm (collapse sidebar desktop) ----- */
body.nav-sm .col-md-3.left_col { width: 70px; }
body.nav-sm .top_nav  { margin-left: 70px; }
body.nav-sm .right_col{ margin-left: 70px; }
body.nav-sm footer    { margin-left: 70px; }
