/* ==========================================================================
   CDBL e-Invoice Portal — shared theme
   Layered over the existing Bootstrap/Materialize template. Do not remove
   the legacy stylesheet links; this file overrides them intentionally.
   Legacy markup (font color=, bgcolor=, width=, align= attributes) is
   restyled here via attribute/element selectors so the underlying PHP
   templates do not need to be rewritten.
   ========================================================================== */

:root {
  --ink:        #10243E;   /* sidebar / headings */
  --ink-soft:   #33475F;
  --teal:       #0F766E;   /* primary accent, links, buttons */
  --teal-dark:  #0B5B54;
  --ledger:     #2F7D5D;   /* positive / success (was font color=green) */
  --alert:      #B3261E;   /* dues / negative (was font color=red) */
  --gold:       #B8862E;   /* highlight (was font color=yellow) */
  --paper:      #F5F6F3;   /* page background */
  --panel:      #FFFFFF;   /* card / panel background */
  --hairline:   #DCE1DE;
  --text:       #23303D;
  --text-muted: #64707A;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'IBM Plex Sans', 'Roboto', Arial, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;
}

/* ---------- base ---------- */
body {
  background-color: var(--paper) !important;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
}

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

hr { border-color: var(--hairline); }

/* legacy <font color="..."> tags used throughout for status/emphasis text */
font[color="green"]  { color: var(--ledger) !important; font-style: normal; }
font[color="red"]    { color: var(--alert)  !important; font-style: normal; }
font[color="blue"]   { color: var(--ink-soft) !important; font-style: normal; font-weight: 600; }
font[color="yellow"] { color: var(--gold) !important; font-style: normal; font-weight: 600; }

/* ---------- sidebar ---------- */
.side-navbar,
.side-navbar .side-navbar-wrapper {
  background: var(--ink) !important;
  border-right: none;
}

.sidenav-header {
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 1.75rem 1rem;
}

.sidenav-header-inner h2,
.sidenav-header-inner .h5 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-top: .75rem;
}

.sidenav-header-inner img,
.sidenav-header-inner .img-fluid {
  border: 2px solid rgba(255,255,255,.2);
}

.sidenav-header-logo a,
.sidenav-header-logo strong {
  color: #fff !important;
}
.sidenav-header-logo strong.text-primary { color: var(--teal) !important; }

.main-menu .sidenav-heading { color: rgba(255,255,255,.4); }

.sidebar-menu li a,
.sidebar-menu li a.collapsible-header {
  color: rgba(255,255,255,.78) !important;
  font-family: var(--font-body);
  font-size: .92rem;
  border-left: 3px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li a:focus {
  background-color: rgba(15,118,110,.22) !important;
  border-left-color: var(--teal);
  color: #fff !important;
}

.sidebar-menu .collapsible-body {
  background: rgba(0,0,0,.15);
}
.sidebar-menu .collapsible-body li a {
  font-size: .87rem;
  padding-left: 2.5rem;
}

.sidebar-menu i { color: var(--teal); width: 1.4rem; }

/* ---------- top header ---------- */
.header,
.header .navbar,
.header .container-fluid,
.header .navbar-holder {
  background: var(--ink) !important;
}
.header {
  border-bottom: 1px solid var(--ink-soft);
  box-shadow: none !important;
}

.navbar-brand .brand-text strong.text-primary {
  color: #fff !important;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

#toggle-btn.menu-btn { color: #fff !important; }
.navbar-header,
.navbar-header a.menu-btn,
#toggle-btn {
  background: transparent !important;
  color: #fff !important;
}

.nav-menu .nav-item font {
  color: rgba(255,255,255,.65) !important;
  font-size: .85rem;
}

.nav-link.logout {
  color: #F2A9A4 !important;
  font-weight: 500;
}
.nav-link.logout:hover { color: #7d150f !important; }

/* ---------- page background under the counts/content section ---------- */
.dashboard-counts,
.section-padding,
.page > div {
  background: transparent !important;
}

/* ---------- headings that sit directly in markup ("Welcome to ...") ---------- */
.col-sm-12.text-center h1 {
  font-size: 1.6rem;
  margin: 1rem 0;
}

/* ---------- content container / "card" panels ---------- */
.container {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1.5rem 1.75rem !important;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(16,36,62,.04);
}

.container h3 {
  font-size: 1.15rem;
  text-align: left !important;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: .75rem;
  margin-bottom: 1.25rem;
}

main.mn-inner .card {
  background: transparent;
  box-shadow: none;
  border: none;
}

/* ---------- forms ---------- */
input[type="text"],
input[type="password"],
input[type="number"],
select {
  font-family: var(--font-body);
  border: 1px solid var(--hairline) !important;
  border-radius: 4px !important;
  padding: .5rem .7rem !important;
  background: var(--panel) !important;
  color: var(--text);
  min-width: 200px;
}
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 3px rgba(15,118,110,.15);
}

input[type="submit"],
.btn-primary {
  background: var(--teal) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 500;
  padding: .5rem 1.25rem !important;
  border-radius: 4px !important;
  letter-spacing: .01em;
}
input[type="submit"]:hover,
.btn-primary:hover { background: var(--teal-dark) !important; }

strong { color: var(--ink-soft); }

/* ---------- tables (search forms + data grids share plain <table>) ---------- */
table {
  background: transparent !important;
  border-collapse: collapse;
  width: 100% !important;
}

/* form-layout tables: strip legacy bgcolor/border look, keep row rhythm */
table td {
  padding: .5rem .4rem;
  vertical-align: middle;
}

/* Data grids: header row uses font[color=blue] cells as column labels */
table thead tr td,
table tr:has(> td > font[color="blue"]) td {
  background: var(--ink) !important;
  color: #fff !important;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .03em;
  padding: .65rem .75rem;
  border: none;
}
table thead tr td font[color="blue"],
table tr:has(> td > font[color="blue"]) td font[color="blue"] {
  color: #fff !important;
  font-weight: 500;
}

table.table tbody tr td,
table#example tbody tr td,
table tr td[align] {
  border-bottom: 1px solid var(--hairline);
  padding: .55rem .75rem;
  font-family: var(--font-mono);
  font-size: .88rem;
}

table tr td[align="right"] {
  font-variant-numeric: tabular-nums;
}

table tbody tr:hover td {
  background: rgba(15,118,110,.05);
}

/* bold total rows (contain <strong>) */
table tr td strong {
  color: var(--ink);
  font-family: var(--font-mono);
}

/* result heading blocks like "CDS Bill Outstanding for :- ..." */
div[style*="text-align:center"] h3 {
  font-size: 1.05rem;
  margin: .5rem 0 1rem;
}

/* ---------- footer ---------- */
.main-footer,
.main-footer *,
.main-footer .container-fluid,
.main-footer .row {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: auto !important;
}
.main-footer {
  background: transparent !important;
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
  width: auto !important;
  margin-top: 2rem;
}
.main-footer p, .main-footer font {
  color: var(--text-muted) !important;
  font-size: .8rem;
}
.main-footer a.external {
  color: var(--teal) !important;
  font-weight: 600;
}

/* ---------- misc legacy attribute cleanups ---------- */
table[bgcolor] { background: transparent !important; }
td[bgcolor]    { background: transparent !important; }

/* ---------- login page: benefits panel + login card ---------- */
.einv-login-wrap {
  max-width: 1080px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}

.einv-benefits-logo img {
  max-width: 130px;
  margin-bottom: 1.25rem;
}

.einv-benefits h3,
.einv-login-card h3 {
  font-size: 1.35rem;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: .75rem;
  margin-bottom: 1.1rem;
}

.einv-lead {
  color: var(--text-muted);
  margin-bottom: 1.4rem;
  line-height: 1.6;
}

.einv-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.einv-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .7rem 0;
  border-bottom: 1px dashed var(--hairline);
  font-size: .95rem;
  color: var(--text);
}
.einv-feature-list li:last-child { border-bottom: none; }
.einv-feature-list li i {
  color: var(--teal);
  margin-top: .25rem;
  font-size: 1rem;
}

.einv-login-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 1.85rem 1.75rem;
  box-shadow: 0 2px 8px rgba(16,36,62,.06);
}

.einv-field { margin-bottom: 1.15rem; }
.einv-field label {
  display: block;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: .4rem;
  font-size: .85rem;
}
.einv-field input[type="text"] { width: 100%; min-width: 0; }

.einv-captcha-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
}
.einv-captcha-row img {
  border: 1px solid var(--hairline);
  border-radius: 4px;
}
.einv-captcha-row input[type="text"] { flex: 1; min-width: 140px; }

.einv-msg {
  margin-bottom: 1.1rem;
  font-size: .9rem;
}

.einv-login-btn {
  width: 100%;
  padding: .7rem !important;
  font-size: 1rem;
  margin-top: .4rem;
}

@media (min-width: 768px) {
  .einv-benefits { padding-right: 2rem; }
}
@media (max-width: 767px) {
  .einv-benefits { margin-bottom: 2rem; }
}

/* ---------- dashboard stat cards ---------- */
.einv-stats-wrap {
  max-width: 1200px;
  margin: 1.75rem auto 0.5rem;
  padding: 0 1.25rem;
}

.einv-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.einv-stat-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(16,36,62,.04);
}
.einv-stat-card.einv-stat-alert   { border-left-color: var(--alert); }
.einv-stat-card.einv-stat-positive{ border-left-color: var(--ledger); }

.einv-stat-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.einv-stat-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.einv-stat-alert .einv-stat-value    { color: var(--alert); }
.einv-stat-positive .einv-stat-value { color: var(--ledger); }

/* ---------- welcome banner (replaces old broken table/div markup) ---------- */
.einv-welcome-banner {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}
.einv-welcome-banner img {
  max-width: 200px;
  margin-bottom: 1.25rem;
}
.einv-welcome-banner h1 {
  font-size: 1.6rem;
  color: var(--ledger);
}
