/* ==========================================================================
   OmniStream Step-by-Step Architecture & Design System
   Updated with Group Management Tags & Clean Layout
   ========================================================================== */

:root, body.theme-light {
    /* Executive Light Theme Palette (Default) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    
    --border-color: #e2e8f0;
    --border-highlight: rgba(79, 70, 229, 0.4);
    
    --accent-primary: #4f46e5;
    --accent-secondary: #6366f1;
    --accent-highlight: #4338ca;
    --accent-indigo: #4f46e5;
    --accent-purple: #7c3aed;
    --accent-pink: #db2777;
    --accent-emerald: #059669;
    --accent-rose: #e11d48;
    --accent-amber: #d97706;
    --accent-cyan: #0891b2;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Midnight Studio Theme */
body.theme-midnight {
    --bg-primary: #0a0d14;
    --bg-secondary: #111622;
    --bg-tertiary: #182032;
    --bg-card: rgba(24, 32, 50, 0.7);
    --bg-card-hover: rgba(30, 41, 64, 0.9);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.4);
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-highlight: #ec4899;
    --accent-indigo: #6366f1;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
}

/* Daeratulaqeeq Theme */
body.theme-daeratulaqeeq {
    --bg-primary: #fff8f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fdedee;
    --bg-card: #ffffff;
    --bg-card-hover: #fdedee;
    --border-color: rgba(207, 96, 108, 0.2);
    --border-highlight: rgba(207, 96, 108, 0.6);
    --accent-primary: #cf606c;
    --accent-secondary: #e1c3bf;
    --accent-highlight: #fdedee;
    --accent-indigo: #cf606c;
    --text-primary: #2d171a;
    --text-secondary: #6e4549;
    --shadow-glow: 0 0 25px rgba(207, 96, 108, 0.2);
}

/* Fatimid Jade Theme */
body.theme-fatimid-jade {
    --bg-primary: #f4f8f6;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8f3f1;
    --bg-card: #ffffff;
    --bg-card-hover: #e8f3f1;
    --border-color: rgba(19, 118, 110, 0.2);
    --border-highlight: rgba(19, 118, 110, 0.6);
    --accent-primary: #13766e;
    --accent-secondary: #d4a018;
    --accent-highlight: #f7efe1;
    --accent-indigo: #13766e;
    --text-primary: #0a2622;
    --text-secondary: #2c5953;
    --shadow-glow: 0 0 25px rgba(19, 118, 110, 0.2);
}

/* Fatimid Maroon Theme */
body.theme-fatimid-maroon {
    --bg-primary: #fcf6f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f6e8e2;
    --bg-card: #ffffff;
    --bg-card-hover: #f6e8e2;
    --border-color: rgba(124, 45, 60, 0.2);
    --border-highlight: rgba(124, 45, 60, 0.6);
    --accent-primary: #7c2d3c;
    --accent-secondary: #c89b3c;
    --accent-highlight: #f6e8e2;
    --accent-indigo: #7c2d3c;
    --text-primary: #2b0f14;
    --text-secondary: #632a35;
    --shadow-glow: 0 0 25px rgba(124, 45, 60, 0.2);
}

/* Fatimid Sapphire Theme */
body.theme-fatimid-sapphire {
    --bg-primary: #f4f7fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef4fb;
    --bg-card: #ffffff;
    --bg-card-hover: #eef4fb;
    --border-color: rgba(29, 77, 144, 0.2);
    --border-highlight: rgba(29, 77, 144, 0.6);
    --accent-primary: #1d4d90;
    --accent-secondary: #d4a53a;
    --accent-highlight: #eef4fb;
    --accent-indigo: #1d4d90;
    --text-primary: #0a1b33;
    --text-secondary: #2a4773;
    --shadow-glow: 0 0 25px rgba(29, 77, 144, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-y: auto; }

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* GLOBAL HIDDEN UTILITY - STRICT HIDE & UNBLOCK CLICKS */
.hidden {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* LOGO IMAGE STYLES */
.brand-logo-img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.3)); }
.auth-logo-img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(79, 70, 229, 0.4)); }
.watermark-logo-img { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; margin-right: 4px; }

/* PRESET EXPIRATION BUTTONS */
.preset-pill-btn {
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    color: var(--text-secondary); padding: 6px 12px; border-radius: 6px;
    font-size: 0.75rem; font-family: var(--font-mono); font-weight: 600; cursor: pointer; transition: var(--transition-fast);
}

.preset-pill-btn:hover { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }

/* APP HEADER */
.app-header {
    height: 64px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
    z-index: 100; position: sticky; top: 0; box-shadow: var(--shadow-subtle);
}

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

.sidebar-toggle-btn {
    background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-primary);
    width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition-fast);
}

.sidebar-toggle-btn:hover { background: rgba(0, 0, 0, 0.05); border-color: var(--text-muted); }
.logo-area { display: flex; align-items: center; gap: 12px; }
.brand-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 6px; color: var(--text-primary); }
.badge-pro { font-size: 0.65rem; background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); color: #fff; padding: 2px 6px; border-radius: 4px; font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* Theme Picker Dropdown */
.theme-picker-wrapper { position: relative; }
.theme-swatch-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-primary); border: 1px solid #fff; }

.theme-dropdown-menu {
    position: absolute; top: 100%; right: 0; margin-top: 8px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 8px; min-width: 220px;
    box-shadow: var(--shadow-subtle); display: flex; flex-direction: column; gap: 4px;
    z-index: 150; opacity: 0; pointer-events: none; transform: translateY(-8px);
    transition: var(--transition-fast);
}

.theme-picker-wrapper.open .theme-dropdown-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }

.theme-option-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: transparent; border: 1px solid transparent; border-radius: var(--radius-md);
    color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; cursor: pointer;
}

.theme-option-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.theme-option-item.active { border-color: var(--accent-primary); background: var(--bg-tertiary); color: var(--text-primary); }
.palette-preview-dots { display: flex; align-items: center; gap: 3px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; border: 1px solid transparent; transition: var(--transition-fast);
}

.btn i { width: 16px; height: 16px; }

.btn-primary { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background: rgba(0, 0, 0, 0.05); border-color: var(--text-muted); }
.btn-danger { background: linear-gradient(135deg, var(--accent-rose), #dc2626); color: #fff; }

/* AUTHENTICATION PAGE */
.auth-page-wrapper {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, var(--bg-tertiary) 0%, var(--bg-primary) 70%);
    display: flex; align-items: center; justify-content: center; z-index: 500; padding: 20px; overflow-y: auto;
}

.auth-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); padding: 40px 36px; width: 100%; max-width: 440px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
}

.auth-card .auth-logo-badge {
    width: 72px; height: 72px; background: var(--bg-tertiary);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-glow);
}

.auth-title { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.auth-desc { font-size: 0.85rem; color: var(--text-muted); }
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }

.its-input-wrapper input {
    width: 100%; background: var(--bg-tertiary); border: 2px solid var(--border-color);
    border-radius: var(--radius-md); padding: 14px 16px; font-family: var(--font-mono);
    font-size: 1.25rem; font-weight: 700; letter-spacing: 3px; color: var(--text-primary); text-align: center; outline: none; transition: var(--transition-fast);
}

.its-input-wrapper input:focus { border-color: var(--accent-primary); box-shadow: var(--shadow-glow); }
.its-warning { font-size: 0.75rem; color: var(--accent-rose); display: none; }

/* MAIN WORKSPACE & RESPONSIVE SIDEBAR */
.main-app-workspace { display: flex; flex: 1; min-height: calc(100vh - 64px); height: auto; position: relative; overflow: visible; }

.sidebar-backdrop {
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px);
    z-index: 250; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; display: none;
}

.sidebar-backdrop.active { opacity: 1; pointer-events: auto; display: block; }

.app-sidebar {
    width: 250px; background: var(--bg-secondary); border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; justify-content: space-between; padding: 16px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s, opacity 0.2s;
    overflow-x: hidden; position: sticky; top: 64px; height: calc(100vh - 64px); z-index: 90;
    box-shadow: var(--shadow-subtle);
}

.app-sidebar.collapsed { width: 0; padding: 16px 0; border-right: none; opacity: 0; pointer-events: none; }

.sidebar-nav-group { display: flex; flex-direction: column; gap: 6px; }
.sidebar-nav-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 10px 8px 4px 8px; }

.sidebar-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-md);
    background: transparent; border: none; color: var(--text-secondary); font-family: var(--font-heading);
    font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: var(--transition-fast); text-align: left;
    white-space: nowrap;
}

.sidebar-link i { width: 18px; height: 18px; color: var(--accent-primary); flex-shrink: 0; }
.sidebar-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.sidebar-link.active { background: var(--accent-primary); color: #fff; box-shadow: 0 0 12px rgba(79, 70, 229, 0.3); }
.sidebar-link.active i { color: #fff; }

.sidebar-link.admin-highlight { background: rgba(225, 29, 72, 0.1); border: 1px solid rgba(225, 29, 72, 0.2); color: var(--accent-rose); }
.sidebar-link.admin-highlight i { color: var(--accent-rose); }
.sidebar-link.admin-highlight:hover { background: rgba(225, 29, 72, 0.2); color: var(--accent-rose); }

.sidebar-user-footer { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.sidebar-user-card { display: flex; align-items: center; gap: 10px; background: var(--bg-tertiary); padding: 10px; border-radius: var(--radius-md); }
.user-avatar-circle { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; flex-shrink: 0; }
.user-card-meta { display: flex; flex-direction: column; overflow: hidden; }
.user-card-name { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.user-card-its { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

/* DASHBOARD VIEWPORT & CATALOG GRID HUB */
.dashboard-viewport {
    flex: 1; display: flex; flex-direction: column; padding: 20px 24px 60px 24px; gap: 24px;
    overflow-y: auto; min-height: calc(100vh - 64px); background: var(--bg-primary); width: 100%;
}

.catalog-header-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.catalog-section-title { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--text-primary); }
.assigned-count-badge { font-size: 0.78rem; font-family: var(--font-mono); background: var(--bg-tertiary); border: 1px solid var(--border-color); padding: 4px 12px; border-radius: 12px; color: var(--accent-primary); font-weight: 700; }

.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* DEDICATED THEATER MODE SINGLE VIDEO STREAM WATCH VIEWPAGE */
.theater-watch-viewport {
    flex: 1; display: flex; flex-direction: column; padding: 20px 24px 60px 24px; gap: 20px;
    overflow-y: auto; min-height: calc(100vh - 64px); background: var(--bg-primary); width: 100%;
}

.theater-header-bar {
    display: flex; align-items: center; gap: 20px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    padding: 14px 20px; border-radius: var(--radius-lg); box-shadow: var(--shadow-subtle);
}

.theater-title-group { display: flex; align-items: center; gap: 12px; }
.theater-title-group h3 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }

.theater-stage-container {
    width: 100%; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
}

/* YOUTUBE-STYLE LIVE COMMENTS PANEL BELOW VIDEO PLAYER */
.live-chat-panel {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px;
    box-shadow: var(--shadow-subtle); margin-top: 8px;
}

.chat-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.chat-header h4 { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.chat-count-tag { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-primary); background: rgba(79, 70, 229, 0.1); padding: 2px 8px; border-radius: 4px; font-weight: 700; }

.chat-feed-box {
    max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
    padding-right: 6px;
}

.chat-item {
    display: flex; gap: 12px; background: var(--bg-tertiary); padding: 10px 14px;
    border-radius: var(--radius-md); border: 1px solid var(--border-color);
}

.chat-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--accent-primary);
    color: #fff; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.chat-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.chat-meta { display: flex; align-items: center; justify-content: space-between; }
.chat-user { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.chat-its { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-cyan); margin-left: 6px; font-weight: 600; }
.chat-time { font-size: 0.7rem; color: var(--text-muted); }
.chat-text { font-size: 0.85rem; color: var(--text-primary); line-height: 1.4; }

.chat-input-form { display: flex; gap: 10px; margin-top: 4px; }
.chat-input-form input {
    flex: 1; background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 10px 14px; color: var(--text-primary); font-size: 0.85rem; outline: none;
}
.chat-input-form input:focus { border-color: var(--accent-primary); }

/* EMPTY STREAM STATE CARD */
.empty-stream-card {
    grid-column: 1 / -1; background: var(--bg-secondary); border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl); padding: 60px 20px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; gap: 14px;
}

.empty-stream-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.empty-stream-icon i { width: 32px; height: 32px; }
.empty-stream-title { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.empty-stream-sub { font-size: 0.85rem; color: var(--text-muted); max-width: 400px; }

/* THUMBNAIL CARDS - HIGH PRIORITY CLICK TARGETS */
.video-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    overflow: hidden; display: flex; flex-direction: column; transition: var(--transition-fast);
    box-shadow: var(--shadow-subtle); position: relative; cursor: pointer !important; z-index: 10;
}
.video-card:hover { border-color: var(--border-highlight); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); }
.video-thumb { width: 100%; aspect-ratio: 16 / 9; background: var(--bg-tertiary); position: relative; overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.95; pointer-events: none; }

.badge-live-tag { position: absolute; top: 10px; left: 10px; background: var(--accent-rose); color: #fff; font-size: 0.68rem; font-weight: 800; padding: 2px 8px; border-radius: 4px; pointer-events: none; }
.badge-expiry { position: absolute; top: 10px; right: 10px; background: rgba(217, 119, 6, 0.9); color: #fff; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; backdrop-filter: blur(4px); pointer-events: none; }
.badge-expired { position: absolute; top: 10px; right: 10px; background: rgba(225, 29, 72, 0.9); color: #fff; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; pointer-events: none; }

.btn-play-card { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.85); width: 52px; height: 52px; border-radius: 50%; background: var(--accent-primary); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: var(--transition-fast); border: none; cursor: pointer; box-shadow: var(--shadow-glow); pointer-events: none; }
.video-card:hover .btn-play-card { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.video-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.video-card-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.video-card-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; justify-content: space-between; }

/* CRUD TABLE TAGS, GROUPS & ACTIONS */
.its-tags-wrapper { display: flex; flex-wrap: wrap; gap: 4px; }

.its-tag-chip {
    font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    padding: 2px 6px; border-radius: 4px; color: var(--accent-cyan);
    display: inline-flex; align-items: center; gap: 4px;
}

.group-tag-chip {
    font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700;
    background: rgba(124, 58, 237, 0.1); border: 1px solid rgba(124, 58, 237, 0.3);
    padding: 2px 6px; border-radius: 4px; color: var(--accent-purple);
    display: inline-flex; align-items: center; gap: 4px;
}

.btn-action-sm {
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    color: var(--text-secondary); padding: 4px 8px; border-radius: var(--radius-sm);
    font-size: 0.75rem; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
    transition: var(--transition-fast);
}

.btn-action-sm:hover { background: rgba(0, 0, 0, 0.05); color: var(--text-primary); }
.btn-action-sm.danger:hover { background: rgba(225, 29, 72, 0.15); color: var(--accent-rose); border-color: var(--accent-rose); }

.stage-canvas {
    width: 100%; aspect-ratio: 16 / 9; background: #000;
    border-radius: var(--radius-lg); border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); position: relative; overflow: hidden;
}

.iframe-layer { width: 100%; height: 100%; border: none; position: absolute; top: 0; left: 0; }
.stream-overlay-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }
.watermark-logo { position: absolute; top: 16px; right: 16px; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); padding: 6px 14px; border-radius: var(--radius-md); font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 6px; border: 1px solid rgba(255, 255, 255, 0.15); }

.shield-interaction-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 30; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.shield-badge-notice { position: absolute; top: 16px; left: 16px; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(8px); border: 1px solid rgba(5, 150, 105, 0.4); padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.72rem; color: #34d399; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.shield-feedback-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--accent-primary); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(0.7); transition: transform 0.25s, opacity 0.25s; box-shadow: var(--shadow-glow); pointer-events: none; }
.shield-feedback-icon.animate { opacity: 1; transform: scale(1); }

.custom-transport-module { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-subtle); }
.timeline-container { width: 100%; height: 18px; display: flex; align-items: center; position: relative; cursor: pointer; }
.timeline-track { width: 100%; height: 6px; background: var(--bg-tertiary); border-radius: 3px; position: relative; overflow: hidden; }
.timeline-progress { position: absolute; top: 0; left: 0; height: 100%; background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); width: 0%; }
.timeline-handle { position: absolute; top: 50%; left: 0%; transform: translate(-50%, -50%) scale(0); width: 14px; height: 14px; border-radius: 50%; background: var(--accent-primary); }
.timeline-container:hover .timeline-handle { transform: translate(-50%, -50%) scale(1); }

.controls-bar { display: flex; align-items: center; justify-content: space-between; }
.controls-group { display: flex; align-items: center; gap: 8px; }
.ctrl-btn { background: transparent; border: none; color: var(--text-secondary); width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ctrl-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.ctrl-btn.main-play { background: var(--accent-primary); color: #fff; width: 40px; height: 40px; border-radius: 50%; box-shadow: var(--shadow-glow); }

/* ADMIN PANEL MODAL */
.admin-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(10px); z-index: 400; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.admin-modal-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-xl); width: 100%; max-width: 1050px; height: 88vh; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; overflow: hidden; }
.admin-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border-color); }
.admin-modal-header h3 { font-family: var(--font-heading); font-size: 1.2rem; display: flex; align-items: center; gap: 10px; color: var(--accent-rose); }
.admin-modal-body { display: grid; grid-template-columns: 240px 1fr; flex: 1; overflow: hidden; }
.admin-sub-sidebar { background: var(--bg-tertiary); border-right: 1px solid var(--border-color); padding: 16px; display: flex; flex-direction: column; gap: 6px; }

.admin-subtab-btn { background: transparent; border: none; padding: 10px 12px; border-radius: var(--radius-md); color: var(--text-secondary); font-family: var(--font-heading); font-size: 0.85rem; font-weight: 600; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: var(--transition-fast); }
.admin-subtab-btn:hover { background: rgba(0, 0, 0, 0.05); color: var(--text-primary); }
.admin-subtab-btn.active { background: var(--accent-primary); color: #fff; }
.admin-subtab-panel { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-top: 10px; }
.data-table th { text-align: left; padding: 10px 14px; background: var(--bg-tertiary); color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border-color); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); }
.bulk-its-textarea { width: 100%; height: 90px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 10px; color: var(--text-primary); font-family: var(--font-mono); font-size: 0.85rem; outline: none; }

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 992px) {
    .app-sidebar {
        position: fixed; top: 64px; left: 0; bottom: 0; width: 260px; height: calc(100vh - 64px);
        z-index: 300; transform: translateX(-100%); opacity: 1 !important; pointer-events: auto !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15); transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .app-sidebar.drawer-open {
        transform: translateX(0);
    }

    .dashboard-viewport, .theater-watch-viewport {
        padding: 16px;
    }

    .admin-modal-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .admin-sub-sidebar {
        border-right: none; border-bottom: 1px solid var(--border-color); flex-direction: row; overflow-x: auto;
    }

    .admin-subtab-btn {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .app-header { padding: 0 12px; }
    .brand-title { font-size: 0.95rem; }
    .catalog-grid { grid-template-columns: 1fr; }
    .theater-header-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .controls-bar { flex-wrap: wrap; justify-content: center; gap: 12px; }
    .admin-modal-card { height: 95vh; margin: 10px; }
}
