/*
 * 2H identity from the static app (static-project/assets/app.css): navy
 * sidebar with gold accents, light page background, its card, table, field
 * and button sizes. Plain CSS over Filament's classes (no build step),
 * registered with FilamentAsset in AppServiceProvider.
 */

:root {
    --h-navy: #1a3a5c;
    --h-navy-2: #24496f;
    --h-navy-3: #0f2740;
    --h-navy-soft: #eaf1f8;
    --h-gold: #f5a623;
    --h-gold-2: #d98e10;
    --h-gold-soft: #fef4e2;
    --h-bg: #f4f6f9;
    --h-line: #dde3ea;
    --h-line-2: #eef1f5;
    --h-text: #1c2733;
    --h-muted: #66768a;
    --h-side-text: #d7e2ee;
    --h-side-group: #8fa8c2;
    --h-radius: 8px;
    --h-shadow: 0 1px 2px rgb(16 32 48 / 0.06), 0 2px 8px rgb(16 32 48 / 0.05);
}

/* ===== Scale: the static app is denser (14px text, 13px tables, 20px titles);
   Filament is sized in rem, so a 15px root brings it to the same density. ===== */
html {
    font-size: 15px;
}

/* ===== Page ===== */
.fi-body {
    background: var(--h-bg);
    color: var(--h-text);
    font-size: 14px;
}

.dark .fi-body {
    background: var(--gray-950);
    color: var(--gray-100);
}

/* ===== Sidebar: navy, gold bar under the brand, gold mark on the active item ===== */
.fi-body .fi-sidebar,
.fi-body .fi-sidebar.fi-main-sidebar {
    background: var(--h-navy) !important;
    color: var(--h-side-text);
}

.dark .fi-body .fi-sidebar {
    background: var(--h-navy-3) !important;
}

.fi-sidebar .fi-sidebar-header {
    background: var(--h-navy-3);
    border-bottom: 3px solid var(--h-gold);
    box-shadow: none;
    --tw-ring-shadow: 0 0 #0000;
}

.fi-sidebar .fi-sidebar-header .fi-logo {
    background: #fff;
    border-radius: 6px;
    padding: 2px 6px;
}

.fi-sidebar .fi-sidebar-header button,
.fi-sidebar .fi-sidebar-header .fi-icon-btn {
    color: var(--h-side-text);
}

.fi-sidebar .fi-sidebar-nav {
    padding-top: 0.5rem;
}

.fi-sidebar .fi-sidebar-group-label {
    color: var(--h-side-group);
    font-size: 11.5px;
    font-weight: 600;
}

.fi-sidebar .fi-sidebar-group-collapse-btn,
.fi-sidebar .fi-sidebar-group-btn .fi-icon {
    color: var(--h-side-group);
}

.fi-sidebar .fi-sidebar-item-btn {
    border-radius: 0;
    border-inline-start: 3px solid transparent;
    margin-inline: calc(var(--spacing, 0.25rem) * -4);
    padding-inline: 1.15rem;
}

.fi-sidebar .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item-icon {
    color: var(--h-side-text) !important;
}

.fi-sidebar .fi-sidebar-item-btn:hover,
.fi-sidebar .fi-sidebar-item-btn:focus-visible {
    background: var(--h-navy-2) !important;
}

.fi-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-icon {
    color: #fff !important;
}

.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--h-navy-2) !important;
    border-inline-start-color: var(--h-gold);
}

.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label {
    color: #fff !important;
    font-weight: 600;
}

.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon {
    color: var(--h-gold) !important;
}

.fi-sidebar .fi-sidebar-item-grouped-border-part {
    background: rgb(255 255 255 / 0.2);
}

.fi-sidebar .fi-sidebar-footer,
.fi-sidebar .fi-sidebar-database-notifications-btn {
    color: var(--h-side-text);
}

.fi-sidebar ::-webkit-scrollbar {
    width: 6px;
}

.fi-sidebar ::-webkit-scrollbar-thumb {
    background: rgb(255 255 255 / 0.2);
    border-radius: 3px;
}

/* ===== Brand block: Filament 5 puts the logo in the topbar; on desktop its start
   becomes the static «.side .brand» — navy, as wide as the sidebar, gold bar below. ===== */
@media (min-width: 64rem) {
    .fi-topbar .fi-topbar-start {
        align-self: stretch;
        width: var(--sidebar-width);
        margin-inline-start: -15px;
        margin-inline-end: 1rem;
        padding-inline: 1rem;
        background: var(--h-navy-3);
        border-bottom: 3px solid var(--h-gold);
        gap: 0.6rem;
    }

    .fi-topbar .fi-topbar-start .fi-icon-btn {
        color: var(--h-side-text);
    }

    .fi-topbar .fi-topbar-start .fi-icon-btn:hover {
        background: var(--h-navy-2);
        color: #fff;
    }

    .fi-topbar .fi-topbar-start .fi-logo {
        background: #fff;
        border-radius: 6px;
        padding: 2px 6px;
        height: 2.6rem !important;
    }

    .fi-topbar .fi-topbar-start a::after {
        content: "2H ERP";
        color: #fff;
        font-weight: 700;
        font-size: 15px;
        margin-inline-start: 0.6rem;
    }

    .fi-topbar .fi-topbar-start a {
        display: flex;
        align-items: center;
    }

    /* Collapsed sidebar: the brand block shrinks with it (static #app.collapsed). */
    .fi-body:has(.fi-main-sidebar:not(.fi-sidebar-open)) .fi-topbar .fi-topbar-start {
        width: 4.5rem;
        justify-content: center;
    }

    .fi-body:has(.fi-main-sidebar:not(.fi-sidebar-open)) .fi-topbar .fi-topbar-start a {
        display: none;
    }
}

/* ===== Topbar ===== */
.fi-topbar > nav,
.fi-topbar {
    background: #fff;
    box-shadow: none;
    border-bottom: 1px solid var(--h-line);
}

.dark .fi-topbar > nav,
.dark .fi-topbar {
    background: var(--gray-900);
    border-color: rgb(255 255 255 / 0.1);
}

/* ===== Page header ===== */
.fi-header-heading {
    color: var(--h-navy);
    font-size: 1.35rem;
    font-weight: 700;
}

.dark .fi-header-heading {
    color: #fff;
}

.fi-header-subheading {
    color: var(--h-muted);
    font-size: 0.875rem;
}

/* ===== Cards (sections, tables, widgets) ===== */
.fi-section:not(.fi-section-not-contained),
.fi-ta-ctn,
.fi-wi-stats-overview-stat {
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
    --tw-ring-color: var(--h-line);
}

.fi-section-header-heading {
    color: var(--h-navy);
    font-weight: 700;
}

.dark .fi-section-header-heading {
    color: #fff;
}

.fi-section:not(.fi-section-not-contained) > .fi-section-header {
    border-bottom: 2px solid var(--h-gold-soft);
}

.dark .fi-section:not(.fi-section-not-contained) > .fi-section-header {
    border-bottom-color: rgb(245 166 35 / 0.2);
}

/* ===== Dashboard stats: a 3px strip on top, gold and navy in turn (static .kpi) ===== */
.fi-wi-stats-overview-stat {
    border-top: 3px solid var(--h-navy);
}

.fi-wi-stats-overview-stat:nth-child(odd) {
    border-top-color: var(--h-gold);
}

.fi-wi-stats-overview-stat-value {
    color: var(--h-navy);
}

.dark .fi-wi-stats-overview-stat-value {
    color: #fff;
}

/* ===== Tables: light header, navy bold titles ===== */
.fi-ta-header-cell {
    background: #f7f9fb;
    color: var(--h-navy);
    font-weight: 700;
    border-bottom: 2px solid var(--h-line);
}

.fi-ta-header-cell .fi-ta-header-cell-sort-btn,
.fi-ta-header-cell span {
    color: var(--h-navy);
    font-weight: 700;
}

.dark .fi-ta-header-cell {
    background: var(--gray-800);
    border-color: rgb(255 255 255 / 0.1);
}

.dark .fi-ta-header-cell,
.dark .fi-ta-header-cell .fi-ta-header-cell-sort-btn,
.dark .fi-ta-header-cell span {
    color: var(--gray-200);
}

.fi-ta-row:hover > .fi-ta-cell {
    background: #f8fafc;
}

.dark .fi-ta-row:hover > .fi-ta-cell {
    background: rgb(255 255 255 / 0.03);
}

/* ===== Buttons: old sizes; gold buttons with dark text like «.btn.gold» ===== */
.fi-btn {
    border-radius: 6px;
    font-weight: 600;
}

.fi-btn.fi-color-warning:not(.fi-outlined) {
    background: var(--h-gold);
    color: #1c1c1c;
}

.fi-btn.fi-color-warning:not(.fi-outlined) .fi-icon {
    color: #1c1c1c;
}

.fi-btn.fi-color-warning:not(.fi-outlined):hover {
    background: var(--h-gold-2);
}

/* Primary buttons in navy with white text, like «.btn.pri» */
.fi-btn.fi-color-primary:not(.fi-outlined) {
    background: var(--h-navy);
    color: #fff;
}

.fi-btn.fi-color-primary:not(.fi-outlined) .fi-icon {
    color: #fff;
}

.fi-btn.fi-color-primary:not(.fi-outlined):hover {
    background: var(--h-navy-2);
}

.dark .fi-btn.fi-color-primary:not(.fi-outlined) {
    background: var(--h-navy-2);
}

/* ===== Fields: focus ring in navy ===== */
.fi-input-wrp {
    border-radius: 6px;
}

.fi-input-wrp:focus-within {
    --tw-ring-color: var(--h-navy);
}

/* ===== Badges a little rounder, like the static app ===== */
.fi-badge {
    border-radius: 10px;
}

/* ===== Login (static login screen): navy gradient, white card, gold rule under the heading ===== */
.fi-simple-layout {
    background: linear-gradient(160deg, var(--h-navy-3) 0%, var(--h-navy) 55%, var(--h-navy-2) 100%);
}

.fi-simple-main {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgb(0 0 0 / 0.25);
    --tw-ring-shadow: 0 0 #0000;
    max-width: 32rem;
    padding: 2.25rem 2rem 2rem;
}

.dark .fi-simple-main {
    background: var(--gray-900);
}

.fi-simple-header {
    border-bottom: 3px solid var(--h-gold);
    margin-inline: -2rem;
    padding: 0 2rem 1.25rem;
}

.fi-simple-header .fi-logo {
    height: 4rem !important;
}

.fi-simple-header-heading {
    color: var(--h-navy);
    font-size: 1.35rem;
    font-weight: 700;
}

.dark .fi-simple-header-heading {
    color: #fff;
}

.fi-simple-header-subheading {
    color: var(--h-muted);
    font-size: 0.95rem;
}

.fi-simple-main .fi-btn {
    min-height: 2.9rem;
    font-size: 1rem;
}

