﻿/* ==========================================================================
   ITAPES PLATFORM INTEGRATED ARCHITECTURE STYLESHEET
   ========================================================================== */

:root {
    --sidebar-width: 260px;
    --slate-dark: #1e293b;
    --slate-hover: #334155;
    --slate-deep: #0f172a;
    --sky-blue: #38bdf8;
    --amber-gold: #ffc107;
}

/* 🧱 1. GLOBAL ELEMENT DEFAULTS */
body {
    background-color: #f8fafc;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
}

/* 🧭 2. STANDARDIZED SIDEBAR COMPONENT (Works for container & wrapper layouts) */
.sidebar-container,
.sidebar-wrapper {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--slate-dark);
    z-index: 1000;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 🖥️ 3. STANDARDIZED WORKING CONTENT PANEL REAL ESTATE */
.main-workspace-wrapper,
.main-content-wrapper {
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    transition: all 0.25s ease-in-out;
}

/* 🔗 4. NAV LINKS LINK HOVER STATES */
/* A. Sidebar style (used in index.html) */
.nav-menu-link {
    color: #94a3b8;
    font-weight: 600;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.2s ease-in-out;
}

    .nav-menu-link:hover {
        color: #ffffff;
        background-color: var(--slate-hover);
    }

    .nav-menu-link.active-module {
        color: var(--sky-blue);
        background-color: var(--slate-deep);
        border-left-color: var(--sky-blue);
    }

/* B. Legacy panel pill navigation button links style (used in admin.html) */
.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.8rem 1.5rem;
    font-weight: 500;
    border-radius: 0;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    background: transparent;
    border: none;
}

    .sidebar-nav .nav-link:hover {
        color: #ffffff;
        background-color: var(--slate-hover);
    }

    .sidebar-nav .nav-link.active {
        color: #ffffff !important;
        background-color: var(--slate-deep) !important;
        border-left-color: var(--amber-gold) !important;
        font-weight: bold;
    }

.nav-pills .nav-link {
    color: #495057;
    border: 1px solid #dee2e6;
    margin-right: 5px;
    background-color: #fff;
}

    .nav-pills .nav-link.active {
        background-color: #198754;
        color: #fff;
        font-weight: bold;
    }

/* 📈 5. EXECUTIVE METRICS & TRANSACTION CARDS */
.metric-card,
.hover-card,
.hover-shadow {
    border: none;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease-in-out;
}

    .metric-card:hover,
    .hover-shadow:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
    }

    .hover-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
    }

/* 📋 6. DATA MANUFACTURING GRID LAYOUTS */
.sticky-grid-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

.status-select {
    min-width: 140px;
    font-weight: 600;
}

/* 💬 7. AMENDMENT REVIEWS TIMELINE CHAT BUBBLES */
.notes-timeline {
    max-height: 350px;
    overflow-y: auto;
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 15px;
}

.note-bubble {
    border-left: 4px solid #475569;
    background: #ffffff;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 🔄 8. UTILITIES & ANIMATION LAYERS */
.transition {
    transition: all 0.25s ease-in-out;
}

/* 📱 RESPONSIVE LEDGER GRID CONTAINER OVERFLOW HORIZONTAL SCROLLBARS */
.table-responsive,
.card,
form,
#itapes-app-root {
    overflow-x: auto !important;
    max-width: 100%;
}

/* Custom smooth scrollbar presentation styles */
::-webkit-scrollbar,
.inner-scroll::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb,
.inner-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* 🔑 9. BLUEPRINT BLUR IDENTITY SECURITY LOGIN PANEL VIEWPORTS */
login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, sans-serif;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.google-btn {
    background: #ffffff;
    color: #1e293b;
    font-weight: 600;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

    .google-btn:hover {
        background: #f1f5f9;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(255,255,255,0.1);
    }

/* ==========================================================================
   MOBILE TOP NAV BAR & COLLAPSIBLE NAVIGATION EXTENSIONS
   ========================================================================== */

.mobile-header-nav {
    display: none;
}

@media (max-width: 992px) {
    .mobile-header-nav {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background-color: #1e293b;
        z-index: 1050;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .sidebar-container,
    .sidebar-wrapper {
        margin-left: calc(-1 * var(--sidebar-width));
    }

        .sidebar-container.show,
        .sidebar-wrapper.show {
            margin-left: 0;
        }

    .main-workspace-wrapper,
    .main-content-wrapper {
        margin-left: 0 !important;
        padding: 80px 20px 20px 20px !important;
    }

    .mobile-dropdown-menu {
        background-color: #0f172a !important;
        border: 1px solid #334155 !important;
        width: 100vw;
        border-radius: 0 0 12px 12px !important;
    }

        .mobile-dropdown-menu .dropdown-item {
            color: #94a3b8 !important;
            font-weight: 600;
            padding: 12px 24px;
            border-bottom: 1px solid #1e293b;
        }

            .mobile-dropdown-menu .dropdown-item:hover,
            .mobile-dropdown-menu .dropdown-item.active-item {
                color: #38bdf8 !important;
                background-color: #1e293b !important;
            }
}

/* ==========================================================================
   🌓 GLOBAL CORE VARIABLE THEME ENGINE 
   ========================================================================== */

/* Default / Deep Slate Dark Mode */
.theme-slate-dark {
    --bg-main-canvas: #0f172a;
    --bg-card-surface: #1e293b;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-bg: #0f172a;
    --border-color: #334155;
}

/* Classic Clean Light Mode */
.theme-light {
    --bg-main-canvas: #f8fafc;
    --bg-card-surface: #ffffff;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --sidebar-bg: #1e293b;
    --border-color: #e2e8f0;
}

/* 🎯 THE FIX: Force the theme properties down to all background canvas layers */
body,
#itapes-app-root,
.main-workspace-wrapper,
[style*="min-height: 100vh"] {
    background-color: var(--bg-main-canvas) !important;
    color: var(--text-primary) !important;
}

/* Force inner dashboard surfaces and cards to respect the container theme */
.theme-slate-dark .card,
.theme-slate-dark .bg-white,
.theme-slate-dark .list-group-item {
    background-color: var(--bg-card-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Fix heading and generic muted texts */
.theme-slate-dark h1,
.theme-slate-dark h2,
.theme-slate-dark h3,
.theme-slate-dark h4,
.theme-slate-dark h5,
.theme-slate-dark h6,
.theme-slate-dark .text-dark,
.theme-slate-dark strong {
    color: var(--text-primary) !important;
}

.theme-slate-dark .text-muted,
.theme-slate-dark p.text-muted {
    color: var(--text-muted) !important;
}

/* ==========================================================================
   ⚠️ DARK THEME SYSTEM BANNER OVERRIDES
   ========================================================================== */

.theme-slate-dark .alert-warning {
    background-color: #2c2514 !important;
    border-color: #45371c !important;
    color: #fef08a !important;
}

    .theme-slate-dark .alert-warning strong,
    .theme-slate-dark .alert-warning .text-dark {
        color: #fef08a !important;
    }

    .theme-slate-dark .alert-warning .text-muted,
    .theme-slate-dark .alert-warning span {
        color: #e2e8f0 !important;
    }

    /* Ensure the action link stands out cleanly with high contrast */
    .theme-slate-dark .alert-warning a,
    .theme-slate-dark .alert-warning a.text-warning-dark {
        color: #facc15 !important;
        text-decoration: underline !important;
    }

    /* Fix visibility on the dismiss button close icon (X) */
    .theme-slate-dark .alert-warning .btn-close {
        filter: invert(1) grayscale(1) brightness(2);
        opacity: 0.7;
    }

        .theme-slate-dark .alert-warning .btn-close:hover {
            opacity: 1;
        }

/* ==========================================================================
   🌙 DEEP SLATE DARK THEME DATAGRID & FORM INTERFACE OVERRIDES
   ========================================================================== */

/* 🎯 Fix Month Selection & Input Dropdowns Context */
.theme-slate-dark select,
.theme-slate-dark input.form-control,
.theme-slate-dark select.form-select,
.theme-slate-dark .form-select-sm,
.theme-slate-dark [id*="Month"],
.theme-slate-dark select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

    /* Ensure selected options display cleanly across system browser engines */
    .theme-slate-dark select option {
        background: #1e293b !important;
        color: #f8fafc !important;
    }

/* 🎯 Fix list-orders.html Ledger Table Records Grid */
.theme-slate-dark .table {
    --bs-table-bg: #0f172a !important;
    --bs-table-hover-bg: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

/* Force specific cells and anchor links inside the table to stand out */
.theme-slate-dark #tblItemsGridBody tr {
    background-color: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
}

.theme-slate-dark #tblItemsGridBody td {
    color: #cbd5e1 !important; /* Mid-gray body text for readability */
}

    /* Brighten target specific item descriptors and core highlights */
    .theme-slate-dark #tblItemsGridBody td div.text-dark,
    .theme-slate-dark #tblItemsGridBody td div.fw-semibold,
    .theme-slate-dark #tblItemsGridBody td.fw-bold {
        color: #f8fafc !important;
    }

/* Ensure clickable table row anchor text stays beautifully clear */
.theme-slate-dark #tblItemsGridBody a.accessible-focus-anchor {
    color: #f8fafc !important;
}

    .theme-slate-dark #tblItemsGridBody a.accessible-focus-anchor:hover {
        color: #38bdf8 !important; /* Sky blue focus glow on hover */
    }

/* Dynamic Hover state for ledger components rows */
.theme-slate-dark .clickable-row:hover,
.theme-slate-dark .clickable-row:hover td {
    background-color: #1e293b !important;
}

/* Muted subtitles inside table grid layout cells */
.theme-slate-dark #tblItemsGridBody small.text-muted {
    color: #94a3b8 !important;
}

/* Fix Badge Surface Containers Inside the Ledger Grid */
.theme-slate-dark .table .bg-light {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

/* ==========================================================================
   🌙 DARK MODE OVERRIDES: ORDER FORM BUILDER & NOTES TIMELINE TRACK
   ========================================================================== */

/* 🎯 1. Fix order.html - itemSpecificationBuilderRow Surface Wrapper */
.theme-slate-dark #itemSpecificationBuilderRow,
.theme-slate-dark .bg-light {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

    /* Brighten form text labels above the input boxes */
    .theme-slate-dark #itemSpecificationBuilderRow label,
    .theme-slate-dark form label {
        color: #cbd5e1 !important; /* Crisp mid-gray headers */
        font-weight: 600 !important;
    }

    /* Ensure data inputs inside the specification card show clean contrast margins */
    .theme-slate-dark #itemSpecificationBuilderRow input,
    .theme-slate-dark #itemSpecificationBuilderRow select,
    .theme-slate-dark .bg-light input,
    .theme-slate-dark .bg-light select {
        background-color: #0f172a !important;
        color: #f8fafc !important;
        border-color: #475569 !important;
    }

/* Fix input group suffix label tags (like the 'KG' or 'MM / SQM' text blocks) */
.theme-slate-dark .input-group-text {
    background-color: #334155 !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}


/* 🎯 2. Fix order-details.html Internal Notes Log Timeline Container Track */
.theme-slate-dark #divOrderNotesTimelineContainer {
    background-color: #0f172a !important; /* Matches main slate app canvas depth */
    border-color: #334155 !important;
}

    /* Individual historic note card items inside the timeline rail */
    .theme-slate-dark #divOrderNotesTimelineContainer .bg-white {
        background-color: #1e293b !important; /* Pops slightly off the container track layout */
        border-bottom: 1px solid #334155 !important;
    }

    /* Brighten author operator name profiles and timestamps text bounds */
    .theme-slate-dark #divOrderNotesTimelineContainer span.fw-bold.text-success {
        color: #38bdf8 !important; /* Transitions green names to high-contrast sky blue */
    }

    .theme-slate-dark #divOrderNotesTimelineContainer .badge.bg-light {
        background-color: #334155 !important;
        color: #cbd5e1 !important;
        border-color: #475569 !important;
    }

    /* Inner description comment paragraphs block content string */
    .theme-slate-dark #divOrderNotesTimelineContainer .text-dark {
        color: #f8fafc !important;
    }
/* ==========================================================================
   🌙 DARK MODE OVERRIDES: LIVE NOTIFICATIONS DROPDOWN PIPELINE
   ========================================================================== */

/* Target the dropdown card container itself */
.theme-slate-dark #uiNotificationBoxDropdown {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3) !important;
}

    /* 🎯 Fix Info Alerts inside the notification dropdown box (Blue Cards) */
    .theme-slate-dark #uiNotificationBoxDropdown .alert-info {
        background-color: #1e3a8a !important; /* Deep Navy Blue */
        border-color: #2563eb !important;
        color: #f8fafc !important;
    }

        .theme-slate-dark #uiNotificationBoxDropdown .alert-info strong.text-primary {
            color: #38bdf8 !important; /* Vivid Sky Blue Heading */
        }

        .theme-slate-dark #uiNotificationBoxDropdown .alert-info .text-info-emphasis {
            color: #e2e8f0 !important; /* Crisp description body text */
        }

    /* 🎯 Fix Danger Alerts inside the notification dropdown box (Red Cards) */
    .theme-slate-dark #uiNotificationBoxDropdown .alert-danger {
        background-color: #7f1d1d !important; /* Dark Crimson Maroon */
        border-color: #dc2626 !important;
        color: #f8fafc !important;
    }

        .theme-slate-dark #uiNotificationBoxDropdown .alert-danger strong.text-danger {
            color: #fca5a5 !important; /* High-contrast soft red heading */
        }

        .theme-slate-dark #uiNotificationBoxDropdown .alert-danger .text-danger-emphasis {
            color: #e2e8f0 !important;
        }

    /* 🎯 Fix Warning Alerts inside the notification dropdown box (Yellow Cards) */
    .theme-slate-dark #uiNotificationBoxDropdown .alert-warning {
        background-color: #451a03 !important; /* Dark Warm Amber Charcoal */
        border-color: #d97706 !important;
        color: #f8fafc !important;
    }

        .theme-slate-dark #uiNotificationBoxDropdown .alert-warning strong.text-dark {
            color: #fef08a !important; /* High-contrast bright yellow heading */
        }

        .theme-slate-dark #uiNotificationBoxDropdown .alert-warning .text-warning-emphasis {
            color: #e2e8f0 !important;
        }

    /* Smooth out padding and remove background borders bleeding over from standard item states */
    .theme-slate-dark #uiNotificationBoxDropdown .dropdown-item {
        background-color: transparent !important;
        border: none !important;
    }
/* ==========================================================================
   🌙 DARK MODE OVERRIDES: ACCESSIBLE INPUT PLACEHOLDERS (HIGH-CONTRAST)
   ========================================================================== */

/* Target standard webkit, firefox, and edge placeholder elements under dark theme */
.theme-slate-dark input::placeholder,
.theme-slate-dark textarea::placeholder {
    color: #64748b !important; /* Muted slate gray for visible, clean legibility */
    opacity: 0.85 !important;
}

/* Internet Explorer / legacy edge fallbacks just in case */
.theme-slate-dark input::-webkit-input-placeholder,
.theme-slate-dark textarea::-webkit-input-placeholder {
    color: #64748b !important;
}

.theme-slate-dark input::-moz-placeholder,
.theme-slate-dark textarea::-moz-placeholder {
    color: #64748b !important;
    opacity: 0.85 !important;
}

/* 🎯 Additional Fix: Ensure inputs that are explicitly disabled or read-only stand out */
.theme-slate-dark input[readonly],
.theme-slate-dark input[disabled] {
    background-color: #0f172a !important; /* Slightly darker depth for static fields */
    color: #94a3b8 !important; /* Soft white/gray value for non-editable text */
    border-color: #334155 !important;
    cursor: not-allowed;
}

/* ==========================================================================
   🌙 DARK MODE OVERRIDES: BOOTSTRAP PROGRESS BARS CANVAS BACKGROUNDS
   ========================================================================== */

/* 🎯 Style the empty remaining space on all progress track rails */
.theme-slate-dark .progress,
.theme-slate-dark [class*="progress-bar-background"],
.theme-slate-dark .progress-container {
    background-color: #334155 !important; /* Muted corporate charcoal slate */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Ensure progress track borders (if any exist) look soft and cohesive */
.theme-slate-dark .progress {
    border: 1px solid #475569 !important;
}

.sticker-twin-page-row {
    width: 100%;
    clear: both;
    display: block;
    margin-bottom: 15px;
}

.individual-sticker-panel {
    display: inline-block;
    float: left;
    width: 50% !important;
    max-width: 50% !important;
    min-width: 50% !important;
    box-sizing: border-box;
    padding: 8px;
    overflow: hidden; /* Hard cut-off to protect column boundaries */
}

/* ==========================================================================
   🖨️ MASTER CONSOLIDATED PRINT ENGINE LAYOUT MANAGEMENT
   ========================================================================== */
@media print {
    body {
        background-color: #fff !important;
        background: white !important;
        color: #000 !important;
        color: black !important;
        font-family: 'Segoe UI', Arial, sans-serif;
        padding: 0 !important;
    }

    #itapes-app-root {
        padding: 0 !important;
    }

    /* Instantly hide administrative controls, sidebar containers, and interaction states */
    .no-print,
    .navbar,
    .btn,
    .card-header,
    .input-panel-box,
    .card-body p-3,
    .input-group,
    .card.bg-light,
    .sidebar-container,
    .sidebar-wrapper {
        display: none !important;
    }

    /* Force working areas to spread fully across the paper margins */
    .container,
    .container-fluid,
    .card,
    .card-body,
    .main-workspace-wrapper,
    .main-content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        margin-left: 0 !important;
    }

    #printableReportLayout {
        display: block !important;
        background-color: #ffffff;
    }

    /* Clean ink-saving table parameters configuration mapping boundaries */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th, td {
        border: 1px solid #000 !important;
        padding: 6px !important;
        font-size: 11px !important;
    }

    .table.border-dark th,
    .table.border-dark td {
        border-color: #000 !important;
        color: #000 !important;
    }

    thead {
        display: table-header-group !important;
    }
}
