/* Retro386.css - A DOS/Win 3.1 inspired theme compatible with Bootstrap class names */

/* --- Fonts --- */
@font-face {
    font-family: 'Fixedsys';
    src: url('../fonts/Fixedsys500c.eot');
    src: url('../fonts/Fixedsys500c.eot?#iefix') format('embedded-opentype'),
        url('../fonts/Fixedsys500c.woff') format('woff'),
        url('../fonts/Fixedsys500c.ttf') format('truetype'),
        url('../fonts/Fixedsys500c.svg#Fixedsys') format('svg');
    font-weight: normal;
    font-style: normal;
}

/* --- Global Reset & Body --- */
* {
    box-sizing: border-box;
}

body {
    background-color: #000084;
    /* Classic DOS Blue */
    color: #ffffff;
    font-family: 'Fixedsys', monospace;
    font-size: 16px;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    -webkit-font-smoothing: none;
    /* Keep pixelated look */
}

a {
    color: #00BFFF;
    text-decoration: none;
}

a:hover {
    background-color: #00BFFF;
    color: #ffffff;
}

/* --- Layout Utilities (Bootstrap Shim & Enhanced Grid) --- */
.container-fluid {
    padding: 15px;
    width: 100%;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px;
    margin-right: -10px;
}

[class*="col-"] {
    padding: 0 10px;
    position: relative;
    width: 100%;
}

/* Images and Canvas responsiveness */
img, canvas {
    max-width: 100%;
    height: auto;
}

/* Base columns (always horizontal unless wrapped) */
.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.33333333%; }
.col-2 { flex: 0 0 auto; width: 16.66666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.33333333%; }
.col-5 { flex: 0 0 auto; width: 41.66666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.33333333%; }
.col-8 { flex: 0 0 auto; width: 66.66666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .col-sm { flex: 1 0 0%; }
    .col-sm-auto { flex: 0 0 auto; width: auto; }
    .col-sm-1 { flex: 0 0 auto; width: 8.33333333%; }
    .col-sm-2 { flex: 0 0 auto; width: 16.66666667%; }
    .col-sm-3 { flex: 0 0 auto; width: 25%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.66666667%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-7 { flex: 0 0 auto; width: 58.33333333%; }
    .col-sm-8 { flex: 0 0 auto; width: 66.66666667%; }
    .col-sm-9 { flex: 0 0 auto; width: 75%; }
    .col-sm-10 { flex: 0 0 auto; width: 83.33333333%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.66666667%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .col-md { flex: 1 0 0%; }
    .col-md-auto { flex: 0 0 auto; width: auto; }
    .col-md-1 { flex: 0 0 auto; width: 8.33333333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.66666667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.66666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.33333333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.66666667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.33333333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.66666667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
    
    .offset-md-6 { margin-left: 50%; }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .col-lg { flex: 1 0 0%; }
    .col-lg-auto { flex: 0 0 auto; width: auto; }
    .col-lg-1 { flex: 0 0 auto; width: 8.33333333%; }
    .col-lg-2 { flex: 0 0 auto; width: 16.66666667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.66666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.33333333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.66666667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.33333333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.66666667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .col-xl { flex: 1 0 0%; }
    .col-xl-auto { flex: 0 0 auto; width: auto; }
    .col-xl-1 { flex: 0 0 auto; width: 8.33333333%; }
    .col-xl-2 { flex: 0 0 auto; width: 16.66666667%; }
    .col-xl-3 { flex: 0 0 auto; width: 25%; }
    .col-xl-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-xl-6 { flex: 0 0 auto; width: 50%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.66666667%; }
    .col-xl-12 { flex: 0 0 auto; width: 100%; }
}

@media (max-width: 768px) {
    .navbar-collapse {
        display: none;
        /* Simple mobile hide for now, JS will toggle */
    }

    .navbar-collapse.show {
        display: block;
    }
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-end {
    justify-content: flex-end;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 16px;
}

.g-2 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
    margin-top: calc(var(--bs-gutter-y) * -1);
    margin-right: calc(var(--bs-gutter-x) * -0.5);
    margin-left: calc(var(--bs-gutter-x) * -0.5);
}
.g-2 > * {
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
}

.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
    margin-top: calc(var(--bs-gutter-y) * -1);
    margin-right: calc(var(--bs-gutter-x) * -0.5);
    margin-left: calc(var(--bs-gutter-x) * -0.5);
}
.g-3 > * {
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }

.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }

.p-0 { padding: 0 !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 16px !important; }
.p-4 { padding: 24px !important; }

.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.text-end { text-align: right !important; }
.text-center { text-align: center !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }

/* Display utilities */
.d-block { display: block !important; }
.d-none { display: none !important; }
@media (min-width: 768px) {
    .d-md-block { display: block !important; }
    .d-md-none { display: none !important; }
    .d-md-flex { display: flex !important; }
}

/* --- Components: Navbar --- */
.navbar {
    background-color: #c0c0c0;
    /* Win 3.1 Grey */
    border-bottom: 2px solid #000;
    padding: 5px 10px;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 0 #fff inset;
    min-height: 50px;
}

.navbar-brand {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    white-space: nowrap;
}

.navbar-toggler {
    background: #c0c0c0;
    border: 2px outset #fff;
    cursor: pointer;
    padding: 5px;
    display: none;
    /* Hidden on desktop */
}

.navbar-collapse {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    /* Space between left nav and right user menu */
    align-items: center;
    padding-left: 20px;
}

/* Navbar Responsiveness - Trigger mobile menu sooner (at 1200px) */
@media (max-width: 1200px) {
    .navbar {
        flex-wrap: wrap;
    }

    .navbar-toggler {
        display: block;
    }

    .navbar-collapse {
        display: none;
        /* JS toggles this via .show class */
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding-left: 0;
        border-top: 2px solid #808080;
        margin-top: 5px;
    }

    .navbar-collapse.show {
        display: flex;
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .navbar-nav li {
        width: 100%;
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: 10px;
    }

    .navbar-nav {
        margin-bottom: 10px;
    }
    
    /* Mobile Dropdown adjustment */
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        box-shadow: none;
        border: 1px solid #808080;
        margin-top: 0;
        padding-left: 20px;
        background-color: #d0d0d0; /* Slightly different for contrast */
    }
}

.navbar-nav {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on larger screens if needed */
}

.nav-link {
    color: #000 !important;
    padding: 6px 8px; /* Reduced padding to save space */
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    background-color: #000084;
    color: #fff !important;
    border: 1px dotted #fff;
}

/* --- Components: Dropdowns --- */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 160px;
    padding: 2px;
    margin: 0;
    list-style: none;
    background-color: #c0c0c0;
    border: 2px solid #000;
    border-top-color: #fff;
    border-left-color: #fff;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
}

.dropdown-menu li {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 6px 12px;
    clear: both;
    font-weight: normal;
    line-height: 1.42857143;
    color: #000;
    white-space: nowrap;
    text-decoration: none;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus {
    background-color: #000084;
    color: #fff;
    text-decoration: none;
}

/* Mobile Dropdown adjustment */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        box-shadow: none;
        border: 1px solid #808080;
        margin-top: 0;
        padding-left: 20px;
    }
}

/* --- Components: Cards (Windows) --- */
.card,
.dashboard-card,
.metric-card,
.report-card,
.warehouse-card {
    background-color: #c0c0c0;
    color: #000;
    border: 2px solid #fff;
    border-right-color: #404040;
    border-bottom-color: #404040;
    margin-bottom: 20px;
    box-shadow: 4px 4px 0px #000;
    position: relative;
    padding: 2px;
    /* Inner border space */
}

.card-header,
.warehouse-header {
    background: #000084;
    /* Title bar blue */
    color: #fff;
    padding: 5px 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin: 0;
    font-size: 16px;
    text-transform: uppercase;
}

.card-body,
.warehouse-info {
    padding: 15px;
    border: 1px solid #808080;
    /* Inset look */
    border-right-color: #fff;
    border-bottom-color: #fff;
    margin: 2px;
}

.card-footer,
.warehouse-actions {
    padding: 10px;
    border-top: 1px solid #808080;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --- Components: Metrics --- */
.metric-card {
    display: flex;
    align-items: center;
    padding: 15px;
}

.metric-icon {
    font-size: 24px;
    margin-right: 15px;
    color: #000;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    display: block;
}

.metric-label {
    font-size: 12px;
    text-transform: uppercase;
}

.metric-card.warning {
    border: 2px solid #ffff00;
}

/* --- Components: Buttons --- */
.btn {
    display: inline-block;
    padding: 6px 15px;
    background-color: #c0c0c0;
    color: #000;
    border: 2px solid #fff;
    border-right-color: #404040;
    border-bottom-color: #404040;
    font-family: 'Fixedsys', monospace;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    text-align: center;
    box-shadow: 1px 1px 0 #000;
}

.btn:active {
    border: 2px solid #404040;
    border-right-color: #fff;
    border-bottom-color: #fff;
    transform: translate(1px, 1px);
    box-shadow: none;
}

.btn-primary {
    font-weight: bold;
}

.btn-success {
    color: #008000;
}

.btn-danger {
    color: #800000;
}

.btn-outline-danger {
    color: #800000;
    /* Default text color for outline danger */
    background-color: transparent;
    border-color: #800000;
}

.btn-outline-danger:hover {
    background-color: #800000;
    /* Dark red background on hover */
    color: #ffffff;
    /* White text on hover */
    border-color: #800000;
    /* Solid border matching background on hover */
    border-right-color: #fff;
    /* Retain 3D effect on right */
    border-bottom-color: #fff;
    /* Retain 3D effect on bottom */
}

.btn-secondary {
    color: #404040;
}

.btn-sm {
    padding: 5px 8px;
    font-size: 12px;
}

.btn-sm-asnd {
    padding: 5px;
    font-size: 16px;
    line-height: 1.3;
    margin-bottom: 10px;
}

/* --- Components: Forms --- */
.form-control,
.form-select {
    width: 100%;
    padding: 5px;
    font-family: 'Fixedsys', monospace;
    font-size: 16px;
    border: 2px solid #404040;
    border-right-color: #fff;
    border-bottom-color: #fff;
    background-color: #fff;
    color: #000;
    margin-bottom: 10px;
    box-shadow: inset 1px 1px 0 #000;
}

.form-control:focus {
    outline: none;
    background-color: #ffff00;
    /* Highlight on focus */
}

label {
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
}

/* --- Components: Tables --- */
.table-responsive {
    overflow-x: auto;
    border: 2px solid #808080;
    /* Inset */
    border-right-color: #fff;
    border-bottom-color: #fff;
    background: #fff;
}

.table {
    width: 100%;
    border-collapse: collapse;
    color: #000;
}

.table th {
    background-color: #000084;
    color: #fff;
    padding: 8px;
    text-align: left;
    border: 1px solid #fff;
}

.table td {
    padding: 8px;
    border: 1px solid #c0c0c0;
}

.table tr:hover {
    background-color: #ffff00;
}

/* --- Components: Badges --- */
.badge {
    padding: 2px 6px;
    background-color: #000;
    color: #fff;
    font-size: 12px;
}

.bg-success,
.status-normal {
    background-color: #008000;
}

.bg-warning,
.status-expiring {
    background-color: #808000;
    color: #fff;
}

.bg-danger,
.status-expired {
    background-color: #800000;
}

.bg-primary,
.status-active {
    background-color: #000084;
}

.bg-secondary {
    background-color: #808080;
}

/* --- Utilities --- */
@media (min-width: 768px) {
    .d-md-block {
        display: block !important;
    }
}

/* Custom Flexbox and Spacing Utilities */
.d-flex {
    display: flex;
}

.d-inline-flex {
    display: inline-flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.w-auto {
    width: auto;
}

.me-2 {
    margin-right: 0.5rem;
    /* Based on typical Bootstrap spacing */
}

/* --- Components: Modals --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* Dithered look approx */
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active,
.modal.show {
    display: flex;
}

/* --- Components: Collapse --- */
.collapse {
    display: none;
}

.collapse.show {
    display: block;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

.modal-dialog {
    width: 90%;
    max-width: 600px;
}

.modal-content {
    background-color: #c0c0c0;
    border: 2px solid #fff;
    box-shadow: 10px 10px 0 #000;
}

.modal-header {
    background: #000084;
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
}

.modal-title {
    margin: 0;
}

.modal-close,
.btn-close {
    background: #c0c0c0;
    border: 1px outset #fff;
    color: #000;
    font-weight: bold;
    width: 24px;
    height: 24px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 10px;
    border-top: 1px solid #808080;
    text-align: right;
}

/* --- Components: Alerts --- */
.alert {
    padding: 10px;
    margin-bottom: 15px;
    border: 2px solid;
    color: #000;
    background: #fff;
    font-weight: bold;
    box-shadow: 4px 4px 0 #000;
}

.alert-success {
    border-color: #008000;
    color: #008000;
}

.alert-danger {
    border-color: #800000;
    color: #800000;
}

.alert-warning {
    border-color: #808000;
    color: #808000;
}

.alert-info {
    border-color: #000084;
    color: #000084;
}

/* --- Components: Tabs --- */

.nav { /* General nav styling, often for horizontal lists */

    display: flex;

    flex-wrap: wrap; /* Allow items to wrap to next line if needed */

    list-style: none;

}



.nav-tabs {

    border-bottom: 2px solid #000; /* Dark border at the bottom of the tab bar */

    margin-bottom: 10px; /* Space between tabs and content */

}



.nav-item {

    margin-bottom: -2px; /* Pull nav-items up to overlap the border */

}



.nav-tabs .nav-link {

    display: block;

    padding: 6px 12px;

    background-color: #c0c0c0; /* Default tab background */

    color: #000;

    border: 2px solid #fff;

    border-right-color: #404040;

    border-bottom-color: #404040;

    margin-right: 5px; /* Space between tabs */

    text-transform: uppercase;

    font-weight: bold;

    cursor: pointer;

}



.nav-tabs .nav-link:hover {

    background-color: #a0a0a0; /* Slightly darker on hover */

}



.nav-tabs .nav-link.active {

    background-color: #b0b0b0; /* Active tab slightly different background */

    border-top: 2px solid #404040; /* Inset effect for active tab */

    border-left: 2px solid #404040;

    border-bottom: none; /* Remove bottom border to connect to content */

    border-right: 2px solid #fff;

}



/* Tab Pane Content */

.tab-content > .tab-pane {

    display: none;

}



.tab-content > .active {

    display: block;

}



.tab-content > .fade.show {

    display: block;

}



/* Fix for tab content when both active and show are present */

.tab-content > .fade.show.active {

    display: block;

}



/* --- Components: Pagination --- */

ul.pagination {

    list-style: none;

}



.pagination {

    display: flex;

    justify-content: center;

    gap: 5px;

    margin-top: 20px;

}

.page-link {
    background: #c0c0c0;
    border: 2px outset #fff;
    padding: 5px 10px;
    color: #000;
    text-decoration: none;
}

.page-item.active .page-link {
    background: #000084;
    color: #fff;
    border: 2px inset #fff;
}

/* --- Chart Canvas --- */
canvas {
    background-color: #fff;
    border: 2px inset #fff;
    padding: 10px;
}

/* --- Responsive Table (Card View) --- */
@media (max-width: 768px) {
    /* Force table to not be like tables anymore */
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
    }

    /* Hide table headers (but not display: none;, for accessibility) */
    .table-responsive thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive tr {
        border: 2px solid #000;
        border-bottom-width: 4px; /* Simulating card border */
        margin-bottom: 15px;
        background: #c0c0c0; /* Match card bg */
        padding: 5px;
        box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    }

    .table-responsive td {
        /* Behave like a "row" */
        border: none;
        border-bottom: 1px dotted #808080;
        position: relative;
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        text-align: right;
        white-space: normal; /* Allow text wrapping */
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 35px;
    }

    .table-responsive td:last-child {
        border-bottom: 0;
    }

    .table-responsive td::before {
        /* Now like a table header */
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
        color: #404040;
        margin-right: auto;
        padding-right: 15px;
        text-align: left;
    }
    
    /* Adjustments for specific cell types if needed */
    .table-responsive td .btn-group {
        display: flex;
        justify-content: flex-end;
        gap: 5px;
        width: 100%;
    }
    
    .table-responsive td .btn {
        margin-bottom: 0;
    }
}

/* Fix for Navbar on large screens (>1200px) */
/* Override .collapse { display: none; } which hides the menu on desktop */
@media (min-width: 1201px) {
    .navbar-collapse.collapse {
        display: flex !important;
    }
}