/* ==========================================================================
   ROOT VARIABLES & RESETS
   ========================================================================== */
:root {
    --primary-orange: #ff7f00;
    --text-orange: #e66a00; /* Darker orange for readable text on light backgrounds */
    --dark-bg: #000000;
    --text-dark: #333333;
    --text-light: #ffffff;
    --bg-surface: #ffffff; /* White cards and panels */
    --bg-panel: #f5f7fa;   /* Subtle gray builder background */
    --border-light: #eaeaea; /* Clean standard borders */
    --font-main: "Open Sans", Arial, sans-serif;
    --font-heading: "Abolition", Impact, sans-serif;
    --sticky-offset: 0px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #f5f7fa; /* Default light background */
}

a { 
    text-decoration: none; 
    color: inherit; 
}

img { 
    max-width: 100%; 
    height: auto; 
    display: block; 
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* ==========================================================================
   GLOBAL UTILITIES
   ========================================================================== */
.section-pad { padding: 70px 0; }
.bg-white { background-color: #ffffff; }
.bg-light { background-color: #f5f7fa; border-top: 1px solid #eaeaea; border-bottom: 1px solid #eaeaea; }
.bg-orange { background-color: var(--primary-orange); color: #ffffff; }
.bg-dark { background-color: #121212; color: #e0e0e0; }

/* ==========================================================================
   HEADER & TOP BAR (From header.php)
   ========================================================================== */
.top-bar { 
    background-color: var(--primary-orange); 
    color: var(--text-light); 
    padding: 8px 0; 
    font-size: 0.9em; 
}
.top-bar .container { 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    gap: 20px; 
}

.top-support-btn {
    background-color: #ffffff; color: var(--primary-orange) !important; padding: 6px 14px;
    border-radius: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    display: inline-flex; align-items: center; gap: 6px; transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); font-size: 0.95em;
}
.top-support-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.3); background-color: #f9f9f9; }
.top-support-btn span { font-size: 1.2em; }

header {
    background: #fff; padding: 20px 0; width: 100%; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    color: var(--text-dark); position: sticky; top: 0; transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}
header.shrink { padding: 5px 0; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 110px; width: auto; transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
header.shrink .logo img { height: 60px; }
nav ul { display: flex; list-style: none; gap: 25px; font-weight: 600; text-transform: uppercase; font-family: var(--font-heading); font-size: 1.5rem; letter-spacing: 1px; align-items: center; }
nav a { color: var(--text-dark) !important; transition: color 0.2s; }
nav a:hover { color: var(--primary-orange) !important; }
nav a.active { color: var(--primary-orange) !important; font-weight: bold; }

.page-hero { background: url('images/pcz4u-hero-bg.jpg') center center / cover no-repeat, var(--primary-orange); color: #fff; padding: 80px 20px; text-align: center; overflow: hidden; }
.page-hero h1 { font-family: var(--font-heading); font-size: 4.5rem; text-transform: uppercase; margin: 15px 0; font-weight: 400; letter-spacing: 1px; line-height: 1; }
.page-hero h1 span { color: #000; }
.page-hero img { margin: 0 auto; }

/* ==========================================================================
   FOOTER (From footer.php)
   ========================================================================== */
footer {
    padding-top: 10px !important; 
    padding-bottom: 0 !important; 
    background-color: #000;
    color: #fff;
    font-family: var(--font-main);
}
.footer-content {
    display: grid;
    grid-template-columns: auto auto auto auto; 
    justify-content: center; 
    gap: 60px; 
    align-items: center; 
    padding-bottom: 25px !important; 
}
.footer-logo img {
    max-width: 100%;
    height: auto;
    margin: 0 auto; 
    display: block;
}
.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-menu li { margin-bottom: 8px; }
.footer-menu a {
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px; 
    transition: color 0.2s ease;
}
.footer-menu a:hover { color: var(--primary-orange); }
.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 10px; 
}
.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 8px; 
}
.contact-item span.icon {
    font-size: 1.2rem;
    line-height: 1.2;
}
.contact-item p {
    margin: 0;
    line-height: 1.4;
    font-size: 0.95rem;
}
.map-wrapper {
    position: relative; width: 180px; height: 180px; border-radius: 6px; overflow: hidden; 
    cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.5); transition: transform 0.3s ease;
}
.map-wrapper:hover { transform: scale(1.05); }
.map-trigger-square { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.3s ease; }
.map-wrapper:hover .map-trigger-square { opacity: 0.85; }
.map-overlay-text {
    position: absolute; bottom: 0; left: 0; right: 0; background-color: rgba(0, 0, 0, 0.8); 
    color: #fff; text-align: center; padding: 10px 5px; font-size: 0.85rem; font-weight: bold; 
    pointer-events: none; text-transform: uppercase; letter-spacing: 0.5px;
}
.footer-bottom {
    background-color: var(--primary-orange); 
    padding: 15px 20px !important; margin-top: 0 !important; 
    text-align: center; font-size: 0.9rem; color: #000; 
}
.footer-bottom .container { display: flex; justify-content: center; align-items: center; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #000; font-weight: bold; text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }

/* ==========================================================================
   HOMEPAGE SPECIFICS (From original master.css)
   ========================================================================== */
.services-grid { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin: 0 auto; max-width: 1200px; padding: 0 20px; }
.service-card {
    flex: 1; min-width: 250px; max-width: 350px; text-align: center; display: flex; flex-direction: column; align-items: center;
    text-decoration: none; color: inherit; background: #ffffff; padding: 30px 20px; border-radius: 12px; border: 1px solid #eaeaea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}
.service-card:hover { transform: translateY(-10px); box-shadow: 0 12px 30px rgba(255, 127, 0, 0.15); border-color: var(--primary-orange); }
.service-card img { max-width: 130px; height: auto; margin-bottom: 20px; transition: transform 0.3s ease; }
.service-card:hover img { transform: scale(1.05); }
.service-card h2 { color: var(--text-dark); font-size: 1.8rem; text-transform: uppercase; font-family: var(--font-heading); letter-spacing: 1px; margin: 0; transition: color 0.3s ease; }
.service-card:hover h2 { color: var(--primary-orange); }

.about-flex { display: flex; align-items: center; gap: 50px; margin: 0 auto; flex-wrap: wrap; padding: 0 20px; }
.about-text { flex: 1.2; min-width: 300px; font-size: 1.1rem; }
.about-text p { margin-bottom: 20px; }
.about-text a { color: var(--primary-orange); font-weight: bold; text-decoration: underline; }
.about-image { flex: 1; min-width: 300px; text-align: center; }
.about-image img { border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.support-grid { display: flex; align-items: center; gap: 50px; flex-wrap: wrap; padding: 0 20px; }
.support-image { flex: 1; text-align: center; min-width: 250px; }
.support-text { flex: 1.5; min-width: 300px; }
.support-text h2 { font-family: var(--font-heading); font-size: 3rem; text-transform: uppercase; line-height: 1.1; margin-bottom: 20px; }
.support-text h2 span { color: var(--primary-orange); }
.support-text p { font-size: 1.1rem; }

.support-form { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; padding: 0 20px; }
.support-form input { padding: 15px; border: 1px solid #ccc; border-radius: 4px; flex: 1; min-width: 220px; font-family: var(--font-main); font-size: 1rem; }
.support-form input:focus { border-color: var(--primary-orange); outline: none; }
.support-form button { background: var(--primary-orange); color: #fff; border: none; padding: 15px 35px; border-radius: 4px; font-weight: bold; font-size: 1.1rem; cursor: pointer; text-transform: uppercase; transition: background 0.3s; white-space: nowrap; }
.support-form button:hover { background: #e67300; }

/* ==========================================================================
   MODALS, TOASTS & POPUPS
   ========================================================================== */
#toast-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7);
    z-index: 9999; display: none; justify-content: center; align-items: center;
}
#toast-box {
    background: #ffffff; padding: 40px; border-radius: 8px; max-width: 450px; width: 90%;
    text-align: center; box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}
#toast-box h3 { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 15px; color: var(--primary-orange); letter-spacing: 1px; font-weight: 400; text-transform: uppercase; }
#toast-box p { font-size: 1.1rem; margin-bottom: 25px; color: #333; }
#toast-box button { background-color: var(--primary-orange); color: white; border: none; padding: 12px 30px; font-size: 1.1rem; font-weight: bold; border-radius: 4px; cursor: pointer; text-transform: uppercase; transition: background 0.3s; }
#toast-box button:hover { background-color: #e67300; }

.global-modal-overlay, .map-modal-overlay { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); 
    z-index: 20000; justify-content: center; align-items: center; backdrop-filter: blur(3px);
}
.global-modal-overlay.active { display: flex; }
.global-modal-box { 
    background: #1e1e1e; padding: 30px; border-radius: 12px; width: 90%; max-width: 400px; 
    position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.6); border: 1px solid #333; color: #e0e0e0; font-family: var(--font-main);
}
.map-modal-content { position: relative; max-width: 90vw; max-height: 90vh; }
.map-modal-content a { display: block; position: relative; text-decoration: none; }
.map-modal-content img { display: block; max-width: 100%; max-height: 90vh; width: auto; height: auto; border-radius: 6px; box-shadow: 0 5px 25px rgba(0,0,0,0.5); }
.modal-overlay-text { position: absolute; bottom: 0; left: 0; right: 0; background-color: rgba(0, 0, 0, 0.8); color: #fff; text-align: center; padding: 15px; font-size: 1rem; font-weight: bold; pointer-events: none; text-transform: uppercase; letter-spacing: 0.5px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }

#support-download-popup {
    position: fixed; top: 20px; right: 20px; width: 340px; background: #ffffff; color: #333; z-index: 20000; 
    border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); padding: 20px 25px; border: 1px solid #eee; 
    display: none; opacity: 0; transform: translateY(-20px); transition: opacity 0.3s ease, transform 0.3s ease;
}
#support-download-popup.active { display: block !important; opacity: 1 !important; transform: translateY(0) !important; }
.shortcut-key { background: #eee; border: 1px solid #ccc; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-weight: bold; color: #333; }

@keyframes bounceUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ==========================================================================
   PRODUCT DETAILS & STORE CATALOG (From product-detail.php)
   ========================================================================== */
.view-toggles { display: flex; gap: 5px; background: #2c2c2c; padding: 4px; border-radius: 6px; }
.view-btn { background: transparent; border: none; color: #888; padding: 8px 12px; cursor: pointer; border-radius: 4px; font-weight: bold; font-size: 0.9rem; transition: 0.2s; }
.view-btn.active { background: #444; color: #fff; }

.product-view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding-bottom: 80px; }
.product-view-list { display: flex; flex-direction: column; gap: 15px; padding-bottom: 80px; }

/* OPACITY FIX APPLIED HERE */
.prod-img-box { display: flex; justify-content: center; align-items: center; background: #ffffff; border-radius: 4px; flex-shrink: 0; }
.prod-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; opacity: 1; transition: opacity 0.3s; }

.prod-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.prod-badge { background: #f0f0f0; color: #555; font-size: 0.75em; padding: 4px 10px; border-radius: 20px; align-self: flex-start; margin-bottom: 10px; font-weight: bold; text-transform: uppercase;}
.prod-title { font-size: 1rem; font-weight: 600; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; color:#111; }

.prod-action { display: flex; flex-direction: column; flex-shrink: 0; align-items: flex-end; justify-content: flex-end; }
.prod-price { font-size: 1.8rem; color: var(--primary-orange); margin-bottom: 2px; font-weight:900; line-height: 1; }
.prod-price-gst { font-size: 0.75rem; color: #888; font-weight: normal; margin-bottom: 15px; text-transform: uppercase;}

.add-cart-btn { background: #000; color: #fff; border: none; padding: 12px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background 0.2s; font-size:0.95rem; text-align: center; white-space: nowrap;}
.add-cart-btn:hover { background: var(--primary-orange); }

.product-view-grid .prod-card { flex-direction: column; height: 100%; }
.product-view-grid .prod-img-box { width: 100%; height: 180px; margin-bottom: 15px; }
.product-view-grid .prod-info { margin-bottom: 15px; }
.product-view-grid .prod-action { align-items: flex-start; margin-top: auto; width: 100%; }
.product-view-grid .add-cart-btn { width: 100%; }

.product-view-list .prod-card { flex-direction: row; align-items: center; gap: 25px; padding: 20px; }
.product-view-list .prod-img-box { width: 150px; height: 150px; }
.product-view-list .prod-action { width: 200px; align-items: flex-end; text-align: right; border-left: 1px solid #eee; padding-left: 20px;}
.product-view-list .add-cart-btn { width: 100%; }

/* Admin Store Controls */
.admin-stats-box { font-size:0.75rem; margin-top:15px; background:#f0f0f0; padding:10px; border-radius:6px; border:1px solid #ddd; color:#333; width: 100%; box-sizing: border-box; cursor: default;}
.admin-toggle-btn { margin-top:10px; width:100%; padding:8px; font-size:0.85em; background:#333; color:#fff; border:none; cursor:pointer; font-weight:bold; border-radius:4px;}
.admin-toggle-btn.unhide { background:#27ae60; }

/* Universal Inline Product View */
#universal-product-view { display: none; animation: fadeIn 0.3s ease; width: 100%;}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.upv-back-btn { background: transparent; color: var(--primary-orange); border: 1px solid var(--primary-orange); padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; margin-bottom: 20px; display: inline-flex; align-items: center; gap: 5px; transition: 0.2s;}
.upv-back-btn:hover { background: var(--primary-orange); color: #fff; }
.upv-container { background: #1e1e1e; border: 1px solid #333; border-radius: 8px; padding: 40px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); color: #e0e0e0; }
.upv-top-section { display: flex; flex-wrap: wrap; gap: 40px; margin-bottom: 30px; }
.upv-image-wrapper { flex: 1 1 300px; max-width: 450px; background: #ffffff; border-radius: 8px; padding: 20px; display: flex; justify-content: center; align-items: flex-start; border: 1px solid #eee;}
.upv-image-wrapper img { max-width: 100%; max-height: 400px; object-fit: contain; }
.upv-core-info { flex: 2 1 300px; display: flex; flex-direction: column; justify-content: flex-start;}
.upv-badge { background: #333; color: #fff; font-size: 0.75rem; padding: 5px 12px; border-radius: 20px; align-self: flex-start; margin-bottom: 15px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px;}
.upv-title { font-size: 2.2rem; font-weight: bold; color: #fff; margin: 0 0 10px 0; line-height: 1.2; font-family: var(--font-heading, sans-serif); letter-spacing: 0.5px;}
.upv-sku-wrapper { color: #888; font-family: monospace; font-size: 0.95rem; margin-bottom: 15px;}
.upv-price { font-size: 3rem; font-weight: bold; color: var(--primary-orange); line-height: 1; margin-bottom: 5px;}
.upv-gst-note { font-size: 0.8rem; color: #888; margin-bottom: 30px; font-weight: bold;}
.upv-action-container { margin-top: auto; padding-top: 20px; border-top: 1px solid #333;}
.upv-divider { height: 1px; background: #333; margin: 0 0 30px 0; width: 100%; }
.upv-rich-desc { font-size: 1.05rem; line-height: 1.7; color: #ccc; overflow-wrap: break-word; }
.upv-rich-desc * { max-width: 100% !important; } 
.upv-rich-desc img { height: auto !important; border-radius: 6px; margin: 20px 0; display: block;}
.upv-rich-desc p { margin-bottom: 15px; }
.upv-rich-desc h1, .upv-rich-desc h2, .upv-rich-desc h3, .upv-rich-desc h4, .upv-rich-desc h5 { color: #fff; margin: 30px 0 15px 0; font-family: sans-serif;}
.upv-rich-desc ul, .upv-rich-desc ol { margin-bottom: 20px; padding-left: 20px; }
.upv-rich-desc li { margin-bottom: 8px; }
.upv-rich-desc table { width: 100% !important; border-collapse: collapse; margin: 20px 0; background: #222;}
.upv-rich-desc th, .upv-rich-desc td { padding: 12px; border: 1px solid #444; text-align: left; vertical-align: top;}
.upv-rich-desc th { background: #333; color: #fff; font-weight: bold;}
.upv-rich-desc a { color: var(--primary-orange); text-decoration: underline; }

/* ==========================================================================
   SYSTEM BUILDER UI & DESIGN YOUR RIG MODULES
   ========================================================================== */

/* Edge-to-Edge Container Override */
.content-wrapper {
    padding: 40px 20px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Sticky Header */
.sticky-builder-header {
    position: sticky;
    top: var(--sticky-offset, 80px);
    background: var(--bg-surface);
    border-bottom: 2px solid var(--primary-orange);
    padding: 15px clamp(15px, 3vw, 40px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 990;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    color: var(--text-dark);
}

.progress-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
}

.step-label {
    background: #e0e0e0;
    color: #666;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-transform: uppercase;
}

.step-label:hover { background: #d0d0d0; color: #333; }
.step-label.active { background: var(--primary-orange); color: #fff; }
.step-label.completed { background: #27ae60; color: #fff; }

.header-metrics { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.header-metrics [data-admin-tip] { color: var(--text-dark) !important; }
.header-metrics [data-admin-tip][style*="color: var(--primary-orange)"] { color: var(--text-orange) !important; }

/* Admin Seamless "Fake Page" Overlay */
.admin-seamless-overlay {
    position: fixed;
    top: var(--sticky-offset, 80px);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-panel);
    z-index: 980; /* Just below the sticky header */
    padding: clamp(20px, 4vw, 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Main Builder Panels */
.builder-container { display: flex; flex-direction: column; gap: 20px; }

.seamless-view-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.05);
    border: 1px solid var(--border-light);
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.view-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--text-orange);
    margin: 0;
    letter-spacing: 1px;
    font-weight: normal;
}

/* Catalog Controls */
.catalog-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    background: var(--bg-surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}
.catalog-controls-top { display: flex; justify-content: space-between; align-items: center; }
.catalog-controls-bottom { display: flex; gap: 15px; flex-wrap: wrap; }

.control-input {
    background: #fff;
    color: var(--text-dark);
    border: 1px solid #ccc;
    padding: 10px 15px;
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 0.95rem;
}
.control-input:focus { outline: none; border-color: var(--primary-orange); }

.strict-toggle-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
    user-select: none;
    border: 1px solid #ddd;
}
.strict-toggle-modern.active { background: #e8f5e9; border-color: #27ae60; color: #27ae60; }

/* Ledger (Review Step) */
.review-ledger { display: flex; flex-direction: column; gap: 8px; }
.ledger-row {
    display: grid;
    grid-template-columns: 150px 1fr auto 150px 150px 120px;
    align-items: center;
    background: var(--bg-surface);
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    gap: 15px;
}
.ledger-step { font-weight: bold; color: var(--text-orange); text-transform: uppercase; font-size: 0.9rem; }
.ledger-part { font-size: 1.05rem; font-weight: 600; color: var(--text-dark); }
.ledger-title-text { cursor: pointer; transition: color 0.2s; }
.ledger-title-text:hover { color: var(--text-orange); text-decoration: underline; }
.ledger-conflict { color: #e74c3c; font-size: 0.85rem; font-weight: bold; }
.ledger-status-wrap { text-align: center; }
.ledger-status { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; background: #27ae60; color: #fff; }
.ledger-status.missing { background: #e74c3c; }
.ledger-status.empty { background: #7f8c8d; }
.ledger-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ledger-price { font-size: 1.2rem; font-weight: bold; color: var(--text-dark); text-align: right; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }

/* Toast Notifications */
.mini-toast {
    position: fixed; bottom: 30px; right: 30px; padding: 15px 20px; border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); z-index: 99999; transition: opacity 0.3s ease;
    opacity: 0; pointer-events: none; max-width: 400px; display: flex; flex-direction: column; gap: 5px;
}
.mini-toast-success { background-color: #27ae60; color: #fff; }
.mini-toast-error { background-color: #c0392b; color: #fff; }

/* Admin In-Flow Panels */
.admin-inline-panel {
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    padding: 25px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}
.admin-inline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; align-items: stretch; }
.admin-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px; border-bottom: 1px solid var(--border-light); padding-bottom: 15px;
}
.admin-panel-title { margin: 0; color: var(--text-dark); font-family: var(--font-heading, inherit); font-weight: normal; letter-spacing: 1px; }

/* Rules Editor & Debugger (Code textareas stay dark for syntax contrast) */
.smart-rules-editor {
    width: 100%; flex: 1; min-height: 400px; background: #1e1e1e; color: #a6e22e;
    border: 1px solid #ccc; padding: 15px; font-family: monospace; border-radius: 4px; margin-bottom: 20px; resize: vertical;
}
.debug-output-console {
    line-height: 1.6; background: #1e1e1e; padding: 20px; border: 1px solid #ccc;
    border-radius: 4px; flex: 1; max-height: 600px; overflow-y: auto; font-family: monospace; color: #a6e22e; font-size: 0.95rem;
}
.power-analysis-card {
    background: #f0f8ff; border: 2px solid #3498db; padding: 25px; border-radius: 8px;
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; color: var(--text-dark);
}
.power-analysis-card h3 { color: #2980b9 !important; }
.power-analysis-card .power-analysis-metrics { text-align: right; background: #fff; padding: 15px; border-radius: 6px; border: 1px solid #bcdbe1; }

/* Profitability Summary Table & Stats */
.profit-stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 15px; }
.profit-stat-card { background: var(--bg-surface); padding: 10px; border-radius: 6px; border: 1px solid var(--border-light); text-align: center; }
.profit-stat-card.highlight-ex { background: #f0fdf4; border: 1px dashed #27ae60; }
.profit-stat-card.highlight-inc { background: #f0fdf4; border: 1px solid #2ecc71; }
.profit-stat-label { color: #666; font-size: 0.75rem; text-transform: uppercase; font-weight: bold; }
.profit-stat-value { color: var(--text-dark); font-size: 1.2rem; font-weight: bold; }
.profit-stat-value.text-green { color: #27ae60; }

.profit-table-wrapper {
    background: var(--bg-surface); border-radius: 6px; border: 1px solid var(--border-light);
    flex: 1; overflow-y: auto; display: flex; flex-direction: column;
}
.profit-table { width: 100%; border-collapse: collapse; text-align: left; }
.profit-table th { padding: 8px 12px; color: var(--text-orange); font-size: 0.85rem; background: #f9f9f9; position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--border-light); }
.profit-table td { padding: 6px 12px; color: var(--text-dark); font-size: 0.85rem; border-bottom: 1px solid var(--border-light); }


/* Media Queries */
@media (max-width: 1100px) { .ledger-row { grid-template-columns: 100px 1fr auto 120px 140px 100px; } }
@media (max-width: 850px) {
    .ledger-row { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
    .ledger-actions { width: 100%; justify-content: flex-start; margin-top: 10px; }
    .ledger-price { align-self: flex-start; margin-top: 10px; }
    .sticky-builder-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .header-metrics { width: 100%; justify-content: space-between; }
}
@media (max-width: 1200px) { .profit-stat-grid { grid-template-columns: repeat(3, 1fr); } }


/* ==========================================================================
   GLOBAL ADMIN TOOLBAR
   ========================================================================== */
body.admin-active { padding-top: 44px !important; }
header.admin-active { top: 44px !important; }

.global-admin-toolbar {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100000;
    background: #1e3a29; border-bottom: 2px solid #27ae60; padding: 6px 20px; 
    color: #9be9a8; display: flex; align-items: center; justify-content: space-between;
    font-size: 0.9rem; font-family: var(--font-main); flex-wrap: nowrap !important;
    overflow: hidden !important; white-space: nowrap !important; gap: 15px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.global-admin-toolbar.stealth-mode { pointer-events: none; }
.global-admin-toolbar.stealth-mode .hideable { opacity: 0; visibility: hidden; pointer-events: none; }

.stealth-toggle-btn {
    background: transparent; border: none; cursor: pointer; font-size: 1.2rem;
    padding: 0 10px 0 0; opacity: 0.7; transition: opacity 0.2s; pointer-events: auto !important; 
}
.stealth-toggle-btn:hover { opacity: 1; }

.gat-left, .gat-center, .gat-right { display: flex; align-items: center; flex-wrap: nowrap; overflow: hidden; transition: opacity 0.2s, visibility 0.2s; }
.gat-left { flex: 1 1 auto; justify-content: flex-start; gap: 15px; min-width: 0; pointer-events: auto;}
.gat-center { flex: 0 1 auto; justify-content: center; gap: 10px; min-width: 0; pointer-events: auto;}
.gat-right { flex: 1 0 auto; justify-content: flex-end; gap: 8px; min-width: 0; pointer-events: auto;}

.admin-alert-badge {
    background: #e74c3c; color: #fff; padding: 4px 12px; border-radius: 20px; 
    font-weight: bold; font-size: 0.85rem; display: flex; gap: 10px; align-items: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-alert-badge a { color: #fff; text-decoration: underline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gat-btn {
    padding: 4px 10px; border-radius: 4px; font-weight: bold; cursor: pointer; 
    font-size: 0.8rem; white-space: nowrap; border: 1px solid transparent;
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 1; overflow: hidden;
}

/* Control Panel Dropdown specific styles */
.cp-dropdown-wrapper { position: relative; display: inline-block; }
.cp-dropdown-content {
    display: none; position: absolute; right: 0; top: 100%; background-color: #1a1a1a; 
    min-width: 220px; box-shadow: 0 8px 16px rgba(0,0,0,0.5); border: 1px solid #333; 
    border-radius: 4px; z-index: 100001; flex-direction: column; padding: 5px 0;
}
.cp-dropdown-wrapper:hover .cp-dropdown-content { display: flex; }
.cp-dropdown-item {
    color: #e0e0e0; padding: 10px 16px; text-decoration: none; display: block; 
    font-size: 0.85rem; cursor: pointer; background: transparent; border: none; text-align: left; width: 100%;
}
.cp-dropdown-item:hover { background-color: #333; color: #fff; }
.cp-divider { height: 1px; background-color: #444; margin: 5px 0; }

body.admin-inspector-active [data-admin-tip] { outline: 2px dashed #f39c12 !important; outline-offset: 1px; position: relative; cursor: help !important; }
body.admin-inspector-active [data-admin-tip]:hover::after {
    content: attr(data-admin-tip); position: absolute; bottom: calc(100% + 5px); left: 50%;
    transform: translateX(-50%); background: #111; color: #f39c12; border: 1px solid #f39c12;
    padding: 6px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; font-family: monospace;
    white-space: nowrap; z-index: 100000; pointer-events: none; box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

@media (max-width: 1100px) {
    .global-admin-toolbar { padding: 6px 10px; gap: 8px; font-size: 0.8rem; }
    .admin-alert-badge { font-size: 0.75rem; padding: 3px 8px; gap: 6px; }
    .gat-btn { padding: 3px 6px; font-size: 0.75rem; }
}
@media (max-width: 850px) {
    .gat-btn .gat-text { display: none; } 
    .admin-alert-badge span:first-child { display: none; } 
    .gat-left strong span { display: none; } 
}

/* Builder Container Styles */
.builder-main-wrapper { width: 100%; padding: 20px clamp(15px, 3vw, 40px); box-sizing: border-box; }
.builder-container-layout { display: flex; flex-direction: column; gap: 20px; }
.overview-view-wrapper { width: 100%; }
.builder-view-header { border-bottom: none; margin-bottom: 0; }
.builder-view-title { margin-bottom: 10px; }

/* Rebuilt Sticky Header UI */
.sticky-builder-header { position: sticky; top: 0; z-index: 100; background: var(--bg-surface, #fff); border-bottom: 1px solid var(--border-light, #ddd); box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; flex-direction: column; padding: 15px 20px; gap: 15px; }

.header-progress-row { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; border-bottom: 1px solid #eee; padding-bottom: 12px; }

.header-metrics-row { display: flex; align-items: center; justify-content: flex-start; gap: 20px; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }

.metric-block { border-right: 1px solid #ccc; padding-right: 20px; display: flex; flex-direction: column; justify-content: center; white-space: nowrap; }
.metric-block:last-of-type { border-right: none; padding-right: 0; }

.metric-label { font-size: clamp(0.55rem, 1vw, 0.7rem); color: #888; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px;}
.metric-value { font-size: clamp(0.9rem, 1.3vw, 1.15rem); font-weight: bold; color: var(--text-dark, #333); display: flex; align-items: baseline; gap: 5px; }
.metric-value.highlight { color: var(--primary-orange, #ff6600); font-size: clamp(1.1rem, 1.5vw, 1.4rem); }
.metric-value.monospace { font-family: monospace; letter-spacing: 1.5px; }

.header-actions-group { display: flex; gap: 10px; margin-left: auto; align-items: center; flex-wrap: nowrap; }
.header-actions-group .admin-btn { white-space: nowrap; padding: 8px 16px; font-size: 0.9rem; }

/* Catalog Overrides */
.catalog-controls-top-flex { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }

/* ==========================================================================
   RIG BUILDER ADDITIONS (SPLASH, HYBRID INPUT, QR, AUTO-SWAP)
   ========================================================================== */

/* Splash Screen */
#welcome-splash {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    background: var(--bg-surface, #ffffff); 
    border-radius: 12px;
    padding: 50px 20px; 
    text-align: center; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid var(--border-light, #eaeaea);
}
.splash-instructions { 
    max-width: 600px; 
    color: #555; 
    margin-bottom: 30px; 
    line-height: 1.6; 
}

/* Hybrid Code Input (Sticky Header) */
.hybrid-code-wrapper { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    background: #f5f5f5; 
    padding: 4px 8px; 
    border-radius: 6px; 
    border: 1px solid #ccc; 
    transition: border-color 0.3s ease;
}
.hybrid-code-wrapper:focus-within {
    border-color: var(--primary-orange);
}
.hybrid-code-input { 
    border: none; 
    background: transparent; 
    font-family: monospace; 
    font-size: 1.1rem; 
    width: 80px; 
    text-transform: uppercase; 
    outline: none; 
    font-weight: bold; 
    color: var(--text-dark, #333); 
}
.hybrid-code-input::placeholder { 
    color: #aaa; 
    font-weight: normal; 
}

/* Animated QR Modal Extender */
.qr-modal-box {
    transform: scale(0.8); 
    opacity: 0; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .qr-modal-box { 
    transform: scale(1); 
    opacity: 1; 
}
#qr-render-target {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}
#qr-render-target img { 
    margin: 0 auto; 
    border: 10px solid #fff; 
    outline: 1px solid #eee; 
    border-radius: 4px;
}

/* Smart Swap Banner */
.auto-swap-banner { 
    background: #fff3cd; 
    border-left: 4px solid #ffc107; 
    padding: 15px 20px; 
    margin-bottom: 20px; 
    border-radius: 4px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
@media (max-width: 768px) {
    .auto-swap-banner {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* ==========================================================================
   ADMIN MODAL FLUID CONTAINER
   ========================================================================== */
.admin-modal-container-fluid {
    padding: 40px;
    width: 100%;
    max-width: 100%; /* Overrides any constrained widths */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
    padding-bottom: 80px;
}

/* ==========================================================================
   SHARED UI: CARDS, TAGS, INPUTS & MODALS (Light Theme)
   ========================================================================== */

/* Product Cards */
.product-card, .prod-card { 
    padding: 15px; 
    border-radius: 6px; 
    transition: transform 0.2s, box-shadow 0.2s; 
    background: var(--bg-surface, #ffffff); 
    color: var(--text-dark, #333333); 
    display: flex; 
    flex-direction: column; 
    box-sizing: border-box; 
}
.product-card:hover, .prod-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); 
    cursor: pointer; 
}
.product-card-normal { border: 1px solid var(--border-light, #eaeaea); }
.product-card-selected { border: 2px solid var(--primary-orange, #ff7f00); box-shadow: 0 4px 15px rgba(255,127,0,0.15); }
.product-card-incompatible { border: 1px solid #e74c3c; background: #fffafa; opacity: 0.7; }
.hidden-item { border: 2px dashed #e74c3c !important; opacity: 0.8; }

/* Tags & Badges */
.product-tag-pill { 
    background: #e3f2fd; 
    color: #2980b9; 
    border: 1px solid #aed6f1; 
    padding: 3px 6px; 
    border-radius: 4px; 
    font-size: 0.65rem; 
    font-weight: bold; 
    letter-spacing: 0.5px; 
    white-space: nowrap; 
}

/* Modals (Light Theme Overrides) */
.modal-overlay { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.7); z-index: 2000; justify-content: center; align-items: center; 
    backdrop-filter: blur(3px);
}
.modal-overlay.active { display: flex; }
.modal-box { 
    background: var(--bg-surface, #ffffff); padding: 30px; border-radius: 12px; 
    width: 90%; max-width: 500px; position: relative; max-height: 90vh; overflow-y: auto; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.2); color: var(--text-dark, #333333); 
    border: 1px solid var(--border-light, #eaeaea);
}
.close-modal { 
    position: absolute; top: 15px; right: 20px; font-size: 2rem; cursor: pointer; 
    color: #999; z-index: 10; line-height: 1;
}
.close-modal:hover { color: var(--text-dark, #333333); }
.modal-prompt-input { 
    width: 100%; padding: 15px; border: 1px solid #ccc; background: #fff; 
    color: #333; border-radius: 6px; margin-bottom: 20px; box-sizing: border-box; font-size: 1.1rem; 
}
.modal-flex-actions { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }