/* ============================================================================
   UNIVERSAL THEME VARIABLES MATRIX STREAMS (CMS REGISTRY DATA MAPPED)
   ============================================================================ */
:root {
    --bg-deep: #0f172a;
    --bg-surface: #1e293b;
    --bg-elevated: #334155;
    --primary-sky: #0ea5e9;
    --primary-glow: #38bdf8;
    --accent-tint: #e0f2fe;
    
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-error: #ef4444;
    --status-alert: #ef4444;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --radius-md: 6px;
    --radius-lg: 12px;
}

/* ============================================================================
   MASTER STRUCTURAL BACKBONE FRAMEWORK GRIDS
   ============================================================================ */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-deep) !important;
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.platform-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.platform-sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--bg-elevated);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Isolated layout containment: Only forces solid backgrounds and scroll constraints on mobile screens */
@media (max-width: 991px) {
    .platform-sidebar {
        min-height: 100vh !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
        background-color: var(--bg-surface) !important;
    }
}


.sidebar-logo-wrapper {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid var(--bg-elevated);
}

.sidebar-logo-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-md);
}

.sidebar-menu-links {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: auto !important;
}

.sidebar-section-heading {
    color: var(--primary-sky);
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.sidebar-divider-block {
    border-top: 1px solid var(--bg-elevated);
    margin-top: 15px !important;
    padding-top: 15px;
}

.platform-viewport {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.platform-header {
    height: 70px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    flex-shrink: 0;
    position: relative !important; /* Establishes a rock-solid midpoint boundary line */
    overflow: visible !important; /* Guarantees your ad's rounded corners are never cropped */
}

.header-section-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--accent-tint);
}

.header-credentials-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-user-role-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.text-glow-accent {
    color: var(--primary-sky);
}

.text-main-profile {
    color: var(--text-main);
}

.header-status-indicator-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--status-success);
    border-radius: 50%;
}

.platform-content {
    padding: 30px;
    flex-grow: 1;
    background-color: var(--bg-deep);
    overflow-y: auto;
}

/* ============================================================================
   INTERFACE COMPONENT CARDS & NAVIGATION OVERRIDES
   ============================================================================ */
.enterprise-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 25px;
}

.admin-nav-link, 
.admin-nav-link:visited {
    display: block !important;
    color: var(--text-muted) !important;
    padding: 10px 14px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 4px !important;
    transition: all 0.2s ease !important;
}

.admin-nav-link:hover {
    color: var(--text-main) !important;
    background-color: var(--bg-elevated) !important;
}

.admin-nav-link.active-tab,
.admin-nav-link.active-tab:visited {
    color: var(--text-main) !important;
    background-color: var(--primary-sky) !important;
    font-weight: bold !important;
}

.sidebar-store-external-link {
    display: block;
    color: var(--primary-glow);
    padding: 10px 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.sidebar-logout-btn {
    display: block;
    color: var(--status-error);
    padding: 10px 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-top: 10px;
}

/* ============================================================================
   ACCOUNTING MATRIX OVERRIDES: FORM CONTROLS & HYPERLINK HOOKS
   ============================================================================ */
.enterprise-card select,
.enterprise-card input[type="file"],
.enterprise-card .form-control {
    background-color: var(--bg-deep) !important;
    border: 1px solid var(--bg-elevated) !important;
    color: var(--text-main) !important;
    border-radius: var(--radius-md) !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
}

.enterprise-card select:focus,
.enterprise-card input:focus {
    border-color: var(--primary-sky) !important;
    outline: none !important;
}

/* GLOBAL SPECIFICITY LINKS OVERRIDE - BYPASSED VIA COMMENT OVERRIDE TO RESTORE LEGIBILITY
.enterprise-card a,
.enterprise-card a:visited {
    color: var(--primary-sky) !important;
    text-decoration: none !important;
    font-weight: bold !important;
    transition: color 0.2s ease !important;
}

.enterprise-card a:hover {
    color: var(--primary-glow) !important;
    text-decoration: underline !important;
}
*/
/* ============================================================================
   THE ATOMIC TRIPLE-TARGET CHAIN: LOCKS ELEMENT TO PRISTINE BLACK & WHITE
   ============================================================================ */
.enterprise-card a.btn-override-black,
.enterprise-card button.btn-override-black,
.enterprise-card input[type="submit"].btn-override-black,
.enterprise-card .btn-override-black {
    color: #000000 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    text-transform: uppercase !important;
    font-weight: 800 !important;
    border: 1px solid #000000 !important;
    display: inline-block !important;
    padding: 6px 14px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
}

.enterprise-card a.btn-override-black:hover,
.enterprise-card button.btn-override-black:hover,
.enterprise-card input[type="submit"].btn-override-black:hover,
.enterprise-card .btn-override-black:hover {
    background-color: #f1f5f9 !important;
    background: #f1f5f9 !important;
    color: #000000 !important;
    text-decoration: none !important;
    border-color: #000000 !important;
}
/* ============================================================================
   CMS VARIANT OVERRIDES: DYNAMIC STOREFRONT INTERFACE GRIDS
   ============================================================================ */

/* VARIANT 1: MATRIX STREAM (High-Density Spreadsheet View) */
.layout-matrix_stream .catalog-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}
.layout-matrix_stream .catalog-grid .enterprise-card {
    flex-direction: row !important;
    align-items: center !important;
    padding: 12px 20px !important;
    gap: 20px !important;
}
.layout-matrix_stream .catalog-grid .product-img-canvas,
.layout-matrix_stream .catalog-grid .product-img-placeholder {
    width: 60px !important;
    height: 60px !important;
    margin-bottom: 0 !important;
}

/* VARIANT 2: SHOWCASE CANVAS (Luxury Large Image Cards) */
.layout-showcase_canvas .catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)) !important;
    gap: 30px !important;
}
.layout-showcase_canvas .catalog-grid .product-img-canvas {
    height: 260px !important;
}

/* VARIANT 3: COMMAND TERMINAL (Fixed Left Category Sidebar Split) */
@media (min-width: 992px) {
    .layout-command_terminal .store-container {
        display: grid !important;
        grid-template-columns: 240px 1fr !important;
        gap: 30px !important;
        align-items: start !important;
    }
    /* Forces the categories row to act as a permanent side menu */
    .layout-command_terminal .store-container > div:nth-child(2) {
        flex-direction: column !important;
        border-bottom: none !important;
        border-right: 1px solid var(--bg-elevated) !important;
        padding-right: 15px !important;
        height: auto !important;
    }
}

/* VARIANT 4: FEED PIPELINE (Single Column Social Stream Layout) */
.layout-feed_pipeline .catalog-grid {
    grid-template-columns: 1fr !important;
    max-width: 680px !important;
    margin: 30px auto 0 auto !important;
}
.layout-feed_pipeline .catalog-grid .product-img-canvas {
    height: 320px !important;
}

/* ============================================================================
   FLAWLESS SELF-HEALING MOBILE CONSTRICTIONS
   ============================================================================ */
@media (max-width: 768px) {
    .catalog-grid {
        grid-template-columns: 1fr !important;
        display: grid !important;
        gap: 15px !important;
    }
    .catalog-grid .enterprise-card {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 16px !important;
    }
    .catalog-grid .product-img-canvas,
    .catalog-grid .product-img-placeholder {
        width: 100% !important;
        height: 180px !important;
        margin-bottom: 12px !important;
    }
}
