/* ============================================================
   CSS CUSTOM PROPERTIES — defined at runtime by themeVars.php
   @see css/theme/themeVars.php  (emits the :root { } block)
   @see css/theme/themeConfig.php (token values per tenant)

   The following custom properties are set dynamically per tenant:
     --primary-color    (RGB triplet, e.g. 33, 33, 41)
     --secondary-color  (RGB triplet, e.g. 157, 131, 62)
     --border-color     (RGB triplet, e.g. 233, 236, 239)
     --menu-bb-icon     (url(), e.g. url("/images/billboard-icon.png"))

   DO NOT declare a :root {} block here — themeVars.php loads first
   and sets the real values; a :root here would override them because
   this file loads second in the cascade.

   Note: navbar .brand-logo image URLs are not themed in CSS.
   They come from PHP session values (softwareLogo/softwareLogoTop)
   via displayLogo() in includes/inc.functions.php.
   ============================================================ */

/* ============================================================
   THEME TABLE STYLES (migrated from theme.php)
   ============================================================ */
.theme-table {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-striped-color: #212529;
    --bs-table-striped-bg: rgba(0, 0, 0, 0.05);
    --bs-table-active-color: #212529;
    --bs-table-active-bg: rgba(0, 0, 0, 0.1);
    --bs-table-hover-color: #212529;
    --bs-table-hover-bg: #f8f9fa;
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    vertical-align: top;
    border-color: rgb(var(--border-color));
    caption-side: bottom;
    border-collapse: collapse;
}
.theme-table tbody, .theme-table td, .theme-table tfoot, .theme-table th, .theme-table thead, .theme-table tr {
    border-color: inherit;
    border-style: solid;
    border-width: 0;
}
.theme-table th, .theme-table tr, .theme-table td {
    padding: 3px 3px;
    background-color: var(--bs-table-bg);
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
}
.theme-table tr {
    border-bottom: 1px solid rgb(var(--border-color));
    border-bottom-width: 1px;
}
.theme-table tr:last-of-type {
    border-bottom: none;
}
.theme-table-vertical th, .theme-table-vertical td {
    text-align: center;
    width: 50%;
}
.theme-table th {
    color: rgb(var(--secondary-color));
}

/* ============================================================
   THEMED STYLES (migrated from style.php)
   ============================================================ */

/* --- Icons --- */
.icon { font-size: 25px; color: rgb(var(--primary-color)); }

/* --- Menu billboard icon: themed when provided, otherwise keep main-branch default --- */
.mnu-campaign { background-image: var(--menu-bb-icon, url("/images/billboard-icon.png")); }

/* --- Nav --- */
nav { background-color: rgb(var(--primary-color)); }
nav ul li { display: inline-block; background-color: rgb(var(--primary-color)); }
nav a:hover { background-color: #333; color: rgb(var(--primary-color)); text-decoration: none; }

/* --- Sidebar --- */
.sidebar-text { color: rgb(var(--primary-color)) !important; }
.sidebar li.current .menu-url > .sidebar-icon,
.sidebar li a > .sidebar-icon { color: rgb(var(--secondary-color)) !important; }
.sidebar .current .menu-url:hover > .sidebar-icon { color: rgb(var(--primary-color)) !important; }
.sidebar-icon-top { color: rgb(var(--secondary-color)); }

/* --- Flight day TD --- */
.fdDayTD { background: rgb(var(--primary-color)) !important; }

/* --- Legend --- */
legend { background: rgb(var(--primary-color)); }

/* --- System color --- */
.sysColor { color: rgb(var(--primary-color)); }

/* --- DB Module header --- */
.dbModule h3 { background: rgb(var(--primary-color)) bottom; }

/* --- Send Mail Toggle --- */
#sendMailToggle { background: rgb(var(--primary-color)) !important; color: rgb(var(--send-mail-toggle-color)) !important; }

/* --- Datagrid header --- */
.datagrid thead tr th { color: rgb(var(--secondary-color)) !important; }
.datagrid thead tr th.sortableCol { color: rgb(var(--secondary-color)) !important; }
.datagrid thead tr th:hover { color: rgb(var(--secondary-hover-color)) !important; }
.datagrid thead tr th.sortableCol:hover { color: rgb(var(--secondary-hover-color)) !important; }

/* --- Vendor required fields --- */
textarea.vendor-required,
input.vendor-required { border: solid 1px rgb(var(--primary-color)) !important; }

/* --- Form inputs --- */
input[type=text] { border-bottom: solid rgb(var(--secondary-color)) 2px; }
/* TODO: The four focus background-color rules below are overridden by agency.php's
   #fafafa !important focus rules (which load after this file). These may be dead CSS
   and candidates for removal. See index.php CSS load-order comment. */
input[type=text]:focus, .usedInPDF:focus { background-color: rgb(var(--primary-color)) !important; }
input[type=password] { border-bottom: solid rgb(var(--secondary-color)) 2px; }
input[type=password]:focus { background-color: rgb(var(--primary-color)); }
input[type=checkbox]:checked { background-color: rgb(var(--primary-color)); }
select { border-bottom: rgb(var(--secondary-color)) solid 2px !important; }
select:focus { background-color: rgb(var(--primary-color)); }
textarea { border-bottom: solid rgb(var(--secondary-color)) 2px; }
textarea:focus { background-color: rgb(var(--primary-color)); }

/* --- Hover div (drag/drop popup) --- */
.hoverDiv { border: 8px solid rgb(var(--primary-color)); }
.hoverDiv h1 { border-bottom: solid 3px rgb(var(--primary-color)); }

/* --- isLink --- */
.isLink { color: rgb(var(--primary-color)) !important; }

/* --- Vendor sidebar --- */
.vendor-side-bar .vendor-current .vendor-menu-link:hover > .sidebar-icon { color: rgb(var(--primary-color)) !important; }
.vendor-side-bar .vendor-current a > .sidebar-icon { color: rgb(var(--secondary-color)) !important; }
