﻿/* ==========================================================================
   Base.css
   Raveno Design Language (Dark Blue Restoration)

   Purpose:
   - Global theme primitives (colors, base typography, global components).
   - Centralized, token-driven sizing for data-entry screens.

   Notes:
   - Page/component layout rules belong in site.css.
   - Data-entry sizing is controlled via --ui-* tokens.
   ========================================================================== */


/* ==========================================================================
   1) Design Tokens (CSS Variables)
   --------------------------------------------------------------------------
   These variables are the single source of truth for colors and shared sizing.
   Changing a token affects every selector that references it.
   ========================================================================== */
:root {
    /* --- Brand / theme palette --- */
    --primary: #5867dd; /* Raveno blue accent */
    --primary-light: #7a89f8; /* Hover / lighter accent */
    --secondary: #202940; /* Cards + sidebar background */
    --secondary-dark: #171c2e; /* Page background */
    --dark: #0d0f1a; /* Global body background */
    --light: #b8bed6; /* Default light text on dark */
    --white: #ffffff;
    /* --- Semantic colors (status) --- */
    --success: #00b894;
    --danger: #ff4757;
    --warning: #ffa502;
    --info: #17a2b8;
    /* --- Shared geometry --- */
    --radius: 0.5rem;
    /* Sidebar width -- single source of truth (Session 108, widened from 250px
       per Ken so menu text stops wrapping). Referenced by .sidebar (Base.css)
       and .content's margin-left / width calc (site.css) -- update here only. */
    --sidebar-width: 280px;
    /* ======================================================================
       Data-entry sizing tokens (Executive Console Density)
       ----------------------------------------------------------------------
       Goal:
       - Standardize label + field sizing across all data entry screens.
       - Includes Bootstrap "sm" variants (.form-control-sm / .form-select-sm).
       - Tuned for: tighter, still readable (executive console density).
       ====================================================================== */
    /* Labels */
    --ui-label-font-size: 0.76rem;
    --ui-label-line-height: 1.15;
    /* Inputs / selects / textareas (standard) */
    --ui-input-font-size: 0.83rem;
    --ui-input-line-height: 1.2;
    --ui-input-padding-y: 0.20rem;
    --ui-input-padding-x: 0.50rem;
    --ui-input-min-height: 27px;
    /* Inputs/selects (Bootstrap *-sm variants) */
    --ui-input-sm-font-size: 0.80rem;
    --ui-input-sm-padding-y: 0.16rem;
    --ui-input-sm-padding-x: 0.40rem;
    --ui-input-sm-min-height: 25px;
}


/* ==========================================================================
   2) Global Reset
   --------------------------------------------------------------------------
   border-box sizing prevents width/height math surprises.
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}


/* ==========================================================================
   3) Base Typography & Page Background
   --------------------------------------------------------------------------
   Body line-height is intentionally roomy for non-form text.
   Data-entry rows override line-height via tokens below.
   ========================================================================== */
html, body {
    height: 100%;
    margin: 0;
    font-family: "Poppins", "Inter", sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--light);
    background-color: var(--dark);
}


/* ==========================================================================
   4) Headings & Links
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--white);
    font-weight: 600;
    margin-bottom: .5rem;
}

a {
    color: var(--primary);
    text-decoration: none;
}

    a:hover {
        color: var(--primary-light);
    }


/* ==========================================================================
   5) Buttons (Theme Overrides)
   --------------------------------------------------------------------------
   These complement Bootstrap button classes.
   ========================================================================== */
.btn-primary {
    background-color: var(--primary);
    border: 1px solid var(--primary);
    color: var(--white);
}

    .btn-primary:hover {
        background-color: var(--primary-light);
    }

.btn-outline-light {
    color: var(--white);
    border-color: rgba(255,255,255,.5);
}

    .btn-outline-light:hover {
        background: var(--white);
        color: var(--dark);
    }


/* ==========================================================================
   6) Layout Containers (Base)
   --------------------------------------------------------------------------
   Sidebar + content base styling; responsive behavior lives in site.css.
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--secondary);
    box-shadow: 0 0 10px rgba(0,0,0,.6);
    overflow-y: auto;
    transition: all .3s ease;
    z-index: 1030;
}

.content {
    background-color: var(--secondary-dark);
    min-height: 100vh;
    transition: margin-left .3s ease;
}


/* ==========================================================================
   7) Navbar
   ========================================================================== */
.navbar {
    background-color: var(--secondary);
    border-bottom: 1px solid rgba(255,255,255,.1);
}

    .navbar .nav-link {
        color: var(--light);
        font-weight: 500;
    }

        .navbar .nav-link:hover,
        .navbar .nav-link.active {
            color: var(--primary);
        }


/* ==========================================================================
   8) Toolbar
   ========================================================================== */
.toolbar {
    background: var(--secondary);
    border-bottom: 1px solid rgba(255,255,255,.05);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
}


/* ==========================================================================
   9) Footer
   ========================================================================== */
footer {
    background: var(--secondary);
    color: var(--light);
    font-size: .85rem;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,.05);
}


/* ==========================================================================
   10) Cards
   --------------------------------------------------------------------------
   .card-default is a theme-friendly card wrapper.
   ========================================================================== */
.card-default {
    background: var(--secondary);
    border: 1px solid rgba(255,255,255,.05);
    border-radius: var(--radius);
    transition: all .3s ease;
}

    /* Global Raveno panel header style */
    .card-default .card-header {
        background-color: var(--secondary);
        color: var(--white);
        font-weight: 600;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-top-left-radius: var(--radius);
        border-top-right-radius: var(--radius);
        padding: 0.75rem 1rem;
    }

    .card-default:hover {
        border-color: var(--primary);
        transform: translateY(-2px);
    }


/* Sidebar icons */
.sidebar .nav-link i {
    min-width: 1.75rem;
    font-size: 1.4rem;
    text-align: center;
}


/* ==========================================================================
   11) Scrollbar (WebKit)
   --------------------------------------------------------------------------
   Cosmetic scrollbar styling for Chrome/Edge/Safari.
   ========================================================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 8px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary-light);
    }


/* ==========================================================================
   12) Spinner
   --------------------------------------------------------------------------
   Simple show/hide behavior for a global loading indicator.
   ========================================================================== */
#spinner {
    z-index: 9999;
    transition: opacity .3s ease;
}

    #spinner.show {
        opacity: 1;
        visibility: visible;
    }

    #spinner:not(.show) {
        opacity: 0;
        visibility: hidden;
    }


/* ==========================================================================
   13) Data Entry Typography (GLOBAL)
   --------------------------------------------------------------------------
   This block is intentionally at the END of Base.css so it wins the cascade.
   It standardizes label + input sizing across the app, overriding Bootstrap.
   ========================================================================== */

/* Labels:
   - <label> and Bootstrap .form-label
   - Grid label cells: .stop-grid .lbl, .shipment-details-row > .lbl */
label,
.form-label,
.stop-grid .lbl,
.shipment-details-row > .lbl {
    font-size: var(--ui-label-font-size) !important;
    line-height: var(--ui-label-line-height) !important;
    margin-bottom: 0 !important; /* keeps rows compact */
}

/* Standard inputs / selects / textareas */
.form-control,
.form-select,
textarea.form-control {
    font-size: var(--ui-input-font-size) !important;
    line-height: var(--ui-input-line-height) !important;
    padding: var(--ui-input-padding-y) var(--ui-input-padding-x) !important;
    min-height: var(--ui-input-min-height) !important;
}

/* Small inputs / selects:
   Critical for dense components that use Bootstrap -sm variants */
.form-control-sm,
.form-select-sm {
    font-size: var(--ui-input-sm-font-size) !important;
    line-height: var(--ui-input-line-height) !important;
    padding: var(--ui-input-sm-padding-y) var(--ui-input-sm-padding-x) !important;
    min-height: var(--ui-input-sm-min-height) !important;
}

/* Checkboxes:
   - Remove extra vertical space from Bootstrap defaults
   - Keep optical alignment with tighter rows */
.form-check {
    min-height: auto !important;
    margin-bottom: 0 !important;
}

.form-check-input {
    margin-top: 0.12rem; /* optical alignment with smaller text */
}

/* Helper text under fields */
.form-text {
    font-size: 0.72rem;
    line-height: 1.15;
}
