/*
 * System-wide Bovine theme (paleta-bovine.pdf) — the sign-in screen's palette
 * (resources/css/login-v3.css, .ial-auth--bovine) applied to the whole app.
 *
 * Loaded by layouts/master.blade.php and layouts/master-without-nav.blade.php
 * right after layouts.head-css, so it wins over bootstrap.min.css /
 * app.min.css (Toner, `--tb-*` tokens) and ial.css at equal specificity.
 * Nothing here changes layout — colours only. Semantic colours (success,
 * warning, danger) keep their meaning; success is only softened to the v3
 * green (see "Success, softened" below — still green, never re-pointed).
 *
 *   Bovine scale  50 #F3F4F5 · 100 #E1E3E5 · 200 #C3C7CA · 300 #9CA2A6
 *                 400 #767D82 · 500 #52585C · 600 #454A4E · 700 #383C3F
 *                 800 #2A2D2F · 900 #1C1E20
 *   Blue accents  Névoa #DCE8F2 · Aço #6F93B3 · Principal #2F6FA8
 *                 Marinho #1E3A5F
 *
 * The sidebar (sidebar-v3.css), grids (grid-v3.css) and modals
 * (modal-v3.css) already use these tokens; this file covers the rest.
 */

:root {
    --bovine-50: #F3F4F5;
    --bovine-100: #E1E3E5;
    --bovine-200: #C3C7CA;
    --bovine-300: #9CA2A6;
    --bovine-400: #767D82;
    --bovine-500: #52585C;
    --bovine-600: #454A4E;
    --bovine-700: #383C3F;
    --bovine-800: #2A2D2F;
    --bovine-900: #1C1E20;
    --azul-nevoa: #DCE8F2;
    --azul-aco: #6F93B3;
    --azul-principal: #2F6FA8;
    --azul-marinho: #1E3A5F;
}

/* Bootstrap / Toner theme tokens — light theme only (bootstrap.min.css's
   [data-bs-theme=dark] block has equal specificity, so an unscoped :root
   here would force these light values into dark mode). */
:root:not([data-bs-theme="dark"]),
[data-bs-theme="light"] {
    --tb-primary: #2F6FA8;
    --tb-primary-rgb: 47, 111, 168;
    --tb-primary-text-emphasis: #1E3A5F;
    --tb-primary-bg-subtle: #DCE8F2;
    --tb-primary-border-subtle: #B7CCE0;

    --tb-secondary: #52585C;
    --tb-secondary-rgb: 82, 88, 92;
    --tb-secondary-text-emphasis: #383C3F;
    --tb-secondary-bg-subtle: #E1E3E5;
    --tb-secondary-border-subtle: #C3C7CA;

    --tb-info: #6F93B3;
    --tb-info-rgb: 111, 147, 179;
    --tb-info-text-emphasis: #1E3A5F;
    --tb-info-bg-subtle: #DCE8F2;
    --tb-info-border-subtle: #B7CCE0;

    --tb-light: #F3F4F5;
    --tb-light-rgb: 243, 244, 245;
    --tb-light-text-emphasis: #52585C;
    --tb-light-bg-subtle: #F3F4F5;
    --tb-light-border-subtle: #E1E3E5;

    --tb-dark: #1C1E20;
    --tb-dark-rgb: 28, 30, 32;
    --tb-dark-text-emphasis: #2A2D2F;
    --tb-dark-bg-subtle: #C3C7CA;
    --tb-dark-border-subtle: #9CA2A6;

    --tb-gray-dark: #2A2D2F;

    --tb-body-color: #2A2D2F;
    --tb-body-color-rgb: 42, 45, 47;
    --tb-emphasis-color: #1C1E20;
    --tb-emphasis-color-rgb: 28, 30, 32;
    --tb-secondary-color: rgba(42, 45, 47, .75);
    --tb-secondary-color-rgb: 42, 45, 47;
    --tb-tertiary-color: rgba(42, 45, 47, .5);
    --tb-tertiary-color-rgb: 42, 45, 47;
    --tb-tertiary-bg: #F3F4F5;
    --tb-tertiary-bg-rgb: 243, 244, 245;
    --tb-heading-color: #1C1E20;

    --tb-link-color: #2F6FA8;
    --tb-link-color-rgb: 47, 111, 168;
    --tb-link-hover-color: #1E3A5F;
    --tb-link-hover-color-rgb: 30, 58, 95;

    --tb-border-color: #E1E3E5;              /* was light blue #c7dcff */
    --tb-border-color-translucent: #E1E3E5;
    --tb-focus-ring-color: rgba(47, 111, 168, .25);

    /* topbar / footer */
    --tb-header-bg: #fff;
    --tb-header-item-color: #2A2D2F;
    --tb-header-item-sub-color: #52585C;
    --tb-topbar-search-bg: #F3F4F5;
    --tb-topbar-user-bg: #F3F4F5;
    --tb-footer-bg: #fff;
    --tb-footer-color: #52585C;
}

/* ---- Page ---------------------------------------------------------------- */

:root:not([data-bs-theme="dark"]) body {
    background-color: var(--bovine-50);
}

:root:not([data-bs-theme="dark"]) #page-topbar {
    border-bottom: 1px solid var(--bovine-100);
    box-shadow: none;
}

.page-title-box .page-title,
.page-title-box h4 {
    color: var(--bovine-900);
}

.breadcrumb {
    --tb-breadcrumb-item-active-color: #52585C;
    --tb-breadcrumb-divider-color: #9CA2A6;
}

/* ---- Buttons (Bootstrap sets these per class with hex values) ----------- */

.btn-primary {
    --tb-btn-bg: #2F6FA8;
    --tb-btn-border-color: #2F6FA8;
    --tb-btn-hover-bg: #1E3A5F;
    --tb-btn-hover-border-color: #1E3A5F;
    --tb-btn-focus-shadow-rgb: 47, 111, 168;
    --tb-btn-active-bg: #1E3A5F;
    --tb-btn-active-border-color: #1E3A5F;
    --tb-btn-disabled-bg: #2F6FA8;
    --tb-btn-disabled-border-color: #2F6FA8;
}

.btn-outline-primary {
    --tb-btn-color: #2F6FA8;
    --tb-btn-border-color: #2F6FA8;
    --tb-btn-hover-bg: #2F6FA8;
    --tb-btn-hover-border-color: #2F6FA8;
    --tb-btn-focus-shadow-rgb: 47, 111, 168;
    --tb-btn-active-bg: #1E3A5F;
    --tb-btn-active-border-color: #1E3A5F;
    --tb-btn-disabled-color: #2F6FA8;
    --tb-btn-disabled-border-color: #2F6FA8;
}

.btn-secondary {
    --tb-btn-bg: #52585C;
    --tb-btn-border-color: #52585C;
    --tb-btn-hover-bg: #383C3F;
    --tb-btn-hover-border-color: #383C3F;
    --tb-btn-focus-shadow-rgb: 82, 88, 92;
    --tb-btn-active-bg: #2A2D2F;
    --tb-btn-active-border-color: #2A2D2F;
    --tb-btn-disabled-bg: #52585C;
    --tb-btn-disabled-border-color: #52585C;
}

.btn-outline-secondary {
    --tb-btn-color: #52585C;
    --tb-btn-border-color: #C3C7CA;
    --tb-btn-hover-color: #fff;
    --tb-btn-hover-bg: #52585C;
    --tb-btn-hover-border-color: #52585C;
    --tb-btn-focus-shadow-rgb: 82, 88, 92;
    --tb-btn-active-bg: #383C3F;
    --tb-btn-active-border-color: #383C3F;
    --tb-btn-disabled-color: #9CA2A6;
    --tb-btn-disabled-border-color: #C3C7CA;
}

.btn-info {
    --tb-btn-color: #fff;
    --tb-btn-bg: #6F93B3;
    --tb-btn-border-color: #6F93B3;
    --tb-btn-hover-color: #fff;
    --tb-btn-hover-bg: #1E3A5F;
    --tb-btn-hover-border-color: #1E3A5F;
    --tb-btn-focus-shadow-rgb: 111, 147, 179;
    --tb-btn-active-color: #fff;
    --tb-btn-active-bg: #1E3A5F;
    --tb-btn-active-border-color: #1E3A5F;
}

:root .btn-dark {
    --tb-btn-bg: #2A2D2F;
    --tb-btn-border-color: #2A2D2F;
    --tb-btn-hover-bg: #1C1E20;
    --tb-btn-hover-border-color: #1C1E20;
    --tb-btn-active-bg: #1C1E20;
    --tb-btn-active-border-color: #1C1E20;
}

.btn-light {
    --tb-btn-color: #383C3F;
    --tb-btn-bg: #F3F4F5;
    --tb-btn-border-color: #E1E3E5;
    --tb-btn-hover-color: #1C1E20;
    --tb-btn-hover-bg: #E1E3E5;
    --tb-btn-hover-border-color: #C3C7CA;
    --tb-btn-active-bg: #E1E3E5;
    --tb-btn-active-border-color: #C3C7CA;
}

/* Toner's "soft" buttons, primary checkboxes/radios and alert-primary are
   defined in app.min.css with hard-coded hex — and app.min.css is loaded a
   second time after this file (the @vite('resources/sass/app.scss') entry
   compiles to the same css/app.min.css), so these carry a `:root` prefix to
   win on specificity instead of relying on load order. */

:root .btn-soft-primary {
    --tb-btn-color: #2F6FA8;
    --tb-btn-bg: rgba(47, 111, 168, .1);
    --tb-btn-hover-color: #fff;
    --tb-btn-hover-bg: #2F6FA8;
    --tb-btn-focus-shadow-rgb: 47, 111, 168;
    --tb-btn-active-bg: #1E3A5F;
}

:root .btn-soft-secondary {
    --tb-btn-color: #52585C;
    --tb-btn-bg: rgba(82, 88, 92, .1);
    --tb-btn-hover-color: #fff;
    --tb-btn-hover-bg: #52585C;
    --tb-btn-focus-shadow-rgb: 82, 88, 92;
    --tb-btn-active-bg: #383C3F;
}

:root .btn-soft-info {
    --tb-btn-color: #1E3A5F;
    --tb-btn-bg: rgba(111, 147, 179, .15);
    --tb-btn-hover-color: #fff;
    --tb-btn-hover-bg: #6F93B3;
    --tb-btn-focus-shadow-rgb: 111, 147, 179;
    --tb-btn-active-bg: #1E3A5F;
}

:root .form-check-primary .form-check-input:checked,
:root .form-radio-primary .form-check-input:checked {
    background-color: #2F6FA8;
    border-color: #2F6FA8;
}

:root .form-check-secondary .form-check-input:checked,
:root .form-radio-secondary .form-check-input:checked {
    background-color: #52585C;
    border-color: #52585C;
}

:root .alert-primary {
    --tb-alert-bg: #DCE8F2;
    --tb-alert-color: #1E3A5F;
    --tb-alert-border-color: #B7CCE0;
    color: #1E3A5F;
}

/* ---- Forms, nav, pagination, dropdowns ----------------------------------- */

.form-control:focus,
.form-select:focus {
    border-color: #2F6FA8;
    box-shadow: 0 0 0 3px rgba(47, 111, 168, .18);
}

.form-check-input:checked {
    background-color: #2F6FA8;
    border-color: #2F6FA8;
}

.form-check-input:focus {
    border-color: #2F6FA8;
    box-shadow: 0 0 0 3px rgba(47, 111, 168, .18);
}

.nav-pills {
    --tb-nav-pills-link-active-bg: #2F6FA8;
}

.pagination {
    --tb-pagination-active-bg: #2F6FA8;
    --tb-pagination-active-border-color: #2F6FA8;
    --tb-pagination-hover-bg: #DCE8F2;
    --tb-pagination-hover-color: #1E3A5F;
}

.dropdown-menu {
    --tb-dropdown-link-active-bg: #2F6FA8;
    --tb-dropdown-link-hover-bg: #F3F4F5;
    --tb-dropdown-border-color: #E1E3E5;
}

/* ---- IDMS custom classes (resources/css/ial.css) ------------------------- */
/* ial.css hard-codes the old slate #374151 / #2d3748, blue-grey #f8f9fb /
   #e6eaf1 and Bootstrap blue #0d6efd; re-pointed here to the palette. */

.page-container,
.tab-pane-background {
    background-color: #F3F4F5;
}

.page-subtitle {
    color: #52585C;
}

.ribbon-box .ribbon-news {
    background: #2A2D2F;
}

.header-dark,
.topbar-dark-custom {
    background-color: #2A2D2F;
    border-bottom-color: #1C1E20;
}

.btn-dark-custom {
    background-color: #2A2D2F;
    border-color: #2A2D2F;
}

.btn-dark-custom:hover {
    background-color: #1C1E20;
    border-color: #1C1E20;
}

.custom-tab-bg .card-header:hover,
.custom-tab-bg.active-tab .card-header {
    background-color: #E1E3E5;
}

.custom-tab-bg.active-tab .card-header {
    box-shadow: inset 0 0 0 .5px #C3C7CA;
}

/* FullCalendar buttons (ial.css forces Bootstrap blue with !important) */
.fc .fc-button,
.fc .fc-button-primary {
    background-color: #2F6FA8 !important;
    border-color: #2F6FA8 !important;
}

.fc .fc-button:hover,
.fc .fc-button:focus,
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background-color: #1E3A5F !important;
    border-color: #1E3A5F !important;
}

/* ---- Dashboards (dashboard.css, dash2-* tokens) -------------------------- */
/* All module dashboards: coral accent → Principal, neutrals → Bovine. The
   /main page's .dash2-theme-ial modifier (navy) is re-pointed the same way.
   Semantic pos / neg / warn tokens are unchanged. */

:root:not([data-bs-theme="dark"]),
:root:not([data-bs-theme="dark"]) .dashboard-v2,
:root:not([data-bs-theme="dark"]) .dashboard-v2.dash2-theme-ial {
    --dash2-bg: #F3F4F5;
    --dash2-line: #E1E3E5;
    --dash2-line-soft: #F3F4F5;
    --dash2-ink: #1C1E20;
    --dash2-ink-2: #52585C;
    --dash2-ink-3: #5C6267;
    --dash2-accent: #2F6FA8;
    --dash2-accent-soft: #DCE8F2;
    --dash2-accent-border: #B7CCE0;
    --dash2-spark-neutral: #9CA2A6;
}

[data-bs-theme="dark"] .dashboard-v2,
[data-bs-theme="dark"] .dashboard-v2.dash2-theme-ial {
    --dash2-accent: #6F93B3;
    --dash2-accent-soft: #1E2A38;
    --dash2-accent-border: #2E3F52;
}

/* ---- Success, softened (change-log 2026-10-11) ------------------------------
   The theme's bright #2dcb73 success green, toned to the v3 green the grids'
   status badges already use (grid-v3.css "Status badges (soft)"). Still green,
   so it keeps its meaning. Dashboards' trend colours and plain text-success
   are deliberately left alone. */

/* Badges / pills -- e.g. Security Groups "N allow" / "Allow", the securities
   toolbar "N allowed", the user menu's "New". Same pill as the grid badges. */
.badge.bg-success,
.badge.text-bg-success,
.badge.bg-success-subtle {
    background-color: #E6F2EA !important;
    color: #256B43 !important;
    box-shadow: inset 0 0 0 1px #CBE3D3;
}

/* The Security Groups Keys grid's Allow decision <select> (bg-success-subtle
   text-success border-success). */
.form-select.bg-success-subtle {
    background-color: #E6F2EA !important;
    color: #256B43 !important;
    border-color: #CBE3D3 !important;
}

/* Solid green buttons that stay green because green means something there
   (Security Groups / securities toolbar "Allow" next to a red "Deny").
   White on #2E7D4F is 5:1 (the old #2dcb73 was ~2.1:1). The older screens'
   green Save buttons were switched to .btn-primary (blue) instead. */
.btn-success {
    --tb-btn-bg: #2E7D4F;
    --tb-btn-border-color: #2E7D4F;
    --tb-btn-hover-bg: #256B43;
    --tb-btn-hover-border-color: #256B43;
    --tb-btn-focus-shadow-rgb: 46, 125, 79;
    --tb-btn-active-bg: #1F5A38;
    --tb-btn-active-border-color: #1F5A38;
    --tb-btn-disabled-bg: #2E7D4F;
    --tb-btn-disabled-border-color: #2E7D4F;
}

/* Success messages (login / password reset / PIN / inbox / shared message
   components). Same pattern as .alert-primary above. */
:root .alert-success {
    --tb-alert-bg: #E6F2EA;
    --tb-alert-color: #256B43;
    --tb-alert-border-color: #CBE3D3;
    color: #256B43;
}

:root .alert-success .alert-link {
    color: #1F5A38;
}
