/* ==========================================================================
   Agro Supply - Theme Overrides
   --------------------------------------------------------------------------
   Layers a plain white / black-text / green visual identity on top of the
   bundled Coderthemes admin theme + Bootstrap 4, without editing the
   compiled vendor CSS (app.min.css has no readable source in this repo).
   Brand green is the color already live in production (navbar + active
   sidebar links) - no new brand color introduced.
   Load this AFTER app.min.css / bootstrap.min.css / style.css so these
   rules win by source order; a few !important flags are used only where
   needed to beat the theme's own high-specificity rules.
   ========================================================================== */

:root {
    --brand-green-dark: #035f48;
    --brand-green: #04724f;
    --brand-green-light: #e6f3ee;
    --brand-green-active: #006417;
    --text-color: #212529;
}

/* ---------------------------------------------------------------------- */
/* Base                                                                    */
/* ---------------------------------------------------------------------- */
html {
    zoom: 90%;
}

body {
    background-color: #ffffff !important;
    color: var(--text-color);
}

a {
    color: var(--brand-green);
}
a:hover,
a:focus {
    color: var(--brand-green-dark);
}

/* ---------------------------------------------------------------------- */
/* Sidebar / topbar - sidebar background is already white in the bundled  */
/* theme; only the link colors need overriding away from stock purple.    */
/* Top navbar mirrors the sidebar's white-background/green-text look;     */
/* the sidebar itself is left as-is (already white bg, green accents).    */
/* ---------------------------------------------------------------------- */
.navbar-custom {
    background-color: #ffffff;
    border-bottom: 1px solid #eef0f2;
}

.navbar-custom .text-white,
.navbar-custom .nav-link,
.navbar-custom .pro-user-name,
.navbar-custom .button-menu-mobile,
.navbar-custom .topnav-menu > li > a {
    color: var(--brand-green-dark) !important;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link:focus,
.navbar-custom .button-menu-mobile:hover {
    color: var(--brand-green-active) !important;
}

.navbar-custom .user-location-badge {
    color: var(--brand-green-dark);
    font-size: 0.8rem;
    font-weight: 600;
}
.navbar-custom .user-location-badge i {
    margin-right: 0.25rem;
}

#sidebar-menu > ul > li > a,
.nav-second-level li a,
.nav-thrid-level li a,
.nav-third-level li a {
    color: #343a40;
}

.nav-second-level li a:focus,
.nav-second-level li a:hover,
.nav-thrid-level li a:focus,
.nav-thrid-level li a:hover,
#sidebar-menu > ul > li > a.active,
#sidebar-menu > ul > li > a:active,
#sidebar-menu > ul > li > a:focus,
#sidebar-menu > ul > li > a:hover,
.nav-second-level li.active > a,
.nav-third-level li.active > a {
    color: var(--brand-green-active) !important;
}

/* ---------------------------------------------------------------------- */
/* Primary brand color -> green (buttons, badges, tabs, form focus,       */
/* pagination). Success/Warning/Danger intentionally left as the theme's  */
/* amber/red/teal defaults so status semantics (low stock, overdue,       */
/* delete) stay visually distinct from ordinary primary actions.          */
/* ---------------------------------------------------------------------- */
.btn-primary,
.badge-primary {
    background-color: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: var(--brand-green-active);
    border-color: var(--brand-green-active);
    box-shadow: 0 0 0 2px rgba(3, 95, 72, 0.5);
}
.btn-outline-primary {
    color: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}
.btn-outline-primary:hover {
    background-color: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}
.text-primary {
    color: var(--brand-green-dark) !important;
}

.nav-tabs .nav-link.active {
    border-color: var(--brand-green-dark);
    color: var(--brand-green-dark);
}

.form-control:focus,
.custom-select:focus {
    border-color: var(--brand-green);
    box-shadow: 0 0 0 0.2rem rgba(3, 95, 72, 0.15);
}

.page-item.active .page-link {
    background-color: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}

.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before,
.custom-radio .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}

/* Success kept a distinguishable shade so it doesn't read the same as
   "primary" action buttons. */
.btn-success,
.badge-success {
    background-color: #1b9e6b;
    border-color: #1b9e6b;
}
.btn-success:hover,
.btn-success:focus {
    background-color: #167f56;
    border-color: #167f56;
}

/* ---------------------------------------------------------------------- */
/* Page headers - every view uses whatever heading level (h1-h5) it       */
/* happened to be written with as its title, with no real hierarchy      */
/* between them, so normalize all of them to one consistent size/weight  */
/* wherever they appear inside the main content area (not modals,        */
/* dropdowns, or the sidebar, which have their own heading roles).       */
/* ---------------------------------------------------------------------- */
.content-page h1:not(.modal-title),
.content-page h2:not(.modal-title),
.content-page h3:not(.modal-title),
.content-page h4:not(.modal-title),
.content-page h5:not(.modal-title),
main.py-4 h1:not(.modal-title),
main.py-4 h2:not(.modal-title),
main.py-4 h3:not(.modal-title),
main.py-4 h4:not(.modal-title),
main.py-4 h5:not(.modal-title) {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

/* ---------------------------------------------------------------------- */
/* Cards / tables                                                         */
/* ---------------------------------------------------------------------- */
.card,
.card-box {
    border: 1px solid #eef0f2;
}

table.table thead th {
    color: var(--text-color);
}

/* ---------------------------------------------------------------------- */
/* DataTables chrome                                                      */
/* ---------------------------------------------------------------------- */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #dee2e6;
    border-radius: 4px;
}
.dataTables_wrapper .dt-buttons .btn {
    background-color: var(--brand-green-dark);
    color: #fff;
    border-color: var(--brand-green-dark);
}
.dataTables_wrapper .dt-buttons .btn:hover {
    background-color: var(--brand-green-active);
    border-color: var(--brand-green-active);
}
table.dataTable thead th {
    border-bottom: 2px solid var(--brand-green-dark);
}
/* scrollY mode: keep the fixed thead/tfoot bands opaque (not see-through)
   as body rows scroll underneath them. */
.dataTables_scrollHead,
.dataTables_scrollHead thead th,
.dataTables_scrollFoot,
.dataTables_scrollFoot tfoot th {
    background-color: #ffffff;
}
.dataTables_scrollFoot tfoot th {
    border-top: 2px solid var(--brand-green-dark);
    font-weight: 700;
}
.dataTables_scrollBody {
    border-bottom: 1px solid #eef0f2;
}
.paginate_button.current,
.paginate_button.current:hover {
    background: var(--brand-green-dark) !important;
    border-color: var(--brand-green-dark) !important;
    color: #fff !important;
}

/* ---------------------------------------------------------------------- */
/* Stat cards (mini dashboards)                                           */
/* ---------------------------------------------------------------------- */
.stat-card {
    border: 1px solid #eef0f2;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    background: #fff;
    height: 100%;
}
.stat-card .stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    margin-right: 1rem;
    flex-shrink: 0;
}
.stat-card .stat-card-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}
.stat-card .stat-card-label {
    font-size: 0.8rem;
    color: #72747b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.stat-card-icon.bg-primary { background-color: var(--brand-green-dark); }
.stat-card-icon.bg-success { background-color: #1b9e6b; }
.stat-card-icon.bg-warning { background-color: #f7b84b; }
.stat-card-icon.bg-danger { background-color: #f1556c; }
.stat-card-icon.bg-info { background-color: #4a81d4; }

/* Compact variant - stat-card.blade.php's size=sm prop */
.stat-card.stat-card-sm {
    padding: 0.5rem 0.75rem;
}
.stat-card.stat-card-sm .stat-card-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    margin-right: 0.6rem;
}
.stat-card.stat-card-sm .stat-card-value {
    font-size: 1rem;
}
.stat-card.stat-card-sm .stat-card-label {
    font-size: 0.65rem;
}

/* ---------------------------------------------------------------------- */
/* Filter bars                                                            */
/* ---------------------------------------------------------------------- */
.filter-bar {
    background: #f8f9fa;
    border: 1px solid #eef0f2;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* ---------------------------------------------------------------------- */
/* Mobile responsiveness helpers                                          */
/* ---------------------------------------------------------------------- */
@media (max-width: 767px) {
    .filter-bar .form-group,
    .filter-bar > .row > div {
        margin-bottom: 0.5rem;
    }
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* ---------------------------------------------------------------------- */
/* Print documents - shared across every invoice/receipt/dispatch note.   */
/* Individual print views only hide their own nav/buttons via .no-print   */
/* or #hide_form; the sidebar/navbar reserved space and the browser's     */
/* default "strip background colors" behavior were never reset before,   */
/* so print output looked visibly different from the on-screen page.     */
/* ---------------------------------------------------------------------- */
@media print {
    .content-page {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
    }
    .left-side-menu,
    .navbar-custom,
    .footer,
    .rightbar-overlay,
    .button-menu-mobile {
        display: none !important;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}

/* Standard accent divider used on printed invoices/receipts - one green
   rule instead of every print view redefining its own inline <hr>. */
.invoice-divider {
    height: 3px;
    border: none;
    color: var(--brand-green-dark);
    background-color: var(--brand-green-dark);
    margin: 0.75rem 0 1.25rem 0;
}
