/* ==========================================================================
   LCS.TemplateBase - LCS visual identity
   --------------------------------------------------------------------------
   This file is loaded AFTER the template CSS (app.min.css) and is the only
   place where the visual identity is applied. Never edit the original template CSS:
   if the template is updated, just copy the new assets over the old ones.

   Palette (brand manual): Navy #051924 | Gray #838383 | Blue #097BBA
   Brand typography: Gotham Bold (headings). Web equivalent used by the
   template: Montserrat (headings) + IBM Plex Sans (text).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Brand tokens
   -------------------------------------------------------------------------- */
:root {
    --lcs-navy: #051924;
    --lcs-navy-800: #0a2535;
    --lcs-navy-700: #10344a;
    --lcs-navy-600: #17445f;
    --lcs-blue: #097bba;
    --lcs-blue-hover: #0868a0;
    --lcs-blue-active: #065883;
    --lcs-blue-subtle: #e1f0f8;
    --lcs-blue-border: #a9d3ea;
    --lcs-gray: #838383;
    --lcs-radius: 10px;
}

/* --------------------------------------------------------------------------
   2. Bootstrap/template variables - light theme
   -------------------------------------------------------------------------- */
:root,
[data-bs-theme=light] {
    --bs-primary: #097bba;
    --bs-primary-rgb: 9, 123, 186;
    --bs-purple: #097bba;
    --bs-purple-rgb: 9, 123, 186;
    --bs-primary-text-emphasis: #043d5d;
    --bs-primary-bg-subtle: #e1f0f8;
    --bs-primary-border-subtle: #a9d3ea;
    --bs-link-color: #097bba;
    --bs-link-color-rgb: 9, 123, 186;
    --bs-link-hover-color: #065883;
    --bs-link-hover-color-rgb: 6, 88, 131;
    --bs-focus-ring-color: rgba(9, 123, 186, 0.25);

    --bs-body-bg: #f3f6f9;
    --bs-body-color: #3d4b57;
    --bs-heading-color: #051924;
    --bs-secondary-bg: #ffffff;
    --bs-tertiary-bg: #f3f6f9;
    --bs-border-color: #e1e7ed;
    --bs-border-color-translucent: #e1e7ed;
    --bs-border-radius: 8px;

    --bs-header-bg: #ffffff;
    --bs-header-item-color: #3d4b57;
    --bs-footer-bg: #ffffff;
    --bs-navbar-brand-box-bg: #051924;
    --bs-box-shadow: 0 1px 2px rgba(5, 25, 36, 0.04);

    --lcs-surface: #ffffff;
    --lcs-muted: #6b7a88;
    --lcs-line: #e1e7ed;
}

/* --------------------------------------------------------------------------
   3. Bootstrap/template variables - dark theme (derived from the brand navy)
   -------------------------------------------------------------------------- */
[data-bs-theme=dark] {
    --bs-primary: #2a9bd8;
    --bs-primary-rgb: 42, 155, 216;
    --bs-purple: #2a9bd8;
    --bs-purple-rgb: 42, 155, 216;
    --bs-primary-text-emphasis: #7cc3ea;
    --bs-primary-bg-subtle: #0b3047;
    --bs-primary-border-subtle: #0e4a6e;
    --bs-link-color: #4fb0e3;
    --bs-link-color-rgb: 79, 176, 227;
    --bs-link-hover-color: #7cc3ea;
    --bs-link-hover-color-rgb: 124, 195, 234;
    --bs-focus-ring-color: rgba(42, 155, 216, 0.3);

    --bs-body-bg: #061721;
    --bs-body-color: #b4c0ca;
    --bs-heading-color: #eef3f7;
    --bs-secondary-bg: #0b2230;
    --bs-tertiary-bg: #0f2b3c;
    --bs-border-color: #17394f;
    --bs-border-color-translucent: #17394f;

    --bs-header-bg: #0b2230;
    --bs-header-item-color: #b4c0ca;
    --bs-footer-bg: #0b2230;
    --bs-navbar-brand-box-bg: #051924;
    --bs-box-shadow: none;

    --lcs-surface: #0b2230;
    --lcs-muted: #8497a6;
    --lcs-line: #17394f;
}

/* Side menu: brand navy in both themes */
:root [data-sidebar=dark],
[data-bs-theme=light] [data-sidebar=dark],
[data-bs-theme=dark] [data-sidebar=dark],
[data-bs-theme=dark][data-sidebar=dark],
body[data-sidebar=dark] {
    --bs-sidebar-dark-bg: #051924;
    --bs-sidebar-dark-menu-item-color: #9fb3c2;
    --bs-sidebar-dark-menu-sub-item-color: #9fb3c2;
    --bs-sidebar-dark-menu-item-icon-color: #6f8a9c;
    --bs-sidebar-dark-menu-item-hover-color: #ffffff;
    --bs-sidebar-dark-menu-item-active-color: #ffffff;
    --bs-sidebar-dark-menu-item-active-bg-color: #0d3550;
    --bs-sidebar-dark-menu-sub-item-line-color: #17394f;
    --bs-sidebar-bg: #051924;
    --bs-sidebar-border-color: #0a2535;
}

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--bs-heading-color);
    letter-spacing: -0.01em;
}

a { text-decoration: none; }

/* --------------------------------------------------------------------------
   5. Components with a fixed colour in the template (default blue -> LCS blue)
   -------------------------------------------------------------------------- */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--lcs-blue);
    --bs-btn-border-color: var(--lcs-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--lcs-blue-hover);
    --bs-btn-hover-border-color: var(--lcs-blue-hover);
    --bs-btn-focus-shadow-rgb: 9, 123, 186;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--lcs-blue-active);
    --bs-btn-active-border-color: var(--lcs-blue-active);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--lcs-blue);
    --bs-btn-disabled-border-color: var(--lcs-blue);
    color: #fff;
    background-color: var(--lcs-blue);
    border-color: var(--lcs-blue);
}
.btn-primary:hover, .btn-primary:focus {
    color: #fff;
    background-color: var(--lcs-blue-hover);
    border-color: var(--lcs-blue-hover);
}
.btn-primary:active, .btn-primary.active {
    background-color: var(--lcs-blue-active);
    border-color: var(--lcs-blue-active);
}
[data-bs-theme=dark] .btn-primary {
    --bs-btn-bg: #1b8ccc;
    --bs-btn-border-color: #1b8ccc;
    background-color: #1b8ccc;
    border-color: #1b8ccc;
}
[data-bs-theme=dark] .btn-primary:hover { background-color: #2a9bd8; border-color: #2a9bd8; }

.btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: var(--lcs-blue-active);
    --bs-btn-active-border-color: var(--lcs-blue-active);
    --bs-btn-disabled-color: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
}

.btn-soft-primary { color: var(--bs-primary); background-color: var(--bs-primary-bg-subtle); border-color: transparent; }

.form-check-input:checked,
.form-check-input[type=checkbox]:indeterminate {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.form-switch .form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); }
.progress { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }

/* --------------------------------------------------------------------------
   6. Cards, forms and tables
   -------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--lcs-line);
    border-radius: var(--lcs-radius);
    box-shadow: 0 1px 2px rgba(5, 25, 36, 0.04);
    margin-bottom: 0;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--lcs-line);
    padding: 1rem 1.5rem;
}
.card-header .card-title { margin: 0; font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.5rem; }
.card-footer {
    background: transparent;
    border-top: 1px solid var(--lcs-line);
    padding: 1rem 1.5rem;
}

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--bs-heading-color);
    margin-bottom: 0.4rem;
}
.form-control, .form-select {
    min-height: 42px;
    border-color: var(--lcs-line);
    border-radius: 8px;
    font-size: 0.875rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15);
}
.form-text { color: var(--lcs-muted); font-size: 0.75rem; }
.btn { border-radius: 8px; font-weight: 500; }
.btn:not(.btn-sm):not(.btn-lg):not(.header-item):not(.btn-link):not(.btn-close) { padding: 0.55rem 1.1rem; }

/* --------------------------------------------------------------------------
   7. Structure: top bar, side menu, content and footer
   -------------------------------------------------------------------------- */
body[data-bs-theme=light] #page-topbar,
body[data-bs-theme=dark] #page-topbar {
    background-color: var(--lcs-surface);
    border-bottom: 1px solid var(--lcs-line);
    box-shadow: none;
}
#page-topbar .header-item { color: var(--bs-header-item-color); }
#page-topbar .header-item:hover { color: var(--bs-primary); }

.vertical-menu { background: #051924; border-right: 0; box-shadow: none; }
.vertical-menu .navbar-brand-box { background: #051924; border-bottom: 1px solid #0a2535; }
.vertical-menu .vertical-menu-btn { color: #9fb3c2; }
.vertical-menu .vertical-menu-btn:hover { color: #fff; }

#sidebar-menu .menu-title {
    color: #5f7a8c;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
#sidebar-menu ul li a { color: #9fb3c2; font-weight: 500; border-radius: 8px; }
#sidebar-menu ul li a .nav-icon { color: #6f8a9c; fill: #6f8a9c; }
#sidebar-menu ul li a:hover,
#sidebar-menu ul li a:hover .nav-icon { color: #ffffff; fill: #ffffff; }
#sidebar-menu ul li.mm-active > a,
#sidebar-menu ul li a.active,
#sidebar-menu ul li.mm-active > a .nav-icon,
#sidebar-menu ul li a.active .nav-icon {
    color: #ffffff;
    fill: #ffffff;
}
#sidebar-menu ul li a.active { background-color: #0d3550; box-shadow: inset 3px 0 0 var(--lcs-blue); }
#sidebar-menu .sub-menu li a { color: #9fb3c2; }
#sidebar-menu .sub-menu li a:hover, #sidebar-menu .sub-menu li a.active { color: #ffffff; }

/* Content height/spacing.
   The template pins min-height in px (1200/1570px) when the menu is collapsed ("sm");
   that produced a scroll bar with no content. Here the height follows the window again. */
body[data-sidebar][data-sidebar-size],
body[data-sidebar-size] { min-height: 0; }
body[data-sidebar][data-sidebar-size] .main-content,
.main-content { min-height: 100vh; }
body[data-bs-theme][data-topbar] .page-content { padding: 96px 24px 72px 24px; }
@media (max-width: 767.98px) {
    body[data-bs-theme][data-topbar] .page-content { padding: 88px 16px 72px 16px; }
}
.footer { background: var(--bs-footer-bg); border-top: 1px solid var(--lcs-line); box-shadow: none; color: var(--lcs-muted); font-size: 0.8125rem; }

/* Theme: toggle */
.theme-icon-dark { display: none; }
body[data-bs-theme=dark] .theme-icon-light { display: none; }
body[data-bs-theme=dark] .theme-icon-dark { display: inline-block; }

/* --------------------------------------------------------------------------
   8. Reusable LCS components
   -------------------------------------------------------------------------- */

/* Page header (Components/Shared/PageHeader.razor) */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-header-title { font-size: 1.375rem; font-weight: 700; margin: 0; }
.page-header-subtitle { margin: 0.25rem 0 0; color: var(--lcs-muted); font-size: 0.875rem; }
.page-header .breadcrumb { margin: 0; font-size: 0.8125rem; }
.page-header .breadcrumb-item + .breadcrumb-item::before { content: "/"; }
.page-header .breadcrumb-item.active { color: var(--lcs-muted); }

/* Avatar with initials */
.lcs-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--lcs-blue);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}
.lcs-avatar-lg { width: 80px; height: 80px; font-size: 1.75rem; }

/* Data list (label / value) */
.lcs-data-label {
    display: block;
    color: var(--lcs-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}
.lcs-data-value { color: var(--bs-heading-color); font-weight: 500; margin: 0; }

/* Cards whose action footer always sits at the bottom (equal heights side by side) */
.card-flex { display: flex; flex-direction: column; height: 100%; }
.card-flex .card-body { flex: 1 1 auto; }

/* --------------------------------------------------------------------------
   9. Authentication (Components/Layout/AuthLayout.razor)
   -------------------------------------------------------------------------- */
.lcs-auth { display: flex; min-height: 100vh; background: var(--bs-body-bg); }

.lcs-auth-brand {
    position: relative;
    flex: 0 0 46%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background:
        radial-gradient(900px 500px at 20% 10%, rgba(9, 123, 186, 0.28), transparent 60%),
        radial-gradient(700px 500px at 100% 100%, rgba(9, 123, 186, 0.16), transparent 55%),
        #051924;
}
.lcs-auth-brand img { width: min(420px, 70%); height: auto; }
.lcs-auth-brand-footer {
    position: absolute;
    left: 0; right: 0; bottom: 2rem;
    text-align: center;
    color: #5f7a8c;
    font-size: 0.8125rem;
}
@media (min-width: 992px) { .lcs-auth-brand { display: flex; } }

.lcs-auth-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--lcs-surface);
}
.lcs-auth-content { width: 100%; max-width: 400px; margin: auto 0; }
.lcs-auth-mobile-logo { display: block; height: 56px; margin: 0 auto 2rem; }
@media (min-width: 992px) { .lcs-auth-mobile-logo { display: none; } }
.lcs-auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.35rem; }
.lcs-auth-subtitle { color: var(--lcs-muted); margin-bottom: 2rem; }
.lcs-auth-footer { color: var(--lcs-muted); font-size: 0.8125rem; text-align: center; margin: 2rem 0 0; }
.lcs-auth-panel .form-control { min-height: 46px; }
.lcs-auth-panel .btn-primary { min-height: 46px; }

/* Programmatic focus (FocusOnNavigate) without an outline on headings */
h1:focus { outline: none; }
.navbar-brand-box .logo img { vertical-align: middle; }

.lcs-avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.page-header-side { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
@media (max-width: 575.98px) {
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-header-side { width: 100%; justify-content: space-between; }
    .card-body, .card-header, .card-footer { padding-left: 1rem; padding-right: 1rem; }
}
.modal.show.d-block { overflow-y: auto; }

.badge { font-size: 0.75rem; font-weight: 500; padding: 0.4em 0.75em; }


/* Inactive users */
.lcs-row-inactive td { color: var(--lcs-muted); }
.lcs-row-inactive .lcs-avatar { background: var(--lcs-gray); }

/* Notifications and confirmations (template SweetAlert2) in the LCS identity */
.swal2-container.swal2-top-end { padding-top: 84px; }
.swal2-popup { font-family: var(--bs-body-font-family); border-radius: var(--lcs-radius); }
.swal2-popup.swal2-toast { box-shadow: 0 6px 24px rgba(5, 25, 36, 0.18); }
.swal2-title { font-family: "Montserrat", sans-serif; color: var(--bs-heading-color); }
body[data-bs-theme=dark] .swal2-popup { background: var(--lcs-surface); color: var(--bs-body-color); }
body[data-bs-theme=dark] .swal2-title, body[data-bs-theme=dark] .swal2-html-container { color: var(--bs-body-color); }
.swal2-actions .btn { min-width: 110px; }
.swal2-popup .swal2-title { font-size: 1.25rem; font-weight: 600; }
.swal2-popup.swal2-toast .swal2-title { font-size: 0.875rem; font-weight: 500; margin: 0.5rem; text-align: left; }
.swal2-popup .swal2-html-container { font-size: 0.9rem; }

/* Below the desktop breakpoint the side menu stays closed until the hamburger button opens it: the template script sets
   an inline display:block on load, which would otherwise keep it open over the page content. */
@media (max-width: 991.98px) {
    .vertical-menu { display: none !important; }
    body.sidebar-enable .vertical-menu { display: block !important; }
}
