/* =============================================================================
   Store Management System - corporate theme (navy + gold)
   Loaded AFTER bootstrap.min.css (4.3.1) and main.css so it re-skins every
   existing page without changing control IDs, postbacks or business logic.
   ============================================================================= */

:root {
  --navy: #0D1B2A;
  --navy-2: #1B263B;
  --navy-3: #2a3a55;
  --gold: #D4AF37;
  --gold-light: #F7C948;
  --gold-pale: #FBF3D6;
  --bg: #D9E8F8;
  --white: #FFFFFF;
  --text: #000000;
  --muted: #000000;
  --line: #DFE5EE;
  --danger: #B42318;
  --success: #17794B;
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 27, 42, .06), 0 1px 3px rgba(13, 27, 42, .08);
  --shadow-md: 0 6px 18px rgba(13, 27, 42, .10);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body.app-body,
body.authentication {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: .9rem;
  line-height: 1.5;
}
body.app-body h1, body.app-body h2, body.app-body h3,
body.app-body h4, body.app-body h5, body.app-body h6 { color: var(--navy); font-weight: 600; }
body.app-body h6 { font-size: .9rem; }
body.app-body a { color: var(--navy-2); }
body.app-body a:hover { color: var(--navy); }
body.app-body label { font-weight: 600; font-size: .8rem; color: var(--navy-2); margin-bottom: .25rem; }
body.app-body p strong { font-size: .8rem; color: var(--navy-2); }
.container { max-width: none; } /* old pages wrapped everything in .container */

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #cdd6e3;
  display: flex; flex-direction: column;
  transition: width .2s ease, transform .2s ease;
  box-shadow: 2px 0 12px rgba(13, 27, 42, .18);
}
.app-sidebar .brand {
  display: flex; align-items: center; gap: .75rem;
  height: var(--topbar-h); padding: 0 1.1rem; flex: 0 0 auto;
  background: var(--navy-2);
  border-bottom: 2px solid var(--gold);
  color: #fff; text-decoration: none;
}
.app-sidebar .brand:hover { color: #fff; text-decoration: none; }
.app-sidebar .brand-mark {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 9px;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.app-sidebar .brand-text { line-height: 1.15; white-space: nowrap; overflow: hidden; }
.app-sidebar .brand-text strong { display: block; font-size: .95rem; letter-spacing: .2px; color: #fff; }
.app-sidebar .brand-text small { color: var(--gold-light); font-size: .68rem; letter-spacing: 1.2px; text-transform: uppercase; }

.side-nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: .75rem 0 1rem; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 3px; }
.side-nav .nav-heading {
  padding: 1rem 1.25rem .35rem; font-size: .66rem; letter-spacing: 1.4px; text-transform: uppercase;
  color: #7f8ea6; font-weight: 700; white-space: nowrap;
}
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a.side-link {
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem 1.25rem; margin: 1px .6rem; border-radius: 8px;
  color: #cdd6e3; text-decoration: none; font-size: .86rem; white-space: nowrap;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.side-nav a.side-link .ico { flex: 0 0 20px; text-align: center; font-size: 1.05rem; color: #8fa1bd; }
.side-nav a.side-link .caret { margin-left: auto; font-size: .9rem; transition: transform .2s; color: #8fa1bd; }
.side-nav a.side-link[aria-expanded="true"] .caret { transform: rotate(180deg); }
.side-nav a.side-link:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.side-nav a.side-link:hover .ico { color: var(--gold-light); }
.side-nav a.side-link.active {
  background: var(--navy-2); color: #fff; border-left-color: var(--gold); font-weight: 600;
}
.side-nav a.side-link.active .ico { color: var(--gold); }
.side-nav .sub { padding: .15rem 0 .4rem; }
.side-nav .sub a.side-link { padding: .45rem 1.25rem .45rem 3.35rem; font-size: .82rem; color: #b6c2d4; }
.side-nav .sub a.side-link.active { color: var(--gold-light); background: rgba(27, 38, 59, .7); }

.side-foot {
  flex: 0 0 auto; padding: .85rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .72rem; color: #7f8ea6; white-space: nowrap; overflow: hidden;
}

.app-main {
  flex: 1 1 auto; min-width: 0; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left .2s ease;
}

/* collapsed sidebar (desktop) */
body.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .side-nav .nav-heading,
body.sidebar-collapsed .side-nav a.side-link .label-text,
body.sidebar-collapsed .side-nav a.side-link .caret,
body.sidebar-collapsed .side-foot { display: none; }
body.sidebar-collapsed .side-nav a.side-link { justify-content: center; padding: .7rem 0; margin: 1px .5rem; }
body.sidebar-collapsed .side-nav .sub { display: none !important; }

/* ---------- Top bar ---------- */
.app-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-h); padding: 0 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  background: var(--white); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--white); color: var(--navy); font-size: 1.15rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.icon-btn:hover { background: var(--gold-pale); border-color: var(--gold); }
.icon-btn:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.topbar-title { font-weight: 600; color: var(--navy); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1 1 auto; }
.fy-chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px;
  background: var(--gold-pale); color: var(--navy); border: 1px solid var(--gold); font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.user-chip { display: flex; align-items: center; gap: .65rem; }
.user-chip .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.user-chip .who { line-height: 1.15; max-width: 190px; }
.user-chip .who strong { display: block; font-size: .8rem; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who small { color: var(--muted); font-size: .7rem; }
.signout-link {
  display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 8px;
  border: 1px solid var(--line); color: var(--navy) !important; font-size: .8rem; font-weight: 600; text-decoration: none !important;
}
.signout-link:hover { background: var(--navy); color: #fff !important; border-color: var(--navy); }

/* ---------- Breadcrumbs, content frame ---------- */
.app-content { flex: 1 1 auto; padding: 1.25rem 1.5rem 1rem; min-width: 0; }
.crumbs { margin: 0 0 .85rem; padding: 0; background: transparent; font-size: .78rem; display: flex; flex-wrap: wrap; align-items: center; }
.crumbs .crumb-item { color: var(--muted); }
.crumbs .crumb-item + .crumb-item::before { content: "/"; padding: 0 .5rem; color: #000; }
.crumbs .crumb-item.current { color: var(--navy); font-weight: 600; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--navy); text-decoration: underline; }

/* neutralise legacy frame from main.css (.main-container had shadow + rounded 'window') */
.main-container { margin: 0 !important; padding: 0; box-shadow: none !important; background: transparent; }

.app-footer {
  padding: .85rem 1.5rem; border-top: 1px solid var(--line); background: var(--white);
  color: var(--muted); font-size: .75rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}
.app-footer strong { color: var(--navy); }

/* ---------- Legacy page header (.page-title) ---------- */
.page-title {
  background: var(--white) !important; border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius) !important; box-shadow: var(--shadow-sm);
  padding: .85rem 1.25rem !important; margin-bottom: 1rem;
}
.page-title h5.title { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.4; color: var(--navy); }
.page-title .daterange-container { float: none; text-align: right; }
.page-title .daterange-container .date-range {
  float: none; display: inline-block; margin: 0; padding: .25rem .8rem; border: 1px solid var(--gold); border-radius: 999px;
  background: var(--gold-pale); color: var(--navy); font-weight: 600; font-size: .75rem; cursor: default;
}
.page-title a { font-size: .78rem; }
.page-title a[style*="red"] { color: var(--navy-2) !important; font-weight: 600; text-decoration: underline; }

.content-wrapper {
  background: transparent !important; padding: 0 !important; min-height: 0 !important; border-radius: 0 !important;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white) !important; border: 1px solid var(--line) !important; border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
}
.card-header { background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1.25rem; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-header .card-title, .card-title { margin: 0; font-size: .95rem; font-weight: 600; color: var(--navy); }
.card-body { padding: 1.25rem; }
.card.blue, .card.light, .card.dark, .card.yellow, .card.orange, .card.secondary { background: var(--white) !important; }

/* ---------- Forms ---------- */
.form-control, .custom-select, select.form-control, .bootstrap-select > .dropdown-toggle {
  border: 1px solid #c7d0de; border-radius: 8px; color: var(--text); background-color: #fff;
  font-size: .88rem; min-height: 38px;
}
.form-control:focus, .custom-select:focus, .bootstrap-select > .dropdown-toggle:focus {
  border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(212, 175, 55, .25); outline: 0;
}
.form-control:disabled, .form-control[readonly] { background: #eef1f6; }
.form-group { margin-bottom: 1rem; }
span[style*="color:Red"], span[style*="color: Red"], span[style*="Red"][id*="alidator"], span[id*="alidator"] { font-size: .76rem; }
.validation-summary-errors, .text-danger { color: var(--danger) !important; }
.bootstrap-select .dropdown-menu { width: auto; min-width: 100%; }
textarea.form-control { min-height: 84px; }

/* ---------- Buttons ---------- */
.btn { border-radius: 8px; font-weight: 600; font-size: .84rem; padding: .45rem 1rem; transition: all .15s; }
.btn:focus, .btn.focus { box-shadow: 0 0 0 .2rem rgba(212, 175, 55, .35); }
.btn-primary, input.btn-primary, .btn.btn-primary {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary:not(:disabled):not(.disabled):active {
  background: var(--navy-2) !important; border-color: var(--gold) !important; color: #fff !important;
}
.btn-info, .btn-warning { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn-info:hover, .btn-warning:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--navy); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-outline-primary { color: var(--navy); border-color: var(--navy); }
.btn-outline-primary:hover { background: var(--navy); color: #fff; }
.btn.is-busy, .btn[disabled] { opacity: .65; cursor: progress; }
.btn-primary.disabled, .btn-primary:disabled { background: var(--navy); border-color: var(--navy); }
/* the legacy report title label is an <span class="btn btn-primary"> */
span.btn.btn-primary { cursor: default; font-size: 1.15rem !important; }

/* ---------- Tables / GridView ---------- */
.table { color: var(--text); font-size: .84rem; background: #fff; margin-bottom: 1rem; }
.table th, .table td { vertical-align: middle; padding: .55rem .7rem; }
.table thead th, .table > tbody > tr:first-child > th, .table th, .table th a, .table th a:hover { color: #fff; }
.table thead th, .table > tbody > tr:first-child > th, .table th {
  background: var(--navy); border-color: var(--navy-2); font-weight: 600; font-size: .76rem; letter-spacing: .3px; text-transform: uppercase;
}
.table th.headerclass, th.headerclass, .headerclass { background: var(--navy) !important; color: #fff !important; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: var(--line); }
.table-bordered th { border-color: var(--navy-2); }
.table-striped tbody tr:nth-of-type(odd) { background-color: #f8fafd; }
.table-hover tbody tr:hover { background-color: var(--gold-pale); }
.table td:not(:first-child) input[type="text"] { max-width: 100%; }
/* GridView pager (nested table of links) */
.table > tbody > tr > td > table { margin: .25rem auto; width: auto; }
.table > tbody > tr > td > table td { border: 0 !important; padding: 0 .15rem; background: transparent !important; }
.table > tbody > tr > td > table a, .table > tbody > tr > td > table span {
  display: inline-block; min-width: 32px; padding: .25rem .55rem; text-align: center; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--navy); text-decoration: none; font-weight: 600;
}
.table > tbody > tr > td > table a:hover { background: var(--gold-pale); border-color: var(--gold); }
.table > tbody > tr > td > table span { background: var(--navy); color: #fff; border-color: var(--navy); }
.table-responsive-auto { overflow-x: visible; }
.invoice-body { margin-bottom: 1rem; }
.invoice-details h6 { color: var(--navy) !important; margin: 0 0 .35rem; font-weight: 600; }
.invoice-details h6 span { color: var(--text); font-weight: 600; }

/* ---------- Required markers (added by shell.js from the page's RequiredFieldValidators) ---------- */
label.req::after, p > strong.req::after { content: " *"; color: var(--danger); font-weight: 700; }

/* ---------- Report header (sms:ReportHeader) ---------- */
.report-header { border-bottom: 3px solid var(--gold); margin: 0 10px 1rem; padding: .25rem .5rem .75rem; flex: 0 0 calc(100% - 20px); width: calc(100% - 20px); box-sizing: border-box; }
.report-header .rh-org { display: flex; align-items: baseline; gap: .6rem; }
.report-header .rh-org strong { font-size: 1.25rem; color: var(--navy); letter-spacing: .5px; }
.report-header .rh-org span { color: var(--muted); font-size: .85rem; }
.report-header .rh-title { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-top: .25rem; }
.report-header .rh-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin-top: .4rem; font-size: .78rem; color: var(--text); }
.report-header .rh-meta span::before { content: "\2022"; color: var(--gold); margin-right: .4rem; }
@media print { .report-header { border-bottom: 2px solid #000; } .report-header .rh-org strong, .report-header .rh-title { color: #000; } }

/* numeric-looking cells line up on the right in report tables */
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius); border-width: 1px; font-size: .86rem; }
.alert-success { background: #e8f6ee; border-color: #b7e1c8; color: #0f5c38; }
.alert-danger { background: #fdecea; border-color: #f5c2bd; color: #8a1c13; }
.alert-warning { background: var(--gold-pale); border-color: #ecd68a; color: #5c4700; }
.alert-info { background: #eaf0f8; border-color: #c4d3e8; color: var(--navy-2); }

/* ---------- Dropdown / popovers ---------- */
.dropdown-menu { border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); width: auto; min-width: 11rem; }
.dropdown-item { font-size: .84rem; color: var(--text); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--gold-pale); color: var(--navy); }
.dropdown-item.active, .dropdown-item:active { background: var(--navy); color: #fff; }
.bootstrap-select .dropdown-menu li.selected a, .bootstrap-select .dropdown-menu li.active a { background: var(--navy) !important; color: #fff !important; }

/* ---------- jQuery UI datepicker ---------- */
.ui-datepicker { border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); padding: .4rem; font-family: inherit; }
.ui-datepicker .ui-datepicker-header { background: var(--navy); color: #fff; border: 0; border-radius: 8px; }
.ui-datepicker .ui-datepicker-title select { color: var(--navy); }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { top: 4px; }
.ui-datepicker td .ui-state-default { border: 0; background: transparent; text-align: center; border-radius: 6px; color: var(--text); }
.ui-datepicker td .ui-state-hover { background: var(--gold-pale); }
.ui-datepicker td .ui-state-active, .ui-datepicker td .ui-state-highlight { background: var(--gold); color: var(--navy); font-weight: 700; }

/* ---------- Dashboard ---------- */
.dash-hello { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.dash-hello h2 { margin: 0; font-size: 1.35rem; }
.dash-hello p { margin: .15rem 0 0; color: var(--muted); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 1rem 1.1rem; display: flex; align-items: center; gap: .9rem; position: relative; overflow: hidden;
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); }
.kpi .icon-tile {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px; background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.kpi .kpi-body { min-width: 0; }
.kpi .kpi-value { font-size: 1.55rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi .kpi-label { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.kpi .kpi-note { font-size: .72rem; color: var(--muted); }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
a.quick-tile {
  display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; text-decoration: none !important;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  color: var(--navy) !important; transition: transform .12s, box-shadow .12s, border-color .12s;
}
a.quick-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gold); }
a.quick-tile .icon-tile {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; background: var(--gold-pale); color: var(--navy);
  border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
a.quick-tile strong { display: block; font-size: .92rem; }
a.quick-tile small { color: var(--muted); font-size: .75rem; }
a.quick-tile .go { margin-left: auto; color: var(--gold); font-size: 1.1rem; }

.panel-title { font-size: .95rem; font-weight: 600; color: var(--navy); margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.panel-title .icon-tile-sm { width: 26px; height: 26px; border-radius: 7px; background: var(--navy); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; }
.empty-state { text-align: center; padding: 1.75rem 1rem; color: var(--muted); }
.empty-state .icon-tile { width: 52px; height: 52px; margin: 0 auto .6rem; border-radius: 14px; background: var(--bg); color: var(--navy-3); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.empty-state strong { display: block; color: var(--navy); margin-bottom: .15rem; }
.badge-soft { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--gold-pale); color: var(--navy); border: 1px solid var(--gold); }
.badge-soft.ok { background: #e8f6ee; color: #0f5c38; border-color: #b7e1c8; }
.badge-soft.warn { background: #fdecea; color: #8a1c13; border-color: #f5c2bd; }
.dash-alert { margin-bottom: 1rem; }

/* ---------- Login ---------- */
body.authentication {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  /* photo background with a navy overlay so the card and text stay readable */
  background-color: var(--navy);
  background-image: linear-gradient(135deg, rgba(13, 27, 42, .86) 0%, rgba(27, 38, 59, .74) 55%, rgba(13, 27, 42, .88) 100%), url("../img/login-bg.jpg");
  background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed;
}
body.authentication .login-wrap { width: 100%; max-width: 440px; }
body.authentication .login-card {
  background: var(--white); border-radius: 16px; overflow: hidden; box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
  border-top: 5px solid var(--gold);
}
body.authentication .login-head { padding: 1.75rem 2rem 1rem; text-align: center; }
body.authentication .login-head .brand-mark {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto .85rem; background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
body.authentication .login-head h1 { font-size: 1.3rem; margin: 0; color: var(--navy); }
body.authentication .login-head p { margin: .25rem 0 0; color: var(--muted); font-size: .85rem; }
body.authentication .login-body { padding: .5rem 2rem 2rem; }
body.authentication .input-icon { position: relative; }
body.authentication .input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.05rem; }
body.authentication .input-icon .form-control { padding-left: 38px; min-height: 44px; }
body.authentication .btn-login { width: 100%; min-height: 44px; font-size: .95rem; background: var(--navy); border-color: var(--navy); color: #fff; }
body.authentication .btn-login:hover { background: var(--navy-2); border-color: var(--gold); }
body.authentication .login-msg { color: var(--danger); font-size: .84rem; margin-bottom: .75rem; font-weight: 600; }
body.authentication .login-foot { text-align: center; color: #9fb0c8; font-size: .75rem; margin-top: 1rem; }

/* ---------- Responsive ---------- */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .app-main, body.sidebar-collapsed .app-main { margin-left: 0; }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(13, 27, 42, .55); z-index: 1035; }
  body.sidebar-collapsed .brand-text, body.sidebar-collapsed .side-nav .nav-heading,
  body.sidebar-collapsed .side-nav a.side-link .label-text, body.sidebar-collapsed .side-nav a.side-link .caret,
  body.sidebar-collapsed .side-foot { display: revert; }
  body.sidebar-collapsed .side-nav a.side-link { justify-content: flex-start; padding: .6rem 1.25rem; margin: 1px .6rem; }
  body.sidebar-collapsed .side-nav .sub { display: block !important; }
  .app-content { padding: 1rem .85rem; }
  .user-chip .who, .topbar-title { display: none; }
  .page-title .daterange-container { text-align: left; margin-top: .5rem; }
}
@media (max-width: 575.98px) {
  .dash-hello h2 { font-size: 1.1rem; }
  .kpi-grid, .tile-grid { grid-template-columns: 1fr; }
  .fy-chip { display: none; }
}


/* ---------- Print (reports) ---------- */
@media print {
  .app-sidebar, .app-topbar, .app-footer, .crumbs, .sidebar-backdrop, .no-print,
  .btn, .page-title .daterange-container, .ui-datepicker { display: none !important; }
  .app-main { margin-left: 0 !important; }
  body.app-body { background: #fff !important; font-size: 11pt; }
  .app-content { padding: 0 !important; }
  .card, .page-title { border: 0 !important; box-shadow: none !important; }
  .table th { background: #e9edf3 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table td, .table th { border: 1px solid #999 !important; padding: 4px 6px; }
  .table tr { page-break-inside: avoid; }
  thead { display: table-header-group; }
  a { color: #000 !important; text-decoration: none !important; }
  /* legacy report titles are <span class="btn btn-primary"> - keep them, drop the button look */
  span.btn.btn-primary { display: inline-block !important; background: transparent !important; color: #000 !important; border: 0 !important; padding: 0 !important; font-size: 16pt !important; }
}

/* =============================================================================
   Fit-to-width: no horizontal scroll bars inside forms / grids
   ============================================================================= */
html, body.app-body { overflow-x: hidden; }
.app-content, .main-container, .content-wrapper, .card, .card-body, .row { max-width: 100%; }
.app-content img, .app-content canvas, .app-content iframe { max-width: 100%; height: auto; }
.table { width: 100% !important; max-width: 100%; table-layout: auto; }
.table th, .table td { overflow-wrap: break-word; word-break: normal; white-space: normal; }
.table td a, .table td .btn, .table td input[type="submit"] { white-space: nowrap; }
.table th { overflow-wrap: break-word; word-break: normal; hyphens: none; }
.table td[style*="width"], .table th[style*="width"], .table td[width], .table th[width] { width: auto !important; }
.table input[type="text"], .table input[type="password"], .table select, .table textarea, .table .form-control { max-width: 100%; width: 100% !important; min-width: 0; box-sizing: border-box; }
.table td .bootstrap-select, .table td .bootstrap-select > .dropdown-toggle { width: 100% !important; min-width: 0; }
table[style*="width"], div[style*="width"] { max-width: 100% !important; }
.form-control, .bootstrap-select { max-width: 100%; }
pre, code { white-space: pre-wrap; word-break: break-word; }

/* =============================================================================
   Original-style module tiles on the landing dashboards
   ============================================================================= */
.orig-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 290px)); gap: 20px; margin: 1.25rem 0 1rem; }
a.orig-tile { display: block; border-radius: 3px; overflow: hidden; color: #fff !important; text-decoration: none !important; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; }
a.orig-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.orig-tile .ot-head { display: block; padding: 1rem 1.25rem; font-weight: 700; font-size: 1.05rem; }
.orig-tile .ot-body { display: block; padding: 20px; }
.orig-tile .ot-body img { display: block; width: 100%; height: 160px; object-fit: cover; border-radius: 2px; }
.orig-tile .ot-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 200px; text-align: center; }
.orig-tile .ot-icon i { font-size: 3.6rem; margin-bottom: .6rem; }
.orig-tile .ot-icon small { color: inherit !important; font-size: .8rem; }
.orig-tile.blue { background: #67caf0; }      .orig-tile.blue .ot-head { background: #59c5ef; }
.orig-tile.yellow { background: #f9be52; }    .orig-tile.yellow .ot-head { background: #f8b843; }
.orig-tile.orange { background: #f68d60; }    .orig-tile.orange .ot-head { background: #f58656; }
.orig-tile.dark { background: #536987; }      .orig-tile.dark .ot-head { background: #4f6481; }
.orig-tile.secondary { background: #877dd6; } .orig-tile.secondary .ot-head { background: #8075d4; }
.orig-tile.light { background: #ceddec; color: #000 !important; } .orig-tile.light .ot-head { background: #c7d8e9; }
@media (max-width: 575.98px) { .orig-tiles { grid-template-columns: 1fr; } }

/* =============================================================================
   Black text instead of grey (light surfaces only; the dark sidebar keeps light text)
   ============================================================================= */
body.app-body, body.authentication .login-card { color: #000; }
.app-main .text-muted, .app-main .form-text, .app-main small, .app-main .small { color: #000 !important; }
.app-main .form-control:disabled, .app-main .form-control[readonly] { color: #000; }
.app-main ::placeholder, body.authentication ::placeholder { color: #000; opacity: .6; font-style: italic; }
.app-main .crumbs a, .app-main .crumbs .crumb-item { color: #000; }
.app-footer, .app-footer span { color: #000; }
body.authentication .login-head p, body.authentication label, body.authentication .input-icon i { color: #000; }
/* pasted Word tables on the requisition forms and the Google chart keep to the page width */
table.MsoNormalTable { width: 100% !important; max-width: 100% !important; }
table.MsoNormalTable td, table.MsoNormalTable th { width: auto !important; }
#chart { width: 100% !important; max-width: 100% !important; }
#DivPrint, #DivPrint2, #DivPrint3 { flex: 0 0 100%; width: 100%; max-width: 100%; }

/* pasted Word content (requisition forms) carries fixed pixel widths on paragraphs and cells */
[class^="WordSection"] p[style*="width"], [class^="WordSection"] td[style*="width"], [class^="WordSection"] span[style*="width"], [class^="WordSection"] div[style*="width"], [class^="WordSection"] table[style*="width"] { width: auto !important; max-width: 100% !important; }
[class^="WordSection"], [class^="WordSection"] table { max-width: 100% !important; }
[class^="WordSection"] td, [class^="WordSection"] th, [class^="WordSection"] col { width: auto !important; min-width: 0 !important; }
[class^="WordSection"] table { table-layout: auto; }
[class^="WordSection"] img { max-width: 100%; height: auto; }

/* very large left margins pasted from Word (signature blocks) are capped relative to the page width */
[class^="WordSection"] [style*="margin-left:4"], [class^="WordSection"] [style*="margin-left: 4"],
[class^="WordSection"] [style*="margin-left:3"], [class^="WordSection"] [style*="margin-left: 3"] { margin-left: 40% !important; }
[class^="WordSection"] { overflow-wrap: break-word; }
/* applied by shell.js only when a grid is still wider than its container */
.fit-dense th, .fit-dense td { padding: .3rem .35rem !important; font-size: .78rem; }
.fit-tight th, .fit-tight td { padding: .25rem .25rem !important; font-size: .72rem; overflow-wrap: anywhere; }
/* class-less wrappers directly inside a .row (legacy grids) must not grow wider than the row */
.row > div:not([class*="col"]) { flex: 1 1 100%; min-width: 0; max-width: 100%; }

/* =============================================================================
   Home page cards (illustrated thumbnail + icon badge), same pattern as the Fleet Management home
   ============================================================================= */
.home-welcome { margin-bottom: 1.25rem; }
.home-welcome h2 { font-size: 1.5rem; margin: 0; }
.home-welcome p { margin: .25rem 0 0; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; }
a.home-card {
  display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-sm); text-decoration: none !important; color: #000 !important; transition: transform .12s, box-shadow .12s, border-color .12s;
}
a.home-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold); }
a.home-card:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.hc-thumb { position: relative; display: block; height: 0; padding-top: 56.25%; background: var(--bg); }
.hc-thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.hc-icon {
  position: absolute; left: 12px; top: 12px; width: 40px; height: 40px; border-radius: 11px; background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem; box-shadow: 0 2px 6px rgba(13, 27, 42, .35);
}
.hc-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: .9rem 1.05rem 1rem; }
.hc-body strong { display: block; font-size: 1rem; color: var(--navy); }
.hc-body small { display: block; margin-top: .15rem; font-size: .8rem; }
.hc-open { display: inline-flex; align-items: center; gap: .25rem; margin-top: auto; padding-top: .65rem; font-size: .8rem; font-weight: 700; color: var(--navy); }
a.home-card:hover .hc-open { color: #7a5e00; }
@media (max-width: 575.98px) { .home-grid { grid-template-columns: 1fr; } }
/* =============================================================================
   Forms: white fields with a clearly visible light-blue outline
   ============================================================================= */
:root { --form-blue: #7DB1F2; --form-blue-strong: #2F80ED; --form-blue-tint: #EAF3FF; }
.form-control, .custom-select, select.form-control, textarea.form-control, input[type="text"].form-control, .bootstrap-select > .dropdown-toggle,
.app-content input[type="text"], .app-content input[type="password"], .app-content input[type="number"], .app-content input[type="email"],
.app-content input[type="date"], .app-content textarea, .app-content select, body.authentication .form-control {
  background-color: #fff !important; border: 1.5px solid var(--form-blue) !important; color: #000; border-radius: 8px;
}
.form-control:hover, .custom-select:hover, .bootstrap-select > .dropdown-toggle:hover { border-color: var(--form-blue-strong) !important; }
.form-control:focus, .custom-select:focus, .bootstrap-select > .dropdown-toggle:focus, .bootstrap-select.show > .dropdown-toggle,
.app-content input:focus, .app-content textarea:focus, .app-content select:focus, body.authentication .form-control:focus {
  border-color: var(--form-blue-strong) !important; box-shadow: 0 0 0 .22rem rgba(47, 128, 237, .22) !important; outline: 0;
}
.form-control:disabled, .form-control[readonly], .app-content input[readonly], .app-content input:disabled, .app-content select:disabled {
  background-color: var(--form-blue-tint) !important; color: #000; opacity: 1;
}
/* form containers: white surface, light-blue frame */
.card { border: 1.5px solid #BBD7F8 !important; }
.card-header { border-bottom: 1.5px solid #D6E7FB; }
.page-title { border-color: #BBD7F8; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--form-blue-strong); }
.remember-row { margin: -.25rem 0 1rem; }
.remember-row label { display: inline; margin: 0 0 0 .4rem; font-weight: 500; font-size: .84rem; color: #000; cursor: pointer; }
.remember-row input[type="checkbox"] { width: 17px; height: 17px; vertical-align: middle; cursor: pointer; }
/* panel headers inside forms: light-blue tint instead of grey */
.card .card-header, .card-header { background-color: var(--form-blue-tint) !important; }

/* =============================================================================
   Round 6: page background, NESPAK logo, compact home cards, responsive polish
   ============================================================================= */
/* NESPAK logo mark in the sidebar brand */
.app-sidebar .brand-mark.brand-logo { flex: 0 0 58px; width: 58px; height: 40px; padding: 3px 5px; background: #fff; border-radius: 8px; }
.app-sidebar .brand-mark.brand-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
body.sidebar-collapsed .app-sidebar .brand { padding: 0 7px; justify-content: center; }
body.sidebar-collapsed .app-sidebar .brand-mark.brand-logo { flex-basis: 56px; width: 56px; }
/* NESPAK logo on login / error cards */
body.authentication .login-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto .9rem; }

/* compact home cards: two rows fit a normal laptop screen without a vertical scroll bar */
.home-welcome { margin-bottom: .8rem; }
.home-welcome h2 { font-size: 1.35rem; }
.home-grid { grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 1rem; }
.hc-thumb { height: clamp(66px, 14vh, 128px); padding-top: 0; }
.hc-icon { left: 10px; top: 10px; width: 34px; height: 34px; border-radius: 9px; font-size: 1.1rem; }
.hc-body { padding: .6rem .9rem .75rem; }
.hc-body strong { font-size: .95rem; }
.hc-body small { font-size: .78rem; line-height: 1.3; }
.hc-open { padding-top: .45rem; }

/* responsive polish */
@media (max-width: 991.98px) {
  .app-topbar { padding: 0 .75rem; gap: .6rem; }
  .app-footer { padding: .7rem .85rem; }
  .home-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .hc-thumb { height: clamp(90px, 16vw, 140px); }
}
@media (max-width: 575.98px) {
  .form-control, .custom-select, .bootstrap-select > .dropdown-toggle, .app-content input, .app-content select, .app-content textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .hc-thumb { height: 74px; }
  .hc-icon { width: 28px; height: 28px; font-size: .95rem; left: 7px; top: 7px; }
  .hc-body { padding: .5rem .6rem .6rem; }
  .hc-body strong { font-size: .84rem; }
  .hc-body small { display: none; }
  .app-footer { flex-direction: column; text-align: center; }
  .page-title { padding: .65rem .85rem !important; }
  .page-title .daterange-container { text-align: left; }
  .app-sidebar .brand-text strong { font-size: .9rem; }
  body.authentication { padding: .75rem; }
  body.authentication .login-head, body.authentication .login-body { padding-left: 1.25rem; padding-right: 1.25rem; }
}
/* longer product name wraps onto two lines in the sidebar header */
.app-sidebar .brand-text { white-space: normal; }
.app-sidebar .brand-text strong { font-size: .86rem; line-height: 1.2; }

/* =============================================================================
   Blue / navy surfaces always carry white text (report titles, table headers, buttons, badges).
   The old pages force black text on their report-title labels with inline styles, hence !important.
   ============================================================================= */
.btn-primary, span.btn.btn-primary, label.btn.btn-primary, .badge-primary, .bg-primary, .bg-info, .bg-dark,
.table th, .table thead th, .table > tbody > tr:first-child > th, th.headerclass, .headerclass,
.on-blue, .on-blue a, .on-blue span, .on-blue strong, .on-blue label { color: #fff !important; }
span.btn.btn-primary[style*="width"], .btn.btn-primary[style*="width"] { max-width: 100% !important; white-space: normal; }
span.btn.btn-primary { display: inline-block; }
@media print {
  /* printed reports keep a plain look: titles and header cells are black on white/light grey */
  span.btn.btn-primary, label.btn.btn-primary { color: #000 !important; }
  .table th, .table thead th, .table > tbody > tr:first-child > th, th.headerclass, .headerclass { color: #000 !important; }
}
/* =============================================================================
   Searchable drop-downs (bootstrap-select): the plugin sizes the menu to the longest option and writes
   it inline (min-width: 8000px+ with the 3,000-item list), which spread the popup across the whole page.
   Cap it to a readable width and let long item names wrap instead.
   ============================================================================= */
.bootstrap-select > .dropdown-menu { min-width: min(420px, calc(100vw - 32px)) !important; width: auto !important; max-width: min(560px, calc(100vw - 32px)) !important; }
.bootstrap-select > .dropdown-menu .inner, .bootstrap-select > .dropdown-menu ul { overflow-x: hidden !important; }
.bootstrap-select .dropdown-menu li a, .bootstrap-select .dropdown-menu li a .text, .bootstrap-select .dropdown-item { white-space: normal !important; word-break: break-word; overflow-wrap: anywhere; }
.bootstrap-select .bs-searchbox { padding: .4rem .5rem; }
.bootstrap-select .bs-searchbox .form-control { width: 100%; }
.table td .bootstrap-select > .dropdown-menu { min-width: min(320px, calc(100vw - 32px)) !important; }

/* Dashboard charts (server-drawn SVG) */
.chart-card .panel-title { margin-bottom: .1rem; }
.chart-card .chart-sub { margin: 0 0 .6rem; font-size: .78rem; color: #000; }
.chart-svg { display: block; width: 100%; height: auto; max-height: 300px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: .4rem; font-size: .78rem; color: #000; }
.chart-legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.chart-card .empty-state { padding: 1.2rem .5rem; }
@media print { .chart-svg { max-height: 240px; } }

/* Request details page (read-only) and "View details" links */
a.detail-link { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.detail-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.detail-head .panel-title { margin: 0; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .65rem 1.25rem; margin: 0; }
.detail-item { min-width: 0; padding: .45rem .65rem; background: #EEF5FD; border: 1px solid #C9D6E8; border-radius: 6px; }
.detail-item.wide { grid-column: 1 / -1; }
.detail-item dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #000; margin: 0 0 .1rem; }
.detail-item dd { margin: 0; color: #000; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-note { font-size: .78rem; color: #000; opacity: .75; overflow-wrap: anywhere; }
.detail-files { list-style: none; margin: 0; padding: 0; }
.detail-files li { padding: .4rem 0; border-bottom: 1px solid #E1E9F5; }
.detail-files li:last-child { border-bottom: 0; }
.detail-files a { font-weight: 600; overflow-wrap: anywhere; }
.table tfoot th { background: var(--navy); }
@media print { .detail-actions { display: none; } .detail-item { background: #fff; } }
