/* ============================================================================================
   Visual refresh - the stock sb-admin-2 theme left both the top navbar and the left sidebar
   completely unstyled (`.navbar-default` carries no color at all once BS5 dropped that class -
   see sb-admin-2.css's own migration notes), so the whole app read as flat white-on-white. This
   section gives the nav chrome a dark frame around the white content area (a common, low-risk
   "modern admin" treatment - CSS only, no markup/layout restructuring) plus a warm accent color
   for the active-sidebar-link highlight, distinct from the blue primary (--bs-primary, set in
   sb-admin-2.css) used everywhere else (widget headers, buttons, etc. - deliberately left alone,
   one accent color is enough). Loaded after sb-admin-2.css (see core/view.php's <link> order), so
   these rules win on the same selectors without needing extra specificity.
   ============================================================================================ */
:root {
	--app-frame-bg: #2c3e50;       /* top navbar + sidebar background */
	--app-frame-bg-nested: #253442; /* sidebar nav-second-level/nav-third-level background */
	--app-frame-text: #ecf0f1;     /* sidebar/navbar link text */
	--app-frame-text-muted: #95a5a6;
	--app-accent: #e67e22;         /* warm accent - active/hover highlight, distinct from the blue primary */
}

/* .sidebar is position:absolute (sb-admin-2.css) so its own background only covers as tall as its
   nav list actually is - shorter than most real pages, leaving plain body background showing
   below it instead of the dark frame continuing down the left edge. Rather than painting body
   itself dark (which would show a full-width dark bar below any page shorter than the viewport,
   not just the sidebar's own 250px column), this paints the dark color as a gradient confined to
   the left 250px of #wrapper - the one element whose own auto height always equals the page's
   REAL total height (nav + #page-wrapper stacked in normal flow), not capped at one viewport, so
   it's correct on a long scrolling page too. Same breakpoint as the sidebar's own margin-left
   layout below (sb-admin-2.css) - under 768px the sidebar is in normal flow, not overlaid, so
   there's nothing to paint behind. */
@media (min-width: 768px) {
	#wrapper {
		background: linear-gradient(to right, var(--app-frame-bg) 250px, transparent 250px);
	}
}

nav.navbar.navbar-default {
	background-color: var(--app-frame-bg);
	border-color: var(--app-frame-bg);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.navbar-top-links li {
	color: var(--app-frame-text);
}

.navbar-top-links li a {
	color: var(--app-frame-text);
}

.navbar-top-links li a:hover,
.navbar-top-links li a:focus {
	color: #fff;
}

/* The account dropdown's own menu is a normal white BS5 dropdown-menu, not part of the dark
   frame - only the toggle link itself (still inside navbar-top-links) needs the light-on-dark
   treatment above. sb-admin-2.css's own `.navbar-top-links .dropdown-menu li a { padding: 3px
   20px; }` (written for a denser BS3-era menu) left User Profile/Logout cramped - more
   breathing room here, loaded after that rule so it wins on the same selector. */
.navbar-top-links .dropdown-menu li a {
	color: #333333;
	padding: 10px 20px;
}

.navbar-top-links .dropdown-menu li.divider {
	height: 1px;
	margin: 6px 0;
	background-color: #e5e5e5;
	overflow: hidden;
}

.sidebar.navbar-default {
	background-color: var(--app-frame-bg);
}

.sidebar .sidebar-search {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* The search button is `.btn-default` - a bare BS3 class BS5 never defines, so it falls back to
   the base `.btn`'s own default color (dark body text) on a transparent background. Fine against
   a light sidebar; invisible (dark icon on dark background) against this one. */
.sidebar-search .btn {
	color: var(--app-frame-text);
}

.sidebar-search .btn:hover,
.sidebar-search .btn:focus {
	color: #fff;
}

.sidebar ul li {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .nav > li > a,
.sidebar .nav-second-level li a,
.sidebar .nav-third-level li a {
	color: var(--app-frame-text);
}

/* text-decoration: none overrides sb-admin-2.css's global `a:hover { text-decoration: underline; }`
   (restored there for BS5 compat, app-wide) - without it, hovering a sidebar link underlined the
   whole <a>, icon and the space before the text included, not just the link text itself. The
   background/color change above is this app's own hover feedback for a nav link; it doesn't need
   an underline on top of that. */
.sidebar .nav > li > a:hover,
.sidebar .nav > li > a:focus,
.sidebar .nav-second-level li a:hover,
.sidebar .nav-third-level li a:hover {
	color: #fff;
	background-color: rgba(255, 255, 255, 0.06);
	text-decoration: none;
}

/* Active page highlight - a left accent bar in the warm accent color reads clearly against the
   dark sidebar, where the stock theme's light-gray background (meant for a light sidebar) would
   have been invisible. */
.sidebar ul li a.active {
	background-color: rgba(255, 255, 255, 0.08);
	border-left: 3px solid var(--app-accent);
	color: #fff;
}

.sidebar .nav-second-level,
.sidebar .nav-third-level {
	background-color: var(--app-frame-bg-nested);
}

.sidebar .arrow {
	color: var(--app-frame-text-muted);
}

/* Quick Links dashboard tile (views/widgets/wmainmenu.php) - plain <a> icons otherwise inherit
   Bootstrap's default link blue (--bs-link-color, #0d6efd), a different, slightly mismatched blue
   sitting right under the widget header's own primary blue (#337ab7) - the two clashed rather than
   reading as one deliberate color. A lighter charcoal (not body text's own #333333, which reads as
   near-black at fa-4x icon size) keeps the header as the one spot of color in that widget; the
   hover state still confirms it's clickable. */
.quick-link-tile {
	color: #5a5a5a;
}

.quick-link-tile:hover,
.quick-link-tile:focus {
	color: var(--bs-primary);
}

.nowrapping {
	white-space: nowrap;
}

/* Keep the invoice editor's 2-column action buttons (vinvoiceeditor.php) a uniform size even when
   a label wraps to two lines at the narrower column width. */
.invoice-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 64px;
	text-align: center;
}

.invoice-action-btn i {
	margin-right: 8px;
}

table.report {
	width: 100%;
}

table.report tr th {
	background-color: #cccccc;
}

/* Subtotal/Grand Total rows across the report pages (rpaidinvoicesdetail.php,
   rpaidinvoicesbyclient.php/js, rsalestaxdetail.js, rsalestaxbydistrict.js) - bold with a divider line above. */
table.report tr.report-total-row td {
	font-weight: bold;
	border-top: 2px solid #333333;
}

/* Paid Invoices - By Client: the Grand Total table and each per-client table (rpaidinvoicesbyclient.php/js)
   are separate <table> elements, so by default each auto-sizes its own columns from its own content and
   their dollar columns don't line up. table-layout:fixed with no explicit widths splits a table's columns
   evenly by count instead - since every one of these tables has the same 9-column shape (the Grand Total's
   first cell uses colspan=6 to match), that makes every column land at the same horizontal position in
   every table. */
table.report.report-byclient-table {
	table-layout: fixed;
}

/* Sales Tax - Detail/By District (rsalestaxdetail.js, rsalestaxbydistrict.js): each group's heading is a
   full-width row inside the report's single table - give it the spacing the old standalone <h2> had. */
table.report tr.report-group-row td {
	padding-top: 12px;
}

/* Sales Tax - Detail: the district + rate sub-section heading under each customer. */
table.report tr.report-subgroup-row td {
	padding-top: 8px;
}

table.report tr.report-subgroup-row h4 {
	font-size: 1.1rem;
	font-weight: bold;
	margin-bottom: 2px;
}

table.report tr {
	
}

table.report tr td {
	
	
}

body {
	font-size: 16px;
	color: #333333;
}

table {

}

th {
	font-weight: bold;
	color: #111111;
	background-color: #eeeeee;
}

/* Dashboard widgets and other .card panels (core/widget.php's dispWidgetTop()) - a soft shadow and
   slightly larger corner radius so they read as distinct, lifted panels against the page background
   instead of just a thin flat-bordered box, same spirit as the dark nav frame above. */
.card {
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
	border-top-left-radius: 6px !important;
	border-top-right-radius: 6px !important;
}

/* A small lift on hover for primary buttons - purely decorative, reinforces that it's clickable. */
.btn-primary:hover {
	box-shadow: 0 2px 4px rgba(51, 122, 183, 0.35);
}

/* Every page's title (View::writeTitle(), core/view.php) renders as `h1.page-header` - a bare BS3
   class BS5 never defines (same dead-class pattern as `.btn-default`/`.divider` elsewhere in this
   file), so it rendered as a completely plain, unstyled heading with nothing setting it apart from
   the content below. Restoring a page-header treatment - generous bottom padding plus a rule line
   - but with the primary blue as that rule instead of BS3's original plain gray, tying it to the
   rest of this visual refresh rather than just reproducing the old default. */
h1.page-header {
	margin: 10px 0 25px;
	padding-bottom: 12px;
	border-bottom: 3px solid var(--bs-primary);
}

/* Expense Quick Entry grid (views/vexpensequickentry.php) - flat, borderless fields until focused, so
   a page full of inputs reads as a dense spreadsheet rather than a stack of separate form controls. */
table.qe-table td {
	padding: 2px 4px;
	vertical-align: middle;
}

table.qe-table input,
table.qe-table select {
	border: 1px solid transparent;
	background-color: transparent;
}

table.qe-table input:focus,
table.qe-table select:focus {
	border-color: #337ab7;
	background-color: #fff;
}

table.qe-table .qe-status-cell {
	white-space: nowrap;
}

table.qe-table .qe-status {
	display: inline-block;
	width: 16px;
	text-align: center;
}

/* Whole-row tint for a row's save state (set in vexpensequickentry.js's setRowStatus()) - a small icon
   alone in the last column was too easy to tab right past without noticing a row had failed to save. */
table.qe-table tr.qe-row-saving {
	background-color: #f5f5f5;
}

table.qe-table tr.qe-row-saved {
	background-color: #eaf6ea;
}

table.qe-table tr.qe-row-error {
	background-color: #fdecea;
	box-shadow: inset 3px 0 0 #c0392b;
}

/* The single trailing blank row (vexpensequickentry.js's wireRow()) - looks like a placeholder, not a
   real row, until the user actually starts typing into it (handleRowBecameDirty() removes this). */
table.qe-table tr.qe-row-blank {
	opacity: 0.5;
}

/* ============================================================================================
   Collapsible sidebar (issue #137) - toggleSidebar() in js/common.js flips `sidebar-collapsed` on
   <body> (and remembers it in a cookie so core/view.php can render it already-collapsed server-side,
   no flash of the full-width sidebar first). Narrows the sidebar down to icon-only; a top-level item
   with sub-items (everything except Dashboard/System Admin) shows them as a flyout panel next to its
   icon instead of pushing them in below, since sub-items have no icon of their own and need real text.
   Scoped to the same >=768px breakpoint the sidebar's own absolute-positioned layout already uses
   (sb-admin-2.css) - below that, the existing navbar-toggler collapse is the right mobile behavior,
   so the new toggle button is hidden there instead of fighting it.
   ============================================================================================ */
@media (max-width: 767px) {
	#sidebarToggle {
		display: none;
	}
}

.btn-sidebar-toggle {
	background: none;
	border: none;
	color: var(--app-frame-text);
	font-size: 18px;
	padding: 15px;
	cursor: pointer;
}

.btn-sidebar-toggle:hover,
.btn-sidebar-toggle:focus {
	color: #fff;
}

@media (min-width: 768px) {
	body.sidebar-collapsed #wrapper {
		background: linear-gradient(to right, var(--app-frame-bg) 70px, transparent 70px);
	}

	body.sidebar-collapsed #page-wrapper {
		margin-left: 70px;
	}

	body.sidebar-collapsed .sidebar {
		width: 70px;
	}
}

body.sidebar-collapsed .sidebar .sidebar-search {
	display: none;
}

body.sidebar-collapsed .sidebar .nav > li > a > .nav-label,
body.sidebar-collapsed .sidebar .nav > li > a > .fa.arrow {
	display: none;
}

body.sidebar-collapsed .sidebar .nav > li > a {
	text-align: center;
	padding-left: 0;
	padding-right: 0;
}

body.sidebar-collapsed .sidebar .nav > li {
	position: relative;
}

/* Position every top-level group's submenu as a flyout instead of pushing it inline below the icon
   (which would look broken in a ~70px column) - applies whether it ends up visible via hover (below)
   or via metisMenu's own click-driven mm-show class (e.g. the branch matching the current page, marked
   active server-side - see core/view.php). */
body.sidebar-collapsed .sidebar .nav > li > ul.nav-second-level {
	position: absolute;
	left: 70px;
	top: 0;
	min-width: 220px;
	margin: 0;
	background-color: var(--app-frame-bg-nested);
	box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.35);
	z-index: 1050;
}

/* Mouse-only quick access - reveals the flyout on hover without clicking first. Higher specificity than
   metisMenu's own `.mm-collapse:not(.mm-show) { display: none; }` (metisMenu.min.css), so this wins
   regardless of load order. A third-level group inside the flyout (e.g. Reports' own sub-groups) still
   expands inline, exactly like the non-collapsed sidebar - it's full text at that point, nothing left
   to turn into a flyout. */
body.sidebar-collapsed .sidebar .nav > li:hover > ul.nav-second-level {
	display: block;
}