/*
 * The school's own colours (General Settings > Theme & Colors) applied to the template's components.
 * Loaded only for a school that has chosen at least one colour, after every other stylesheet. The values arrive as CSS
 * custom properties (views/layouts/include.blade.php, computed by App\Support\SchoolTheme, which also makes sure text
 * stays readable on whatever the school picks):
 *
 *   --theme-primary / -dark / -ink / -tint   main buttons, links, active states
 *   --theme-secondary / -ink                 supporting accents, gradients
 *   --theme-bg, --theme-surface, --theme-text, --theme-muted, --theme-line
 *   --theme-on-primary, --theme-on-secondary the text colour that reads on those fills
 */

/* page and text */
body { color: var(--theme-text); background-color: var(--theme-bg); }
.page-body-wrapper, .main-panel { background: var(--theme-bg); }
.content-wrapper { background: var(--theme-bg); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .page-title, .card-title, label, .table, .table th, .table td, .form-control, .card-body, .modal-body { color: var(--theme-text); }
.text-muted, .form-text, small.text-muted { color: var(--theme-muted) !important; }
.card, .modal-content, .dropdown-menu, .sidebar, .navbar .navbar-menu-wrapper, .form-control, .custom-select, .input-group-text { background-color: var(--theme-surface); }
.sidebar .nav .nav-item .nav-link { color: var(--theme-text); }
.card, .table td, .table th, .form-control, .custom-select, .modal-header, .modal-footer, .sidebar { border-color: var(--theme-line); }
hr { border-top-color: var(--theme-line); }

/* links */
a { color: var(--theme-primary-ink); }
a:hover { color: var(--theme-primary-dark); }
a.btn, .sidebar a, .nav-link, .dropdown-item, .page-link, .breadcrumb-item a { text-decoration: none; }

/* primary */
.btn-primary, .btn-gradient-primary, .btn-theme, .wizard > .actions a,
.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active {
    background: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-on-primary) !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-gradient-primary:hover, .btn-gradient-primary:focus, .btn-theme:hover, .btn-theme:focus, .wizard > .actions a:hover {
    background: var(--theme-primary-dark) !important;
    border-color: var(--theme-primary-dark) !important;
    color: var(--theme-on-primary) !important;
}
.btn-outline-primary { color: var(--theme-primary-ink); border-color: var(--theme-primary); background: transparent; }
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active, .btn-outline-primary:not(:disabled):not(.disabled).active {
    background: var(--theme-primary); border-color: var(--theme-primary); color: var(--theme-on-primary);
}
.text-primary, .text-theme, .theme-color { color: var(--theme-primary-ink) !important; }
.bg-primary, .bg-theme, .bg-gradient-primary { background: var(--theme-primary) !important; color: var(--theme-on-primary) !important; }
.border-primary { border-color: var(--theme-primary) !important; }
.badge-primary, .badge-gradient-primary { background: var(--theme-primary) !important; color: var(--theme-on-primary) !important; }
.page-item.active .page-link, .nav-pills .nav-link.active, .nav-pills .show > .nav-link, .dropdown-item.active, .dropdown-item:active {
    background: var(--theme-primary) !important; border-color: var(--theme-primary) !important; color: var(--theme-on-primary) !important;
}
.page-link { color: var(--theme-primary-ink); }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: var(--theme-primary-ink); border-bottom-color: var(--theme-primary); background: var(--theme-surface); }
.progress-bar { background: var(--theme-primary) !important; }
.custom-control-input:checked ~ .custom-control-label::before { background-color: var(--theme-primary); border-color: var(--theme-primary); }
.form-control:focus, .custom-select:focus, .select2-container--default.select2-container--focus .select2-selection--multiple { border-color: var(--theme-primary); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--theme-primary); color: var(--theme-on-primary); }
.fixed-table-pagination .page-item.active .page-link { background: var(--theme-primary) !important; border-color: var(--theme-primary) !important; color: var(--theme-on-primary) !important; }

/* secondary: supporting accents */
.btn-info, .btn-gradient-info, .btn-info:not(.btn-light) { background: var(--theme-secondary) !important; border-color: var(--theme-secondary) !important; color: var(--theme-on-secondary) !important; }
.btn-info:hover, .btn-info:focus, .btn-gradient-info:hover, .btn-info:not(.btn-light):hover { background: var(--theme-secondary-dark) !important; border-color: var(--theme-secondary-dark) !important; color: var(--theme-on-secondary) !important; }
.badge-info, .badge-gradient-info, .bg-info, .bg-gradient-info { background: var(--theme-secondary) !important; color: var(--theme-on-secondary) !important; }
.text-info { color: var(--theme-secondary-ink) !important; }
.page-header .page-title .page-title-icon { background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary)) !important; color: var(--theme-on-primary); }
.page-header .page-title .page-title-icon i { color: var(--theme-on-primary); }
.card .card-header, .modal-header { border-bottom-color: var(--theme-line); }
.table thead th { border-bottom-color: var(--theme-secondary); }
