/*
 * Project overrides for the Metronic admin theme.
 * Loaded AFTER style.bundle.css in resources/views/admin/layouts/includes/css.blade.php,
 * so plain declarations here win without needing !important.
 *
 * Keep this file small and justify every rule — it is the one place that
 * diverges from the vendor theme, so anything unexplained here is a trap
 * for whoever upgrades the bundle.
 */

/*
 * The theme ships .form-check-label at --bs-gray-500 (#99A1B7). On white that
 * is a 2.58:1 contrast ratio, which fails WCAG AA for body text (4.5:1) — the
 * owner reported radio labels on Site Settings as unreadable. --bs-gray-800
 * (#252F4A) measures 13.26:1.
 *
 * Scoped away from the disabled state: the theme dims those with a separate
 * `opacity: .5` rule on `.form-check-input:disabled ~ .form-check-label`,
 * and that dimming must survive — a disabled option should still look disabled.
 */
.form-check-label {
    color: var(--bs-gray-800);
}

/*
 * The theme ships .text-muted at --bs-text-muted / --bs-secondary-color (#99A1B7):
 * 2.58:1 on white, which fails WCAG AA for body text (4.5:1). It is used 89 times
 * across 32 admin views — help text, timestamps, secondary links — so this is not a
 * one-page problem, and the owner reported it on four separate screens before we
 * traced it here. --bs-gray-700 (#4B5675) measures 7.27:1 and is still clearly
 * secondary against body text (#071437), so the visual hierarchy survives.
 */
.text-muted {
    color: var(--bs-gray-700) !important;
}

/*
 * Metronic has no cursor utility; the disabled strategy card needs one so the
 * pointer says "not selectable" where opacity used to.
 */
.cursor-not-allowed,
.cursor-not-allowed * {
    cursor: not-allowed;
}

/* ── NGYNN Clean theme ──────────────────────────────────────────────────────
 *
 * Palette and contrast (WCAG ratio measured for every pair used as text):
 *   white on leaf #23802A 5.01, white on leaf dark #1B6621 7.07,
 *   water #0B66BC on white 5.77 / on water tint #E3F0FB 4.98 / on #F3F7FA 5.35,
 *   leaf dark #1B6621 on leaf tint #E5F4DC 6.17 (leaf itself is only 4.37 there),
 *   muted #52637A on white 6.13, body #3D4F68 on #F3F7FA 7.75,
 *   white on navy #032F68 13.04, #C9DBEF on navy 9.23, sprout #7ACB0A on navy 6.44.
 *
 * The theme reads its colours from custom properties, so most of the reskin is
 * re-declaring those rather than out-ranking vendor selectors.
 */
:root,
[data-bs-theme="light"] {
    --ngynn-navy: #032F68;
    --ngynn-navy-deep: #021F47;
    --ngynn-navy-raised: #0A3F87;
    --ngynn-leaf: #23802A;
    --ngynn-leaf-dark: #1B6621;
    --ngynn-water: #0B66BC;
    --ngynn-sprout: #7ACB0A;

    --bs-font-sans-serif: Figtree, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-family: Figtree, "Helvetica Neue", Arial, sans-serif;
    --bs-body-color: #0A1F3C;
    --bs-app-bg-color: #F3F7FA;
    --bs-border-color: #DCE6EE;

    --bs-primary: #23802A;
    --bs-primary-rgb: 35, 128, 42;
    --bs-primary-active: #1B6621;
    --bs-primary-light: #E5F4DC;
    --bs-primary-inverse: #FFFFFF;
    --bs-primary-clarity: rgba(35, 128, 42, 0.2);
    --bs-component-active-bg: #23802A;

    /* The vendor green is 2.27:1 under the white text of .btn-success. */
    --bs-success: #23802A;
    --bs-success-rgb: 35, 128, 42;
    --bs-success-active: #1B6621;
    --bs-success-light: #E5F4DC;
    --bs-text-success: #1B6621;

    /* Vendor red is 3.86:1 both as text on white and under white button text. */
    --bs-danger: #C4123F;
    --bs-danger-rgb: 196, 18, 63;
    --bs-danger-active: #9F0E33;
    --bs-text-danger: #C4123F;

    --bs-link-color: #0B66BC;
    --bs-link-color-rgb: 11, 102, 188;
    --bs-link-hover-color: #032F68;
    --bs-link-hover-color-rgb: 3, 47, 104;
    --bs-text-primary: #0B66BC;
    --bs-menu-link-color-hover: #0B66BC;
    --bs-menu-link-color-show: #0B66BC;
    --bs-menu-link-color-here: #0B66BC;
    --bs-menu-link-color-active: #0B66BC;
}

/* Custom properties are not re-read by rules the bundle compiled to a literal. */
body {
    font-family: Figtree, "Helvetica Neue", Arial, sans-serif;
}

h1,
h2,
.page-heading,
.card-title h3 {
    font-family: Montserrat, Arial, sans-serif;
    letter-spacing: -0.01em;
}

/* Text links are water; only actions are leaf. Utility uses !important in the bundle. */
.link-primary,
.text-hover-primary:hover {
    color: var(--ngynn-water) !important;
}

.link-primary:hover {
    color: var(--ngynn-navy) !important;
}

/* Text on the green tint needs the darker leaf: #23802A there is 4.37:1. */
.badge-light-primary,
.badge-light-success,
.alert-success,
.alert-primary,
.alert-primary div,
.alert-primary span,
.btn.btn-light-primary,
.btn.btn-light-success,
.btn.btn-light-primary i,
.btn.btn-light-success i {
    color: var(--ngynn-leaf-dark);
}

.btn.btn-light-primary:hover:not(.btn-active),
.btn.btn-light-success:hover:not(.btn-active),
.btn.btn-light-primary:hover:not(.btn-active) i,
.btn.btn-light-success:hover:not(.btn-active) i {
    color: #FFFFFF;
}

/* Same defect as .text-muted above, under other names: the theme's grey text steps are
 * 2.58:1 (500) and 3.83:1 (600) on white, and labels, hints and placeholders use them. */
.text-gray-400,
.text-gray-500,
.text-gray-600,
.form-control::placeholder,
.select2-container--bootstrap5 .select2-selection__placeholder,
.form-text,
.menu-heading,
.breadcrumb-item,
.table > thead .text-muted,
.table:not(.table-dark) > thead > tr > th {
    color: #52637A !important;
}

/* Vendor amber text is 1.58:1 on its own tint; #8A5A00 is 5.57:1. */
.badge-light-warning,
.alert-warning,
.text-warning,
.btn.btn-light-warning:not(:hover) {
    color: #8A5A00 !important;
}

.nav-line-tabs .nav-item .nav-link:not(.active) {
    color: #52637A;
}

.nav-line-tabs .nav-item .nav-link.active {
    color: var(--ngynn-leaf-dark) !important;
    border-bottom-color: var(--ngynn-leaf) !important;
}

/* Primary actions are flat pills. Icon-only buttons keep their own shape. */
.btn.btn-primary:not(.btn-icon),
.btn.btn-success:not(.btn-icon),
.btn.btn-light-primary:not(.btn-icon) {
    border-radius: 999px;
}

/* Leaf corner: large on top-left and bottom-right, small on the other two. */
.card,
.modal-content {
    border-radius: 26px 6px 26px 6px;
}

.card > .card-header:first-child {
    border-radius: 26px 6px 0 0;
}

.form-control,
.form-select {
    border-radius: 12px 3px 12px 3px;
}

/* Input groups butt several controls together, so the leaf corner would gap. */
.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text {
    border-radius: 3px;
}

/* A visible keyboard focus ring; the theme removes the outline on buttons and links. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.menu-link:focus-visible {
    outline: 3px solid var(--ngynn-water);
    outline-offset: 2px;
}

.app-sidebar a:focus-visible,
.app-sidebar button:focus-visible,
.app-sidebar .menu-link:focus-visible {
    outline-color: var(--ngynn-sprout);
    outline-offset: -3px;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
[data-kt-app-layout=dark-sidebar] .app-sidebar {
    background-color: var(--ngynn-navy);
    border-right: 0;
}

[data-kt-app-layout=dark-sidebar] .app-sidebar .app-sidebar-logo {
    background-color: var(--ngynn-navy-deep);
    border-bottom: 0;
    border-radius: 0 0 0 44px;
}

.app-sidebar-logo .app-sidebar-logo-default {
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link .menu-title,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link .menu-icon,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link .menu-icon i {
    color: #C9DBEF;
}

[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link .menu-arrow:after {
    background-color: #C9DBEF;
}

[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item.here > .menu-link,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item.here > .menu-link .menu-title,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link:hover,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link:hover .menu-title,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link.active,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link.active .menu-title {
    color: #FFFFFF;
}

/* The current page is marked by fill, corner and a sprout icon, not by colour alone. */
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link.active {
    background-color: var(--ngynn-navy-raised);
    border-radius: 12px 3px 12px 3px;
}

[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link.active .menu-icon,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link.active .menu-icon i,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item.here > .menu-link .menu-icon,
[data-kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item.here > .menu-link .menu-icon i {
    color: var(--ngynn-sprout);
}

/* .text-muted above is tuned for white and would vanish on navy. */
.app-sidebar .text-muted {
    color: #C9DBEF !important;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.app-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid #DCE6EE;
}

.page-heading {
    color: var(--ngynn-navy) !important;
}

/* ── Sign-in pages (brand/artboards/AdminLogin) ──────────────────────────── */
.ngynn-auth {
    background: #FFFFFF;
    color: #0A1F3C;
}

.ngynn-auth__shell {
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
}

.ngynn-auth__brand {
    flex: 1 1 420px;
    min-height: 260px;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ngynn-navy);
    border-radius: 0 0 120px 0;
}

.ngynn-auth__logo {
    width: 100%;
    max-width: 320px;
    max-height: 340px;
    object-fit: contain;
}

.ngynn-auth__main {
    flex: 1 1 420px;
    min-width: 0;
    padding: 48px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ngynn-auth__form {
    width: 100%;
    max-width: 400px;
}

.ngynn-auth__title {
    color: var(--ngynn-navy);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ngynn-auth__label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
}

/* #7C8DA1 rather than the artboard's #B9C8D6: a field boundary needs 3:1
 * (WCAG 1.4.11) and the artboard's is 1.71:1. */
.ngynn-auth__input.form-control {
    height: 52px;
    padding: 0 16px;
    border: 1px solid #7C8DA1;
    border-radius: 16px 4px 16px 4px;
    font-size: 16px;
    font-weight: 500;
    color: #0A1F3C;
}

.ngynn-auth__input.form-control::placeholder {
    color: #52637A;
}

.ngynn-auth__input.form-control:focus {
    border-color: var(--ngynn-water);
    box-shadow: 0 0 0 3px #E3F0FB;
}

.ngynn-auth__input.form-control.is-invalid {
    border-color: var(--bs-danger);
}

/* Icons and boxes a person has to find need 3:1 as well. */
.ngynn-auth [data-kt-password-meter-control] i {
    color: #52637A;
}

.ngynn-auth .form-check-input:not(:checked) {
    background-color: #FFFFFF;
    border: 1px solid #7C8DA1;
}

/* Room for the show/hide password icon, which sits on top of the field. */
.position-relative > .ngynn-auth__input.form-control {
    padding-right: 56px;
}

.ngynn-auth__submit.btn {
    height: 56px;
    font-size: 17px;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .ngynn-auth__brand {
        min-height: 200px;
        border-radius: 0 0 72px 0;
    }

    .ngynn-auth__logo {
        max-width: 200px;
    }
}
