/* ==========================================================================
   Osun e-Procurement — Admin theme overlay
   Loaded LAST on every admin page (via header_file.php) to restyle the legacy
   FlatLab admin template to match the public site (css/custom.css).
   Palette + type mirror the home pages: maroon / gold / navy / cream, Poppins.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --osun-maroon: #3b0a0a;
    --osun-maroon-dark: #240505;
    --osun-maroon-light: #5c1414;
    --osun-gold: #c9992e;
    --osun-gold-light: #e8c766;
    --osun-navy: #142238;
    --osun-navy-light: #22375c;
    --osun-cream: #FFF9DE;
    --osun-ink: #241512;
    --osun-line: rgba(59, 10, 10, .10);
    --osun-shadow: 0 8px 26px rgba(36, 21, 18, .08);
}

/* ---------- base ---------- */
body,
body.login-body {
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
    background: #f4f1e6 !important;
    color: #2f2a26;
    font-size: 14px;
}

#main-content,
.wrapper {
    background: transparent !important;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; }
a { color: var(--osun-maroon); }
a:hover { color: var(--osun-gold); }

/* ==========================================================================
   Top header bar
   ========================================================================== */
header.header,
.header.white-bg {
    background: #ffffff !important;
    box-shadow: 0 2px 12px rgba(36, 21, 18, .07);
    border-bottom: 1px solid #ece7da !important;
}

/* thin gold hairline under the header for a subtle brand cue */
header.header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--osun-gold), var(--osun-gold-light) 45%, transparent);
    opacity: .55;
}

header.header .logo,
header.header .logo strong {
    color: var(--osun-maroon) !important;
    font-weight: 700;
}

header.header .sidebar-toggle-box .fa-bars {
    color: var(--osun-maroon);
}

header.header .search {
    background: #f6f2e8 !important;
    border: 1px solid #e4ddcb !important;
    border-radius: 30px !important;
    color: #2f2a26 !important;
    padding-left: 16px;
}

header.header .search::placeholder { color: #9a9186; }

header.header .top-menu .username { color: var(--osun-ink); font-weight: 600; }
header.header .notify-row .dropdown > a,
header.header .top-menu .dropdown > a { color: var(--osun-maroon) !important; }
header.header .top-menu .dropdown > a:hover { color: var(--osun-gold) !important; }
header.header .badge.badge-danger { background: var(--osun-gold); color: var(--osun-ink); }

/* ==========================================================================
   Sidebar
   ========================================================================== */
#sidebar,
aside {
    background: #f7f2e8 !important;
    border-right: 1px solid #ece7da;
}

/* smooth collapse / expand of the sidebar and content */
#sidebar { transition: margin-left .22s ease; }
#main-content { transition: margin-left .22s ease; }

/* a little more width so menu labels fit (desktop only; mirrors base 210px) */
@media (min-width: 769px) {
    #sidebar { width: 238px; }
    #main-content { margin-left: 238px; }
    .is-sidebar-nav-open #sidebar { margin-left: -238px; }
    .is-sidebar-nav-open #main-content { margin-left: 0; }
}

.sidebar-menu {
    background: transparent !important;
    padding-top: 10px;
}
/* full height only on desktop; on mobile the sidebar is an auto-height overlay */
@media (min-width: 769px) {
    .sidebar-menu { min-height: 100vh; }
}

.sidebar-menu li a i { font-size: 1rem; }

/* --- Keep labels on one line; never let text cover the collapse caret ---
   (#sidebar prefix so these beat the base `ul.sidebar-menu li a` rules) --- */
/* shift top-level items toward the left edge so labels are contained */
#sidebar .sidebar-menu > li { margin-left: 6px !important; margin-right: 6px !important; }
#sidebar .sidebar-menu > li > a {
    display: flex !important;
    align-items: center;
    gap: 8px;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    padding: 12px 8px !important;
}
#sidebar .sidebar-menu > li > a > i {
    flex: 0 0 18px;
    padding: 0 !important;
    margin: 0 !important;
    text-align: center;
    font-size: 1rem;
}
#sidebar .sidebar-menu > li > a > span {
    display: block !important;
    flex: 1 1 auto;
    min-width: 0;               /* allow the flex item to shrink so ellipsis works */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* reserve just enough on the right of collapsible parents for the caret */
#sidebar .sidebar-menu > li.sub-menu > a { padding-right: 28px !important; }

/* pin the accordion caret to the right edge, on top of everything */
#sidebar .sidebar-menu .dcjq-icon {
    position: absolute !important;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    float: none !important;
    margin: 0 !important;
    z-index: 3;
}
#sidebar .sidebar-menu .dcjq-icon:before {
    position: static;
    top: auto;
    right: auto;
}

/* --- Sub-menu palette + spacing: flow with the light sidebar and use the
   full width (override base dark colors AND the base 32px left indent) --- */
#sidebar .sidebar-menu li ul.sub {
    background: rgba(59, 10, 10, .035) !important;
    border-radius: 8px;
    margin: 2px 8px 6px !important;
    padding: 4px 0 !important;
    overflow: hidden;
}
#sidebar .sidebar-menu li ul.sub li,
#sidebar .sub-menu > .sub li {
    background: transparent !important;
    margin: 0 !important;
    padding-left: 0 !important;   /* kill the base 32px indent */
}
#sidebar .sidebar-menu li ul.sub li a {
    display: block !important;
    color: #5f574c !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding: 8px 10px 8px 34px !important;  /* 34px lines the label up under the parent label */
    margin: 0 !important;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color .18s ease, color .18s ease;
}
/* small bullet so items read as a list without a big blank indent */
#sidebar .sidebar-menu li ul.sub li a::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    border-radius: 50%;
    background: var(--osun-gold);
    opacity: .55;
}
#sidebar .sidebar-menu li ul.sub li a { position: relative; }
#sidebar .sidebar-menu li ul.sub li a:hover,
#sidebar .sidebar-menu li ul.sub li.active a {
    color: var(--osun-maroon) !important;
    background: rgba(201, 153, 46, .16) !important;
}
#sidebar .sidebar-menu li ul.sub li a:hover::before,
#sidebar .sidebar-menu li ul.sub li.active a::before { opacity: 1; }

.sidebar-menu > li > a {
    color: #5b5348 !important;
    border: 0 !important;
    border-radius: 10px;
    margin: 3px 10px;
    padding: 11px 14px !important;
    font-size: .9rem;
    font-weight: 500;
    transition: background-color .18s ease, color .18s ease;
}

.sidebar-menu > li > a:hover {
    background: #efe6d1 !important;
    color: var(--osun-maroon) !important;
}

.sidebar-menu > li.active > a,
.sidebar-menu > li > a.active {
    background: rgba(201, 153, 46, .16) !important;
    color: var(--osun-maroon) !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--osun-gold);
}

.sidebar-menu li a i {
    color: #b08a2e !important;
    width: 22px;
    text-align: center;
}
.sidebar-menu > li.active > a i,
.sidebar-menu > li > a.active i { color: var(--osun-maroon) !important; }

/* fly-out / accordion sub menu */
.sidebar-menu .sub {
    background: rgba(59, 10, 10, .04) !important;
    border-radius: 8px;
    margin: 0 10px 6px;
    padding: 4px 0;
}

.sidebar-menu .sub li a {
    color: #6b6258 !important;
    padding: 8px 14px 8px 44px !important;
    font-size: .84rem;
    border: 0 !important;
}

.sidebar-menu .sub li a:hover,
.sidebar-menu .sub li.active a {
    color: var(--osun-maroon) !important;
    background: rgba(201, 153, 46, .12) !important;
}

.sidebar-menu li.sub-menu > a:after {
    color: #b3a894;
}

/* ==========================================================================
   Cards / panels
   ========================================================================== */
.card,
section.card,
.panel {
    background: #fff !important;
    border: 1px solid var(--osun-line) !important;
    border-radius: 16px !important;
    box-shadow: var(--osun-shadow) !important;
    overflow: hidden;
    margin-bottom: 22px;
}

.card > .card-header,
.card-header {
    background: #fff !important;
    color: var(--osun-maroon) !important;
    font-weight: 700 !important;
    font-size: .98rem;
    letter-spacing: .2px;
    border-bottom: 1px solid var(--osun-line) !important;
    padding: 16px 20px !important;
    text-transform: none;
}

.card > .card-header::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 18px;
    background: var(--osun-gold);
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: -3px;
}

.card-body { padding: 20px !important; }

.card-footer {
    background: #faf7ee !important;
    border-top: 1px solid var(--osun-line) !important;
    border-radius: 0 0 16px 16px;
}

/* page section headers used across admin */
.border-head h3 {
    color: var(--osun-maroon);
    font-weight: 800;
    border-left: 5px solid var(--osun-gold);
    padding-left: 12px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table {
    background: #fff;
    border-radius: 12px;
}

.table thead th,
table.table thead tr th {
    background: var(--osun-cream) !important;
    color: var(--osun-maroon) !important;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-size: .72rem !important;
    font-weight: 700 !important;
    border-bottom: 2px solid rgba(59, 10, 10, .12) !important;
    border-top: 0 !important;
    vertical-align: middle;
}

.table tbody td,
table.table tbody tr td {
    font-size: .82rem !important;
    vertical-align: middle;
    border-color: #f0ece0 !important;
}

.table-striped tbody tr:nth-of-type(odd) { background-color: #fcfbf5; }
.table-hover tbody tr:hover,
.table tbody tr:hover { background-color: rgba(201, 153, 46, .10) !important; }

/* ==========================================================================
   Buttons  (keep semantic meaning, modernise the look)
   ========================================================================== */
.btn {
    border-radius: 8px !important;
    font-weight: 600;
    letter-spacing: .2px;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--osun-maroon) !important;
    border-color: var(--osun-maroon) !important;
    color: #fff !important;
}
.btn-primary:hover { background: var(--osun-maroon-light) !important; }

.btn-info {
    background: var(--osun-navy) !important;
    border-color: var(--osun-navy) !important;
    color: #fff !important;
}
.btn-info:hover { background: var(--osun-navy-light) !important; }

.btn-success { background: #1b7a4b !important; border-color: #1b7a4b !important; color: #fff !important; }
.btn-success:hover { background: #21935a !important; }

.btn-danger { background: #b02a37 !important; border-color: #b02a37 !important; color: #fff !important; }
.btn-danger:hover { background: #c8323f !important; }

.btn-warning {
    background: var(--osun-gold) !important;
    border-color: var(--osun-gold) !important;
    color: var(--osun-ink) !important;
}
.btn-warning:hover { background: var(--osun-gold-light) !important; color: var(--osun-ink) !important; }

.btn-default,
.btn-light {
    background: #fff !important;
    border: 1px solid var(--osun-line) !important;
    color: var(--osun-maroon) !important;
}
.btn-default:hover,
.btn-light:hover { background: var(--osun-cream) !important; }

.btn-xs { padding: 3px 9px !important; font-size: .72rem !important; border-radius: 6px !important; }

/* --- Tender Lot setup buttons (shared across advert create/edit pages) --- */
.lot-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.lot-field { display: flex; flex-direction: column; gap: 4px; min-width: 240px; }
.lot-field label { font-size: .7rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #8a8175; margin: 0; }
.btn-lot {
    display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
    border: 0; border-radius: 12px; padding: 9px 16px 9px 9px; font-weight: 700; font-size: .85rem;
    color: #fff; background: linear-gradient(135deg, var(--osun-maroon, #3b0a0a), var(--osun-maroon-light, #5c1414));
    box-shadow: 0 8px 18px rgba(59, 10, 10, .25); transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn-lot:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(59, 10, 10, .32); filter: brightness(1.04); color: #fff; }
.btn-lot.btn-lot-add { background: linear-gradient(135deg, #155e3b, #1b7a4b); box-shadow: 0 8px 18px rgba(21, 94, 59, .25); }
.btn-lot.btn-lot-add:hover { box-shadow: 0 12px 24px rgba(21, 94, 59, .32); }
.btn-lot .lot-ic {
    width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .18); font-size: 1rem; flex: 0 0 auto;
}
.btn-lot .lot-body { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.btn-lot .lot-body small { font-weight: 500; font-size: .66rem; opacity: .8; }
.lot-select { min-width: 240px; border-radius: 10px !important; }

/* Links used as button labels must inherit the button's text colour
   (many buttons wrap their text in an <a>; without this the label takes the
   maroon link colour and disappears on a coloured button until hover) */
.btn > a,
.btn a { color: inherit !important; text-decoration: none !important; }
.btn > a:hover,
.btn a:hover { color: inherit !important; }
.btn > a > span,
.btn a font { color: inherit !important; }

/* nav pills used on the multi-tab forms (procurement, etc.) */
.nav-tabs .nav-link.btn-light.active,
.nav-tabs .nav-link.active {
    background: var(--osun-maroon) !important;
    border-color: var(--osun-maroon) !important;
    color: #fff !important;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control,
select.form-control,
textarea.form-control {
    border-radius: 8px !important;
    border: 1px solid #ddd6c4 !important;
    font-size: .86rem;
    padding: .5rem .8rem;
    background: #fff;
    box-shadow: none !important;
}

.form-control:focus {
    border-color: var(--osun-gold) !important;
    box-shadow: 0 0 0 .18rem rgba(201, 153, 46, .18) !important;
}

label { color: #4a423b; font-weight: 600; font-size: .8rem; }

hr { border-color: var(--osun-line) !important; }

/* ==========================================================================
   Badges, alerts, pagination
   ========================================================================== */
.badge { border-radius: 30px; padding: .4em .7em; font-weight: 600; }
.badge-success { background: #1b7a4b !important; }
.badge-danger  { background: #b02a37 !important; }
.badge-warning { background: var(--osun-gold) !important; color: var(--osun-ink) !important; }
.badge-info    { background: var(--osun-navy) !important; }
.badge-secondary { background: #8a8175 !important; color: #fff; }

.alert { border-radius: 12px; border: 0; }
.alert-success { background: #e3f3ea; color: #14663f; }
.alert-danger  { background: #fbe6e8; color: #8f2531; }
.alert-warning { background: #fdf3d9; color: #7a5a12; }
.alert-info    { background: #e7edf7; color: #1d3357; }

.dataTables_paginate .paginate_button,
.pagination > li > a {
    border-radius: 8px !important;
    margin: 0 2px;
    color: var(--osun-maroon) !important;
    border-color: var(--osun-line) !important;
}
.dataTables_paginate .paginate_button.current,
.pagination > .active > a {
    background: var(--osun-maroon) !important;
    border-color: var(--osun-maroon) !important;
    color: #fff !important;
}

/* ==========================================================================
   Dashboard stat widgets  (.state-overview)
   ========================================================================== */
.state-overview .card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border-radius: 16px !important;
}

.state-overview .symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    font-size: 1.7rem;
    color: #fff;
}
.state-overview .symbol.terques { background: linear-gradient(135deg, var(--osun-navy), var(--osun-navy-light)); }
.state-overview .symbol.red     { background: linear-gradient(135deg, #8f2531, #b02a37); }
.state-overview .symbol.yellow  { background: linear-gradient(135deg, var(--osun-gold), var(--osun-gold-light)); color: var(--osun-ink); }
.state-overview .symbol.blue    { background: linear-gradient(135deg, var(--osun-maroon), var(--osun-maroon-light)); }

.state-overview .value {
    padding: 14px 18px;
    flex: 1 1 auto;
}
.state-overview .value h1 {
    color: var(--osun-maroon);
    font-weight: 800;
    margin: 0 0 2px;
}
.state-overview .value p { color: #7a7266; margin: 0; font-size: .8rem; }

/* dashboard custom bar chart accent */
.custom-bar-chart .bar .value { background: var(--osun-maroon) !important; }
.custom-bar-chart .bar:hover .value { background: var(--osun-gold) !important; color: var(--osun-ink); }

/* ==========================================================================
   Login / Register auth pages
   ========================================================================== */
body.login-body {
    background: linear-gradient(125deg, var(--osun-maroon-dark) 0%, var(--osun-maroon) 45%, var(--osun-navy) 100%) !important;
    min-height: 100vh;
}

body.login-body .form-signin {
    margin-top: 6vh !important;
    border-radius: 18px !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .35) !important;
    padding: 26px 26px 30px !important;
    border: 0;
}

body.login-body .form-signin h5 { color: var(--osun-maroon) !important; }

body.login-body .login-wrap .form-control { margin-bottom: 14px; }

body.login-body .btn-login,
body.login-body .btn-danger.btn-login {
    background: var(--osun-maroon) !important;
    border-color: var(--osun-maroon) !important;
    border-radius: 8px !important;
    font-weight: 700;
    padding: .7rem !important;
}
body.login-body .btn-login:hover { background: var(--osun-maroon-light) !important; }

body.login-body .registration { color: #7a7266; font-size: .85rem; margin-top: 12px; }
body.login-body .registration a { color: var(--osun-gold); font-weight: 700; }

/* ==========================================================================
   Dashboard components (shared by all role dashboards)
   ========================================================================== */
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.dash-head h2 { color: var(--osun-maroon); font-weight: 800; margin: 0; font-size: 1.5rem; }
.dash-head .sub { color: #8a8175; font-size: .86rem; margin-top: 2px; }
.dash-actions .btn { margin-left: 6px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 20px; }
.kpi { position: relative; border-radius: 18px; padding: 20px; color: #fff; overflow: hidden; box-shadow: 0 14px 30px rgba(36, 21, 18, .18); }
.kpi .bi { position: absolute; right: -6px; bottom: -10px; font-size: 5rem; opacity: .16; }
.kpi .kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; opacity: .9; font-weight: 600; }
.kpi .kpi-value { font-size: 2.1rem; font-weight: 800; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .kpi-foot { font-size: .76rem; opacity: .9; margin-top: 6px; }
.kpi.k-maroon { background: linear-gradient(135deg, #3b0a0a, #5c1414); }
.kpi.k-navy   { background: linear-gradient(135deg, #142238, #22375c); }
.kpi.k-gold   { background: linear-gradient(135deg, #c9992e, #e8c766); color: #241512; }
.kpi.k-green  { background: linear-gradient(135deg, #155e3b, #1b7a4b); }

.chip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.chip { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--osun-line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 8px 22px rgba(36, 21, 18, .06); }
.chip .ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex: 0 0 auto; }
.chip .ic.a { background: rgba(27, 122, 75, .12); color: #1b7a4b; }
.chip .ic.b { background: rgba(201, 153, 46, .15); color: #a9781c; }
.chip .ic.c { background: rgba(20, 34, 56, .10); color: #22375c; }
.chip .ic.d { background: rgba(176, 42, 55, .12); color: #b02a37; }
.chip .n { font-size: 1.35rem; font-weight: 800; color: var(--osun-maroon); line-height: 1; font-variant-numeric: tabular-nums; }
.chip .l { font-size: .75rem; color: #8a8175; }

.dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 22px; }
.dash-row-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; margin-bottom: 22px; }
@media (max-width: 1100px) { .kpi-grid, .chip-grid { grid-template-columns: repeat(2, 1fr); } .dash-row, .dash-row-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px)  { .kpi-grid, .chip-grid { grid-template-columns: 1fr; } }

.panel-card { background: #fff; border: 1px solid var(--osun-line); border-radius: 16px; box-shadow: 0 8px 26px rgba(36, 21, 18, .07); overflow: hidden; height: 100%; }
.panel-card .ph { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--osun-line); }
.panel-card .ph h3 { margin: 0; font-size: .98rem; font-weight: 700; color: var(--osun-maroon); }
.panel-card .ph h3::before { content: ""; display: inline-block; width: 5px; height: 16px; background: var(--osun-gold); border-radius: 4px; margin-right: 9px; vertical-align: -2px; }
.panel-card .ph .mut { font-size: .76rem; color: #9a9186; }
.panel-card .pb { padding: 18px; }
.panel-card table { margin: 0; }
.panel-card table td, .panel-card table th { padding: 10px 18px !important; }

.legend { list-style: none; margin: 14px 0 0; padding: 0; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: #5a5248; margin-bottom: 8px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.legend .v { margin-left: auto; font-weight: 700; color: #2f2a26; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; justify-content: center; position: relative; }
.donut-center { position: absolute; text-align: center; }
.donut-center .dc-n { font-size: 1.6rem; font-weight: 800; color: var(--osun-maroon); }
.donut-center .dc-l { font-size: .72rem; color: #8a8175; text-transform: uppercase; letter-spacing: .5px; }

.reg-status-card { text-align: center; padding: 26px 18px; }
.reg-status-card .rs-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 700; padding: 10px 20px; border-radius: 30px; }
.rs-approved { background: rgba(27, 122, 75, .12); color: #14663f; }
.rs-pending  { background: rgba(201, 153, 46, .15); color: #7a5a12; }
.rs-rejected { background: rgba(176, 42, 55, .12); color: #8f2531; }

/* ==========================================================================
   Content pages — layout & entrance
   ========================================================================== */
/* keep the 80px top clearance for the fixed header (base template relies on it)
   so page content never floats up under the header bar */
#main-content .wrapper { padding: 84px 24px 40px !important; }
#main-content .wrapper > .row:first-child,
#main-content .wrapper > .card:first-child,
#main-content .wrapper > .dash-head { animation: osunFade .35s ease both; }
@keyframes osunFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #main-content .wrapper > * { animation: none !important; } }

/* Plain page title (pages that use <h2>/<h3> straight in the wrapper) */
#main-content .wrapper > h2,
#main-content .wrapper > h3,
#main-content .wrapper > h4 {
    color: var(--osun-maroon);
    font-weight: 800;
    margin: 0 0 4px;
}

/* ==========================================================================
   DataTables toolbar (used on ~127 list pages)
   ========================================================================== */
/* Make wide data tables scroll horizontally inside their container instead
   of overflowing the page (applies to every admin list page) */
.adv-table,
.table-responsive,
.dataTables_wrapper {
    background: transparent;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}
/* the table itself may be wider than the viewport — that's fine, the
   container above scrolls; just make sure nothing forces the page wider */
.adv-table > table,
.table-responsive > table,
.dataTables_wrapper table.dataTable { max-width: none; }
#main-content, #main-content .wrapper, .card, .card-body { max-width: 100%; min-width: 0; }
#container { overflow-x: hidden; }

/* ==========================================================================
   Compact, tidy action buttons & icons inside data tables
   ========================================================================== */
.adv-table table td .btn,
.table td .btn,
table.dataTable td .btn,
.table td a.btn,
.table td button.btn {
    padding: 3px 10px !important;
    font-size: .72rem !important;
    font-weight: 600;
    border-radius: 20px !important;      /* neat pill shape for status + actions */
    box-shadow: none !important;
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: middle;
}
.table td .btn + .btn,
.adv-table table td .btn + .btn { margin-left: 4px; }

/* icons that sit inside those buttons / cells: smaller and aligned */
.table td .btn .fa,
.adv-table table td .btn .fa { font-size: .72rem; margin-right: 3px; }

.table td .fa,
.adv-table table td .fa { font-size: .82rem; vertical-align: middle; }

/* tame oversized inline action icons (fa-2x / fa-3x) used in editable rows */
.table td .fa-2x,
.adv-table table td .fa-2x { font-size: 1.05rem !important; }
.table td .fa-3x,
.adv-table table td .fa-3x { font-size: 1.2rem !important; }

/* plain +/x action icons -> small round chips */
.table td .fa-plus.red-text,
.table td .fa-times.red-text,
.adv-table table td .fa-plus.red-text,
.adv-table table td .fa-times.red-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: .78rem !important;
    cursor: pointer;
}
.table td .fa-plus.red-text { background: rgba(27,122,75,.14); color: #1b7a4b !important; }
.table td .fa-times.red-text { background: rgba(176,42,55,.12); color: #b02a37 !important; }

.dataTables_wrapper { padding: 4px 2px 8px; }

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input,
div.dataTables_length select,
div.dataTables_filter input {
    border: 1px solid #ddd6c4 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    background: #fff;
    color: #2f2a26;
    box-shadow: none !important;
    outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--osun-gold) !important;
    box-shadow: 0 0 0 .18rem rgba(201, 153, 46, .18) !important;
}
.dataTables_wrapper .dataTables_filter { margin-bottom: 8px; }
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label { color: #6b6258; font-weight: 600; font-size: .82rem; }

.dataTables_wrapper .dataTables_info { color: #8a8175; font-size: .82rem; padding-top: 10px; }

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    border: 1px solid var(--osun-line) !important;
    color: var(--osun-maroon) !important;
    background: #fff !important;
    margin: 0 2px !important;
    padding: 5px 11px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--osun-cream) !important;
    border-color: var(--osun-gold) !important;
    color: var(--osun-maroon) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--osun-maroon) !important;
    border-color: var(--osun-maroon) !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .45; }
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after { color: var(--osun-gold); }

/* ==========================================================================
   Modals (used on ~47 pages)
   ========================================================================== */
.modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(36, 21, 18, .35);
    overflow: hidden;
}
.modal-header {
    background: linear-gradient(90deg, var(--osun-maroon-dark), var(--osun-maroon));
    color: #fff;
    border-bottom: 0;
    padding: 15px 20px;
}
.modal-header .modal-title { color: #fff; font-weight: 700; }
.modal-header .close,
.modal-header .btn-close { color: #fff; opacity: .85; text-shadow: none; }
.modal-header .close:hover { opacity: 1; color: var(--osun-gold-light); }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--osun-line); padding: 14px 20px; background: #faf7ee; }

/* ==========================================================================
   Tabs (bootstrap nav-tabs used on ~19 pages)
   ========================================================================== */
.nav-tabs { border-bottom: 1px solid var(--osun-line); }
.nav-tabs > li > a,
.nav-tabs .nav-link {
    border: 0 !important;
    color: #6b6258;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}
.nav-tabs > li > a:hover,
.nav-tabs .nav-link:hover { background: var(--osun-cream); color: var(--osun-maroon); }
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs .nav-link.active {
    color: var(--osun-maroon) !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: inset 0 -3px 0 var(--osun-gold);
}

/* ==========================================================================
   Forms — spacing polish (used on ~102 pages)
   ========================================================================== */
.form-group { margin-bottom: 16px; }
.control-label, .form-group > label { color: #4a423b; font-weight: 600; font-size: .82rem; margin-bottom: 5px; }
.input-group-addon, .input-group-text { border-radius: 8px; border: 1px solid #ddd6c4; background: var(--osun-cream); color: var(--osun-maroon); }
fieldset legend { color: var(--osun-maroon); font-weight: 700; border-bottom: 1px solid var(--osun-line); padding-bottom: 6px; }

/* legacy FlatLab leftovers still present on a few pages */
.state-overview .value h1 { color: var(--osun-maroon); }
.border-head h3 { color: var(--osun-maroon); border-left: 5px solid var(--osun-gold); padding-left: 12px; }

/* scrollbar polish */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(59, 10, 10, .35); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--osun-maroon); }

/* ==========================================================================
   Role-themed sidebar background — PE (maroon) & EO (dark blue) only.
   Admin keeps the default cream sidebar. Class set in menu_file.php.
   ========================================================================== */
#sidebar.sidebar-pe { background: var(--osun-maroon) !important; border-right-color: var(--osun-maroon-dark) !important; }
#sidebar.sidebar-eo { background: var(--osun-navy)   !important; border-right-color: #0c1726 !important; }

/* top-level items: light labels on the dark background */
#sidebar.sidebar-pe .sidebar-menu > li > a,
#sidebar.sidebar-eo .sidebar-menu > li > a { color: #f1e9dd !important; }

#sidebar.sidebar-pe .sidebar-menu > li > a:hover,
#sidebar.sidebar-eo .sidebar-menu > li > a:hover { background: rgba(255, 255, 255, .10) !important; color: #fff !important; }

#sidebar.sidebar-pe .sidebar-menu > li.active > a,
#sidebar.sidebar-pe .sidebar-menu > li > a.active,
#sidebar.sidebar-eo .sidebar-menu > li.active > a,
#sidebar.sidebar-eo .sidebar-menu > li > a.active {
    background: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--osun-gold);
}

/* icons + accordion caret */
#sidebar.sidebar-pe .sidebar-menu li a i,
#sidebar.sidebar-eo .sidebar-menu li a i { color: var(--osun-gold-light) !important; }
#sidebar.sidebar-pe .sidebar-menu .dcjq-icon:before,
#sidebar.sidebar-eo .sidebar-menu .dcjq-icon:before { color: #f1e9dd; }

/* sub-menus: translucent light panel with light labels */
#sidebar.sidebar-pe .sidebar-menu li ul.sub,
#sidebar.sidebar-eo .sidebar-menu li ul.sub { background: rgba(255, 255, 255, .06) !important; }
#sidebar.sidebar-pe .sidebar-menu li ul.sub li a,
#sidebar.sidebar-eo .sidebar-menu li ul.sub li a { color: #e4dccf !important; }
#sidebar.sidebar-pe .sidebar-menu li ul.sub li a::before,
#sidebar.sidebar-eo .sidebar-menu li ul.sub li a::before { background: var(--osun-gold-light); }
#sidebar.sidebar-pe .sidebar-menu li ul.sub li a:hover,
#sidebar.sidebar-pe .sidebar-menu li ul.sub li.active a,
#sidebar.sidebar-eo .sidebar-menu li ul.sub li a:hover,
#sidebar.sidebar-eo .sidebar-menu li ul.sub li.active a { color: #fff !important; background: rgba(255, 255, 255, .12) !important; }
