:root {
    --hdb-green: #006B3A;
    --hdb-green-700: #075F3A;
    --hdb-green-dark: #004D2A;
    --hdb-green-accent: #1D9846;
    --hdb-gold: #E3A43A;
    --hdb-gold-soft: #F7E7C3;
    --hdb-red: #9B1429;
    --hdb-bg: #F8FAFC;
    --hdb-surface: #FFFFFF;
    --hdb-text: #1F2937;
    --hdb-muted: #64748B;
    --hdb-border: rgba(15, 23, 42, 0.10);
}

body {
    background:
        radial-gradient(circle at top right, rgba(227, 164, 58, 0.10), transparent 30rem),
        linear-gradient(135deg, #f8fafc 0%, #eef6f1 48%, #f8fafc 100%);
}

.fi-logo {
    width: auto;
    max-width: 13rem;
    object-fit: contain;
}

/* Login */
.fi-simple-layout {
    position: relative;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        linear-gradient(115deg, rgba(0, 77, 42, 0.90), rgba(0, 77, 42, 0.72) 42%, rgba(15, 23, 42, 0.82)),
        url("/frontend/images/hero/hero-frontis-1.jpg") center / cover no-repeat;
}

.fi-simple-layout::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 26%, rgba(227, 164, 58, 0.24), transparent 18rem),
        linear-gradient(90deg, rgba(0, 61, 35, 0.48), rgba(0, 0, 0, 0.20));
    pointer-events: none;
}

.fi-simple-layout::after {
    content: "";
    position: absolute;
    inset: clamp(1rem, 2.5vw, 2rem);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 2rem;
    pointer-events: none;
}

.fi-simple-main-ctn {
    position: relative;
    z-index: 1;
    display: grid;
    box-sizing: border-box;
    width: min(100%, 76rem);
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 28rem);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 4rem);
    margin-inline: auto;
    padding: clamp(1rem, 4vw, 4rem);
}

.fi-simple-main-ctn::before {
    content: "";
    justify-self: center;
    align-self: center;
    width: clamp(12rem, 30vw, 22rem);
    aspect-ratio: 1;
    background: url("/frontend/images/logo_redondeado.svg") center / contain no-repeat;
    filter: drop-shadow(0 22px 46px rgba(0, 0, 0, 0.30));
}

.fi-simple-main-ctn::after {
    content: none;
}

.fi-simple-main {
    width: min(100%, 28rem);
    justify-self: center;
    align-self: center;
}

.fi-simple-page {
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 80px rgba(0, 40, 22, 0.34);
    backdrop-filter: blur(18px);
}

.fi-simple-page-content {
    padding: clamp(1.35rem, 3vw, 2.15rem);
}

.fi-simple-page .fi-logo {
    display: none;
}

.fi-simple-page h1,
.fi-simple-page .fi-header-heading {
    color: var(--hdb-green-dark);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.fi-simple-page .fi-header-subheading {
    color: var(--hdb-muted);
}

.fi-simple-page form {
    margin-top: 1.35rem;
}

.fi-simple-page .fi-input-wrp {
    border-radius: 0.95rem;
    border-color: rgba(15, 23, 42, 0.14);
    background: #fff;
    color: var(--hdb-text);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.fi-simple-page .fi-input-wrp:focus-within {
    border-color: rgba(0, 107, 58, 0.62);
    box-shadow: 0 0 0 4px rgba(0, 107, 58, 0.13);
}

.fi-simple-page .fi-btn.fi-color-primary {
    min-height: 2.85rem;
    border-radius: 0.95rem;
}

/* Sidebar */
.fi-sidebar {
    display: flex;
    flex-direction: column;
    border-inline-end: 0;
    background:
        radial-gradient(circle at top left, rgba(227, 164, 58, 0.16), transparent 18rem),
        linear-gradient(180deg, #0A6B43 0%, #075C39 52%, #064B2F 100%);
    color: #fff;
    box-shadow: 18px 0 48px rgba(0, 43, 25, 0.16);
}

.fi-sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.fi-sidebar .fi-logo {
    padding: 0.28rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.fi-sidebar-nav {
    flex: 1 1 auto;
    padding-block: 1rem;
}

.fi-sidebar-group-label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.fi-sidebar-item-btn {
    border-radius: 0.9rem;
    color: rgba(255, 255, 255, 0.96);
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.fi-sidebar .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item-btn .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-item-btn .fi-sidebar-item-badge-ctn,
.fi-sidebar .fi-sidebar-group-btn .fi-icon {
    color: rgba(255, 255, 255, 0.96) !important;
}

.fi-sidebar-item-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    transform: translateX(2px);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: #F7E7C3;
    color: #123D29;
    box-shadow: inset 4px 0 0 var(--hdb-gold), 0 12px 24px rgba(0, 0, 0, 0.16);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-badge-ctn {
    color: #123D29 !important;
}

.fi-sidebar-item-icon,
.fi-sidebar-group-btn .fi-icon {
    color: currentColor;
}

.fi-sidebar .fi-icon-btn,
.fi-sidebar .fi-sidebar-group-collapse-btn {
    color: rgba(255, 255, 255, 0.92);
}

.fi-sidebar .fi-icon-btn:hover,
.fi-sidebar .fi-sidebar-group-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.hdb-sidebar-footer {
    margin: 0.75rem 1rem 1rem;
    padding: 0.85rem 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    text-align: left;
}

.hdb-sidebar-footer p {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    line-height: 1.45;
    text-transform: uppercase;
}

.hdb-sidebar-footer p:first-child {
    color: var(--hdb-gold-soft);
}

/* Internal layout */
.fi-topbar {
    border-bottom-color: rgba(0, 107, 58, 0.10);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    overflow: visible;
}

.fi-topbar-ctn {
    z-index: 70;
    overflow: visible;
}

.fi-topbar-end,
.fi-topbar .fi-user-menu {
    position: relative;
    z-index: 80;
    overflow: visible;
}

.fi-main-ctn {
    position: relative;
    background:
        radial-gradient(circle at top right, rgba(227, 164, 58, 0.10), transparent 24rem),
        linear-gradient(135deg, #f8fafc, #f3faf6);
}

.fi-main {
    position: relative;
}

.fi-main::before {
    content: "";
    position: fixed;
    right: clamp(0.5rem, 4vw, 4rem);
    bottom: clamp(1rem, 5vw, 5rem);
    z-index: 0;
    width: min(48vw, 34rem);
    aspect-ratio: 1;
    background: url("/frontend/images/Logo_completo.svg") center / contain no-repeat;
    filter: blur(2px) saturate(0.85);
    opacity: 0.065;
    pointer-events: none;
}

.fi-main > * {
    position: relative;
    z-index: 1;
}

.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-chart .fi-section {
    border-color: rgba(0, 107, 58, 0.08);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.fi-wi-stats-overview-stat {
    overflow: hidden;
}

.fi-wi-stats-overview-stat::before {
    background: linear-gradient(180deg, rgba(0, 107, 58, 0.14), rgba(227, 164, 58, 0.08));
}

.fi-wi-chart .fi-section,
.fi-wi-table .fi-section {
    min-height: 100%;
}

.fi-wi-chart-canvas-ctn {
    min-height: 16rem;
}

.fi-header-heading {
    color: var(--hdb-text);
    font-weight: 900;
    letter-spacing: -0.035em;
}

.fi-header-subheading,
.fi-ta-text,
.fi-ta-header-cell-label {
    color: var(--hdb-muted);
}

/* Buttons and actions */
.fi-btn.fi-color-primary {
    background: var(--hdb-green);
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 107, 58, 0.20);
}

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

.fi-btn.fi-color-primary:hover {
    background: var(--hdb-green-dark);
    color: #fff;
}

.fi-btn.fi-color-gray {
    border-color: rgba(15, 23, 42, 0.12);
    background: #fff;
    color: var(--hdb-text);
}

.fi-btn.fi-color-gray .fi-btn-label,
.fi-btn.fi-color-gray .fi-icon {
    color: var(--hdb-text) !important;
}

.fi-btn.fi-color-gray:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.fi-btn.fi-color-warning {
    background: #fff7e6;
    color: #6b4308;
    box-shadow: inset 0 0 0 1px rgba(227, 164, 58, 0.34);
}

.fi-btn.fi-color-warning .fi-btn-label,
.fi-btn.fi-color-warning .fi-icon {
    color: #6b4308 !important;
}

.fi-btn.fi-color-danger {
    background: var(--hdb-red);
    color: #fff;
}

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

.fi-icon-btn {
    color: var(--hdb-muted);
}

.fi-icon-btn:hover {
    color: var(--hdb-green-dark);
    background: rgba(0, 107, 58, 0.08);
}

/* Badges and status labels */
.fi-badge {
    border-radius: 999px;
    background: #f8fafc;
    color: #1f2937;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.fi-badge .fi-badge-label,
.fi-badge .fi-icon {
    color: currentColor !important;
}

.fi-badge.fi-color-primary,
.fi-badge.fi-color-info {
    background: #eef7f2;
    color: #064428;
    box-shadow: inset 0 0 0 1px rgba(0, 107, 58, 0.18);
}

.fi-badge.fi-color-success {
    background: #ecfdf3;
    color: #064e2f;
    box-shadow: inset 0 0 0 1px rgba(29, 152, 70, 0.22);
}

.fi-badge.fi-color-warning {
    background: #fff7e6;
    color: #6b4308;
    box-shadow: inset 0 0 0 1px rgba(227, 164, 58, 0.30);
}

.fi-badge.fi-color-danger {
    background: #fff1f2;
    color: #7f1022;
    box-shadow: inset 0 0 0 1px rgba(155, 20, 41, 0.22);
}

.fi-link {
    color: var(--hdb-green);
}

.fi-link:hover {
    color: var(--hdb-green-dark);
}

/* Tables, search and forms */
.fi-ta-ctn {
    overflow: hidden;
}

.fi-ta-header-toolbar,
.fi-ta-filters,
.fi-section-header {
    background: rgba(255, 255, 255, 0.92);
}

.fi-wi-table .fi-ta-header-toolbar {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.fi-wi-table .fi-ta-row {
    background: rgba(255, 255, 255, 0.98);
}

.fi-input-wrp,
.fi-select-input,
.fi-textarea {
    border-color: rgba(15, 23, 42, 0.14);
    background: #fff;
    color: var(--hdb-text);
}

.fi-input-wrp:focus-within {
    border-color: rgba(0, 107, 58, 0.55);
    box-shadow: 0 0 0 4px rgba(0, 107, 58, 0.10);
}

.fi-dropdown-panel {
    z-index: 120;
    max-height: min(28rem, calc(100dvh - 5rem));
    overflow-y: auto;
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
}

@media (max-width: 900px) {
    .fi-simple-main-ctn {
        grid-template-columns: 1fr;
        gap: 1.15rem;
        min-height: 100dvh;
        padding: 1.2rem;
    }

    .fi-simple-main-ctn::before {
        width: clamp(8rem, 38vw, 12rem);
    }

    .fi-simple-main-ctn::after {
        display: none;
    }

    .fi-simple-main {
        width: min(100%, 30rem);
        justify-self: center;
    }

    .fi-simple-page-content {
        padding: 1.25rem;
    }
}
