/* public/css/app.css */

/* ==========================================================================
   TABLE OF CONTENTS
   ==========================================================================
   1. EXTRACTED DESIGN TOKENS (BATCHLAB CORE) ....................... Line 15
   2. BASE RESET & LAYOUT STRUCTURING ............................... Line 41
   3. RESPONSIVE NAVIGATION SYSTEM (SIDEBAR & HAMBURGER) ............ Line 73
   4. MAIN WORKSPACE CONTAINER LAYOUT ............................... Line 129
   5. INTERACTIVE CARDS & ACTIONS ................................... Line 169
   6. DATA VISUALIZATION TABLES ..................................... Line 219
   7. FORM CONTROL LAYOUTS .......................................... Line 255
   8. MOBILE MEDIA QUERIES WITH SLIDE-OUT HAMBURGER MENU ............ Line 287
   9. REGISTRATION LAYOUT ........................................... Line 403
   10. RAW MATERIALS ................................................ Line 513
   11. PAGINATION ................................................... Line 641
   12. TOP NAVIGATION ............................................... Line 697
   13. PRODUCTS ..................................................... Line 835
   14. PROCUREMENT LOG  ............................................. Line 905
   ========================================================================== */


/* -------------------------------------------------------------------------- */
/* 1. EXTRACTED DESIGN TOKENS (BATCHLAB CORE)                                 */
/* -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Quicksand&display=swap');

:root {
    /* Core UI Colors */
    --studio-indigo: #4f46e5;
    --studio-dark: #0f172a;
    --studio-slate: #64748b;
    --studio-ghost: #f8fafc;
    --bg-canvas: #ffffff;

    /* Semantic Status & Financial Tones */
    --profit-emerald: #10b981;
    --profit-mint-bg: #ecfdf5;
    --warning-rose: #f43f5e;
    --warning-blush-bg: #fff1f2;
    --alert-amber: #f59e0b;

    /* Structural Mappings */
    --sidebar-width: 280px;
    --radius-lg: 2.5rem;
    /* Exquisite deep round corners from BatchLab */
    --radius-md: 1.25rem;
    --radius-sm: 0.75rem;

    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* -------------------------------------------------------------------------- */
/* 2. BASE RESET & LAYOUT STRUCTURING                                         */
/* -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    /* Prevents any side-scrolling */
    font-family: var(--font-stack);
    background-color: var(--studio-ghost);
    color: var(--studio-slate);
    display: flex;
    min-height: 100vh;
}

body.menu-lock {
    overflow: hidden;
}

/* Typography Overrides */
h1,
h2,
h3,
p {
    color: var(--studio-dark);
    /* Crisp dark tracking text headers */
    letter-spacing: -0.02em;
}

/* -------------------------------------------------------------------------- */
/* 3. RESPONSIVE NAVIGATION SYSTEM (SIDEBAR & HAMBURGER)                      */
/* -------------------------------------------------------------------------- */
.mobile-top-bar {
    display: none;
    /* Hidden on desktop screens */
}

.sidebar-overlay {
    display: none;
}

.main-header {
    width: var(--sidebar-width);
    background-color: var(--studio-dark);
    /* Studio Dark Sidebar Background */
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    padding: 2rem;
    z-index: 1100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-header .logo {
    font-size: 1rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
    text-decoration: none;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    color: #94a3b8;
    /* Cool silver slate text */
    transition: all 0.2s ease;
    white-space: nowrap;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.main-nav a.active {
    background: var(--studio-indigo);
    /* High-end active Indigo highlight */
    color: #ffffff;
}

/* -------------------------------------------------------------------------- */
/* 4. MAIN WORKSPACE CONTAINER LAYOUT                                         */
/* -------------------------------------------------------------------------- */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 3rem;
    max-width: 1400px;
    width: calc(100% - var(--sidebar-width));
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--studio-dark);
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Alert Notification Banners */
.alert {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.alert-success {
    background-color: var(--profit-mint-bg);
    color: #059669;
    border: 1px solid var(--profit-emerald);
}

/* -------------------------------------------------------------------------- */
/* 5. INTERACTIVE CARDS & ACTIONS                                             */
/* -------------------------------------------------------------------------- */
/* Core Studio Container Card Blueprint */
.card {
    position: relative;
    background: var(--bg-canvas);
    border-radius: var(--radius-lg);
    /* Deep structural aesthetic curve */
    padding: 2.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2rem;
}

.card:hover {
    border-color: var(--studio-indigo);
    transform: translateY(-4px);
    box-shadow: 0 15px 30px -10px rgba(79, 70, 229, 0.15);
}

/* Standardized Buttons matching BatchLab engine */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--studio-indigo);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.btn-secondary {
    background-color: var(--studio-ghost);
    border: 1px solid #e2e8f0;
    color: var(--studio-slate);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    color: var(--studio-dark);
}

/* -------------------------------------------------------------------------- */
/* 6. DATA VISUALIZATION TABLES                                               */
/* -------------------------------------------------------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.data-table th {
    background-color: var(--studio-ghost);
    color: var(--studio-slate);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.data-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--studio-dark);
    font-weight: 500;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Custom Semantic Alerts and Badges */
.badge {
    display: inline-flex;
    padding: 0.4rem 0.8rem;
    font-size: 10px;
    font-weight: 900;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-direct {
    background-color: #eef2ff;
    color: var(--studio-indigo);
}

.badge-indirect {
    background-color: var(--studio-ghost);
    color: var(--studio-slate);
}

.text-success {
    color: #059669;
    font-weight: 800;
}

.text-danger {
    color: #e11d48;
    font-weight: 800;
}

.text-center {
    text-align: center;
    color: var(--studio-slate);
}

/* -------------------------------------------------------------------------- */
/* 7. FORM CONTROL LAYOUTS                                                    */
/* -------------------------------------------------------------------------- */
.form-card {
    max-width: 720px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--studio-slate);
    margin-bottom: 0.5rem;
}

.required {
    color: var(--warning-rose);
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.85rem;
    font-size: 0.95rem;
    font-family: var(--font-stack);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background-color: var(--studio-ghost);
    color: var(--studio-dark);
    transition: all 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--studio-indigo);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    margin-top: 2.5rem;
    display: flex;
    justify-content: flex-end;
}

/* -------------------------------------------------------------------------- */
/* 8. MOBILE MEDIA QUERIES WITH SLIDE-OUT HAMBURGER MENU                     */
/* -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    body {
        flex-direction: column;
    }

    /* Fixed top navigation bar on mobile viewports */
    .mobile-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: var(--studio-dark);
        color: #ffffff;
        padding: 1rem 1.5rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 65px;
        z-index: 300;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    }

    .mobile-logo {
        font-weight: 900;
        font-size: 1rem;
        letter-spacing: -0.02em;
    }

    /* CSS Hamburger Trigger Line Definitions */
    .hamburger-btn {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        padding: 0;
    }

    .hamburger-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #ffffff;
        border-radius: 2px;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    /* Hamburger Animation Transitions */
    .hamburger-btn.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-btn.open span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .main-header .logo {
        display: none;
    }

    /* Slide-out Sidebar positioning configuration */
    .main-header {
        top: 65px;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.1);
    }

    .main-header.mobile-open {
        transform: translateX(0);
    }

    /* Background Content Darkening Layer */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Content space tuning for phone screens */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
        margin-top: 65px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.75rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .btn {
        width: 100%;
        text-align: center;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .card {
        padding: 1.5rem;
        border-radius: var(--radius-md);
    }

    /* 👉 SUCCESS FIX: Moving these overrides inside the 1024px block 
       forces the desktop layouts to collapse cleanly on mobile devices.
    */
    .create-material-grid,
    .form-inner-split-2-1,
    .form-inner-split-1-1,
    .create-product-grid,
    .product-form-split-2-1,
    .product-form-split-1-1,
    .po-master-grid,
    /* 👈 Added: Collapses the left/right split */
    .po-metadata-grid,
    /* 👈 Added: Collapses invoice# / type / date */
    .po-item-fields-grid,
    .po-detail-grid {
        /* 👈 Added: Collapses the dense item lines into stack */
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* UI Enhancements for when rows collapse into vertical fields */
    .po-item-subtotal-align {
        text-align: left !important;
        border-top: 1px dashed #e2e8f0;
        padding-top: 0.75rem;
        margin-top: 0.25rem;
    }

    .po-item-delete-align {
        text-align: left !important;
    }

    .po-center-mobile-text {
        text-align: left !important;
    }

    .po-table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

}

/* -------------------------------------------------------------------------- */
/* 9. REGISTRATION LAYOUT                      */
/* -------------------------------------------------------------------------- */

/* Core Auth Layout */
.auth-container {
    display: flex;
    justify-content: center;
    /* Centers horizontally */
    align-items: center;
    /* Centers vertically */
    min-height: 100vh;
    /* Takes up full viewport height */
    width: 100%;
    padding: 2rem 1rem;
    background-color: #f8f9fa;
    box-sizing: border-box;
}

.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 680px;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Typography elements */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    color: #2c3e50;
    margin: 1rem 0 0.25rem 0;
}

.auth-header p {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.auth-header a {
    color: #3498db;
    text-decoration: none;
}

/* Structured Form Configurations */
.form-notice {
    font-size: 0.85rem;
    color: #95a5a6;
    margin-bottom: 1.5rem;
}

.form-section {
    border: 1px solid #eaedf1;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #fcfcfd;
}

.form-section legend {
    font-weight: 600;
    font-size: 0.9rem;
    color: #34495e;
    padding: 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Handle layout splitting gracefully */
@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Inputs, Selects, Buttons */
.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background-color: #ffffff;
    color: #333333;
    transition: border-color 0.15s ease-in-out;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.required {
    color: #e74c3c;
}

.error-text {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Form Action Actions */
.form-footer {
    margin-top: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.88rem;
    color: #555555;
    line-height: 1.4;
}

.btn-submit {
    width: 100%;
    padding: 0.85rem;
    background-color: #2c3e50;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: #1a252f;
}


/* -------------------------------------------------------------------------- */
/* 10. RAW MATERIALS                                         */
/* -------------------------------------------------------------------------- */


/* --- The Pantry Catalog Grid --- */
.pantry-header-block {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.pantry-title-area h1 {
    font-size: 2.25rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.05em;
    margin: 0;
}

.pantry-subtext {
    color: #64748b;
    font-weight: 500;
    margin: 0.25rem 0 0 0;
}

.pantry-count-badge {
    color: #4f46e5;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0.2rem 0 0 0;
}

/* Material Inventory Grid */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.material-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.material-card h3 {
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}

/* Stock Threshold Progress Bars */
.stock-bar-container {
    width: 100%;
    background-color: #f1f5f9;
    height: 0.75rem;
    border-radius: 9999px;
    overflow: hidden;
    margin: 1rem 0;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s ease;
}

/* Card Action Layouts */
.card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.stock-display {
    font-size: 1.35rem;
    font-weight: 900;
    margin: 0;
    color: #0f172a;
}

.stock-unit {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.target-display {
    font-size: 0.7rem;
    font-weight: 900;
    color: #94a3b8;
    margin: 0;
}

.card-actions-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.btn-action-restock {
    flex: 1;
    background: #0f172a;
    color: #ffffff;
    border: none;
    padding: 0.6rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: 0.875rem;
}

.btn-action-edit-square {
    background: #f1f5f9;
    border: none;
    padding: 0.6rem;
    border-radius: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- Clean Modal Architecture --- */
.modal-overlay-shroud {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-canvas-main {
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    border-radius: 2.5rem;
    overflow: hidden;
    display: flex;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
}

.modal-split-form {
    flex: 1;
    padding: 2.5rem;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
}

.modal-split-finance {
    flex: 1.1;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.finance-highlight-box {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    padding: 1.25rem;
    border-radius: 1.25rem;
    margin-bottom: 1.5rem;
}

.input-underlined-premium {
    width: 100%;
    font-size: 1.35rem;
    font-weight: 700;
    border: none;
    border-bottom: 2px solid #e2e8f0;
    background: transparent;
    padding: 0.4rem 0;
    outline: none;
    color: #0f172a;
}

.input-underlined-premium:focus {
    border-bottom-color: #4f46e5;
}

/* --- Mobile Viewport Fixes for Material Modal Architecture --- */
@media (max-width: 768px) {

    /* 1. Allow the canvas box to stack vertically and scroll if long */
    .modal-canvas-main {
        flex-direction: column;
        max-height: 85vh;
        /* Prevents container from spilling past phone notches */
        overflow-y: auto;
        /* Lets users scroll down on smaller phones */
        border-radius: 1.5rem;
        /* Slightly tighter radius for smaller viewports */
    }

    /* 2. Remove the rigid right-side divider lines */
    .modal-split-form {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        /* Soft bottom boundary instead */
        padding: 1.5rem;
        /* Bring padding in tightly on mobile screens */
    }

    .modal-split-finance {
        padding: 1.5rem;
    }

    /* 3. Handle modal screen padding to protect edge-bleeding */
    .modal-overlay-shroud {
        padding: 0.75rem;
    }
}

/* --- Material Creation Responsive Grid Architectures --- */
.create-material-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.form-inner-split-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.form-inner-split-1-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* -------------------------------------------------------------------------- */
/* 11. PAGINATION                                                             */
/* -------------------------------------------------------------------------- */

/* --- Custom Semantic Pagination Styling --- */
.pagination-wrapper {
    padding: 1.5rem 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

/* Allow links to break down neatly into rows on extremely narrow displays */
.pagination-wrapper ul.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.35rem;
}

.pagination-wrapper ul.pagination li {
    display: inline-block;
}

/* Style the interactive page links with uniform dimensions */
.pagination-wrapper ul.pagination li a,
.pagination-wrapper ul.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.85rem;
    min-width: 38px;
    /* Ensures a premium, accessible touch target on phones */
    height: 38px;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination-wrapper ul.pagination li a:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* Highlight the current active page */
.pagination-wrapper ul.pagination li.active span {
    background-color: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

/* Handle disabled navigation items securely */
.pagination-wrapper ul.pagination li.disabled span {
    color: #94a3b8;
    background-color: #f8fafc;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* Clean up individual button padding gaps on very compact phones */
@media (max-width: 480px) {
    .pagination-wrapper {
        padding: 1rem 0.5rem;
    }

    .pagination-wrapper ul.pagination {
        gap: 0.25rem;
    }

    .pagination-wrapper ul.pagination li a,
    .pagination-wrapper ul.pagination li span {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 32px;
        height: 32px;
    }
}

/* -------------------------------------------------------------------------- */
/* 12. TOP NAVIGATION                                        */
/* -------------------------------------------------------------------------- */

/* --- Premium Light Minimal Top Header Bar --- */
.studio-top-nav {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    /* Higher than page text, lower than modal shroud layers */
}

/* Base structural layout spacing blocks */
.nav-brand-cluster,
.nav-action-cluster {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-marketing-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-marketing-links a {
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.15s ease;
}

.nav-marketing-links a:hover {
    color: #0f172a;
}

/* User Profile Badge Interaction Container */
.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.15s ease;
}

.user-profile-trigger:hover {
    background-color: #f8fafc;
}

/* Pure CSS Dropdown Panel System */
.nav-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.nav-dropdown-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    min-width: 200px;
    padding: 0.5rem;
    list-style: none;
    margin: 0;
}

.nav-dropdown-panel li a,
.nav-dropdown-panel li button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    background: none;
    text-align: left;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-dropdown-panel li a:hover,
.nav-dropdown-panel li button:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

/* JavaScript toggled wrapper class for showing dropdown layers */
.nav-dropdown-wrapper.is-open .nav-dropdown-panel {
    display: block;
}

/* --- Scalable Language Selector Dropdown --- */
.lang-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

/* The interactive button that triggers the menu */
.lang-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #475569;
    background-color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
}

.lang-dropdown-trigger:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

/* The floating menu board */
.lang-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    min-width: 140px;
    padding: 0.35rem;
    list-style: none;
    margin: 0;
    z-index: 1000;
}

.lang-dropdown-menu li a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 0.35rem;
    transition: all 0.15s ease;
}

.lang-dropdown-menu li a:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

/* Active language high-lighting rule */
.lang-dropdown-menu li a.is-active {
    background-color: #0f172a;
    color: #ffffff;
}

/* Show class toggled via JS */
.lang-dropdown-wrapper.is-open .lang-dropdown-menu {
    display: block;
}


/* -------------------------------------------------------------------------- */
/* 13. PRODUCTS                                         */
/* -------------------------------------------------------------------------- */

/* --- Premium Product Grid Layout --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
}

/* Source Type Indicator Badges */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 2rem;
    letter-spacing: 0.03em;
}

.source-manufactured {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.source-purchased {
    background-color: #fef2f2;
    color: #991b1b;
}

/* Financial Grid Dashboard Inside Cards */
.card-financial-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin: 1rem 0;
    gap: 0.5rem;
    border: 1px solid #f1f5f9;
}

.financial-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}

.financial-stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

/* Inventory Status Text Bars */
.stock-status-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

/* --- Premium Product Form Grid Architectures --- */
.create-product-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.product-form-split-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.product-form-split-1-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* -------------------------------------------------------------------------- */
/* 14. PROCUREMENT LOG                                         */
/* -------------------------------------------------------------------------- */

.po-master-grid {
    display: grid;
    grid-template-columns: 2.25fr 1fr;
    gap: 1.5rem;
    align-items: start;
    width: 100%;
}

.po-metadata-grid {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.po-item-fields-grid {
    display: grid;
    /* 6-column desktop configuration lines */
    grid-template-columns: 2fr 1.25fr 1fr 0.8fr 1fr 1.25fr auto;
    gap: 1rem;
    align-items: end;
}


/*  Logos and Brand Marks */

.logo {
    display: flex;
    align-items: center;
    gap: -10px;
    /* Adjust this to pull the text closer to or further from the image */
    text-decoration: none;
    color: var(--accent);
    background: #ffffff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


.logo img {
    height: 50px;
    /* Adjust height as needed (e.g., 50px - 70px) */
    width: auto;
    object-fit: contain;
    z-index: -1;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    font-family: 'JetBrains Mono', monospace;
}

.brand-name_white {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #ffffff;
    /* Or your variable color */
    margin-left: 5px;
}

.brand-sub_white {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #ffffff;
    /* Matches the purple/blue neon vibe of your brand mark */
    margin-top: 2px;
    margin-left: 20px;
}