/* Excellency BD — Filament Admin & Portal Theme */

:root {
    --ebd-primary: #1e3a5f;
    --ebd-primary-light: #2d5a8a;
    --ebd-gold: #d4a017;
    --ebd-teal: #0d9488;
    --ebd-radius: 0.75rem;
    --ebd-shadow: 0 4px 24px -4px rgba(30, 58, 95, 0.12);
    --ebd-shadow-lg: 0 12px 40px -8px rgba(30, 58, 95, 0.18);
}

/* Ambient background */
.excellency-panel-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(13, 148, 136, 0.06), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(212, 160, 23, 0.05), transparent),
        linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.dark .excellency-panel-bg {
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(13, 148, 136, 0.08), transparent),
        linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

/* ── Login page ── */
.fi-simple-layout {
    background: transparent !important;
}

.fi-simple-main-ctn {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.fi-simple-main {
    background: transparent !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    padding: 0 !important;
    margin-block: 1rem !important;
}

@media (min-width: 640px) {
    .fi-simple-main {
        margin-block: 2rem !important;
    }
}

.fi-simple-header .fi-logo,
.fi-simple-header .fi-logo span {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}

.fi-simple-page .fi-section,
.fi-simple-page form > .grid > .fi-fo-field-wrp {
    border-radius: var(--ebd-radius);
}

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

.fi-simple-page .fi-btn-primary {
    border-radius: var(--ebd-radius) !important;
    font-weight: 600 !important;
    padding-block: 0.625rem !important;
    box-shadow: 0 4px 14px -2px rgba(30, 58, 95, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fi-simple-page .fi-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -2px rgba(30, 58, 95, 0.4);
}

/* Login card wrapper */
.excellency-login-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    box-shadow: var(--ebd-shadow-lg);
}

.dark .excellency-login-card {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(71, 85, 105, 0.5);
}

.excellency-login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.1), rgba(13, 148, 136, 0.1));
    color: var(--ebd-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.dark .excellency-login-badge {
    color: #94a3b8;
}

/* ── Sidebar ── */
.fi-sidebar {
    border-right: 1px solid rgba(148, 163, 184, 0.15) !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

.dark .fi-sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
}

.fi-sidebar-header {
    padding-block: 1.25rem !important;
}

.fi-sidebar-item-button {
    border-radius: 0.5rem !important;
    margin-inline: 0.5rem;
    transition: all 0.2s ease;
}

.fi-sidebar-item-button:hover {
    background: rgba(30, 58, 95, 0.06) !important;
}

.fi-sidebar-item-active .fi-sidebar-item-button {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.12), rgba(13, 148, 136, 0.08)) !important;
    font-weight: 600;
}

.fi-sidebar-group-label {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #94a3b8 !important;
}

/* ── Topbar ── */
.fi-topbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark .fi-topbar {
    background: rgba(15, 23, 42, 0.85) !important;
}

/* ── Main content ── */
.fi-main {
    padding-inline: clamp(0.75rem, 3vw, 1.5rem) !important;
}

.fi-page header .fi-header-heading {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}

/* ── Sections & cards ── */
.fi-section {
    border-radius: var(--ebd-radius) !important;
    box-shadow: var(--ebd-shadow) !important;
    border: 1px solid rgba(148, 163, 184, 0.12) !important;
    overflow: hidden;
}

.fi-section-header {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(241, 245, 249, 0.5));
}

.dark .fi-section-header {
    background: rgba(30, 41, 59, 0.5);
}

/* ── Tables (mobile-friendly scroll) ── */
.fi-ta-ctn {
    border-radius: var(--ebd-radius);
    overflow: hidden;
    box-shadow: var(--ebd-shadow);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.fi-ta-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fi-ta-table {
    min-width: 640px;
}

.fi-ta-header-cell {
    background: #f8fafc !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: #64748b !important;
}

.dark .fi-ta-header-cell {
    background: #1e293b !important;
}

.fi-ta-row:hover {
    background: rgba(30, 58, 95, 0.03) !important;
}

/* Table action buttons — stack on very small screens */
@media (max-width: 480px) {
    .fi-ta-actions {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .fi-ta-actions .fi-link,
    .fi-ta-actions .fi-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ── Forms ── */
.fi-fo-field-wrp label {
    font-weight: 500 !important;
}

.fi-input-wrp {
    border-radius: 0.5rem !important;
}

/* Form grids stack cleanly on mobile */
@media (max-width: 640px) {
    .fi-fo-component-ctn .grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Buttons ── */
.fi-btn {
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    transition: all 0.15s ease;
}

.fi-btn-primary:hover {
    transform: translateY(-1px);
}

.fi-btn-size-md {
    padding-inline: 1rem !important;
}

/* ── Stats widgets ── */
.fi-wi-stats-overview-stat {
    border-radius: var(--ebd-radius) !important;
    box-shadow: var(--ebd-shadow) !important;
    border: 1px solid rgba(148, 163, 184, 0.1) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fi-wi-stats-overview-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--ebd-shadow-lg) !important;
}

/* ── Notifications ── */
.fi-no-notification {
    border-radius: var(--ebd-radius) !important;
    box-shadow: var(--ebd-shadow-lg) !important;
}

/* ── Breadcrumbs ── */
.fi-breadcrumbs-item-label {
    font-size: 0.8125rem;
}

/* ── Modal ── */
.fi-modal-window {
    border-radius: 1rem !important;
}

/* ── Mobile sidebar overlay ── */
@media (max-width: 1023px) {
    .fi-sidebar-open .fi-sidebar {
        box-shadow: var(--ebd-shadow-lg) !important;
    }

    .fi-main-ctn {
        padding-top: 0 !important;
    }

    .fi-topbar {
        position: sticky;
        top: 0;
        z-index: 30;
    }

    .fi-page > header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .fi-page > header .fi-ac {
        width: 100%;
        justify-content: flex-start;
    }

    .fi-header-actions {
        flex-wrap: wrap;
    }
}

/* ── Dashboard welcome ── */
.excellency-welcome-banner {
    background: linear-gradient(135deg, var(--ebd-primary) 0%, var(--ebd-primary-light) 50%, var(--ebd-teal) 100%);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: var(--ebd-shadow-lg);
    position: relative;
    overflow: hidden;
}

.excellency-welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 40%;
    height: 200%;
    background: rgba(255, 255, 255, 0.06);
    transform: rotate(25deg);
    pointer-events: none;
}

.excellency-welcome-banner h2 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.excellency-welcome-banner p {
    opacity: 0.9;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
}

/* ── Pagination ── */
.fi-pagination {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* ── Search & filters bar ── */
.fi-ta-header-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem !important;
}

@media (max-width: 640px) {
    .fi-ta-header-toolbar .fi-input-wrp {
        width: 100%;
        min-width: 0;
    }

    .fi-ta-header-toolbar .fi-ta-search-field {
        width: 100%;
    }
}

/* ── Infolists (view pages) ── */
.fi-in-entry-wrp-label {
    font-weight: 600 !important;
    color: #64748b !important;
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .fi-simple-main-ctn,
    .fi-main {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
