/* =============================================================================
   Medlitics Admin — Custom Theme
   Professional redesign layered over Filament 3 via renderHook <link>.
   No build step required — plain CSS using Filament's CSS variables + selectors.
   ============================================================================= */

:root {
    --ml-brand:        #0d9488;   /* teal-600 */
    --ml-brand-dark:   #0f766e;   /* teal-700 */
    --ml-brand-darker: #115e59;   /* teal-800 */
    --ml-ink:          #0f172a;   /* slate-900 */
    --ml-ink-soft:     #1e293b;   /* slate-800 */
    --ml-line:         #e2e8f0;   /* slate-200 */
    --ml-bg:           #f6f8fa;
    --ml-radius:       0.85rem;
}

/* ----------------------------------------------------------------------------
   Typography
   ---------------------------------------------------------------------------- */
.fi-body,
.fi-sidebar,
.fi-main {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    letter-spacing: -0.005em;
}

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

/* ----------------------------------------------------------------------------
   App background — soft neutral instead of flat white
   ---------------------------------------------------------------------------- */
.fi-main-ctn {
    background-color: var(--ml-bg);
}

.dark .fi-main-ctn {
    background-color: #0b1120;
}

/* ----------------------------------------------------------------------------
   Sidebar — deep branded gradient, light text
   ---------------------------------------------------------------------------- */
.fi-sidebar {
    background: linear-gradient(180deg, var(--ml-ink) 0%, var(--ml-ink-soft) 100%) !important;
    border-right: 0 !important;
    box-shadow: 1px 0 0 rgba(255,255,255,0.04);
}

.fi-sidebar-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.07) !important;
    box-shadow: none !important;
    height: 4.5rem;
}

/* Brand area */
.fi-sidebar .fi-logo {
    color: #fff !important;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Group headings */
.fi-sidebar-group-label {
    color: rgba(148, 163, 184, 0.7) !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-top: 0.35rem;
}

/* Nav items */
.fi-sidebar-item-button {
    color: rgba(226, 232, 240, 0.78) !important;
    border-radius: 0.6rem !important;
    margin: 0.1rem 0;
    transition: all 0.15s ease;
    font-weight: 500;
}

.fi-sidebar-item-button:hover {
    background-color: rgba(255,255,255,0.07) !important;
    color: #fff !important;
}

.fi-sidebar-item-icon {
    color: rgba(148, 163, 184, 0.85) !important;
}

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

/* Active nav item — branded teal */
.fi-sidebar-item-active .fi-sidebar-item-button {
    background: linear-gradient(90deg, var(--ml-brand) 0%, var(--ml-brand-dark) 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px -4px rgba(13, 148, 136, 0.55);
}

.fi-sidebar-item-active .fi-sidebar-item-icon {
    color: #fff !important;
}

/* Collapse button + group collapse icon */
.fi-sidebar-group-collapse-button,
.fi-sidebar .fi-icon-btn {
    color: rgba(148, 163, 184, 0.85) !important;
}

/* ----------------------------------------------------------------------------
   Topbar — clean white with subtle shadow
   ---------------------------------------------------------------------------- */
.fi-topbar > nav {
    background-color: rgba(255,255,255,0.92) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--ml-line) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

.dark .fi-topbar > nav {
    background-color: rgba(15, 23, 42, 0.92) !important;
    border-bottom-color: rgba(255,255,255,0.07) !important;
}

/* ----------------------------------------------------------------------------
   Cards / sections / widgets — softer corners, refined shadow
   ---------------------------------------------------------------------------- */
.fi-section,
.fi-wi-stats-overview-stat,
.fi-ta-ctn,
.fi-fo-component-ctn > .fi-section {
    border-radius: var(--ml-radius) !important;
    border: 1px solid var(--ml-line) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px -6px rgba(15, 23, 42, 0.08) !important;
    transition: box-shadow 0.2s ease;
}

.dark .fi-section,
.dark .fi-wi-stats-overview-stat,
.dark .fi-ta-ctn {
    border-color: rgba(255,255,255,0.07) !important;
}

.fi-section:hover {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 10px 28px -10px rgba(15, 23, 42, 0.14) !important;
}

/* Stat widgets — accent top border + bigger numbers */
.fi-wi-stats-overview-stat {
    position: relative;
    overflow: hidden;
}

.fi-wi-stats-overview-stat::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ml-brand) 0%, var(--ml-brand-dark) 100%);
    opacity: 0.9;
}

.fi-wi-stats-overview-stat-value {
    font-weight: 700 !important;
    letter-spacing: -0.03em;
    font-size: 1.85rem !important;
}

.fi-wi-stats-overview-stat-label {
    font-weight: 500 !important;
    color: #64748b !important;
}

/* ----------------------------------------------------------------------------
   Buttons — bolder primary, smoother radius
   ---------------------------------------------------------------------------- */
.fi-btn {
    border-radius: 0.6rem !important;
    font-weight: 600 !important;
}

.fi-btn.fi-color-primary,
.fi-btn[style*="primary"] {
    box-shadow: 0 4px 14px -5px rgba(13, 148, 136, 0.5);
}

/* ----------------------------------------------------------------------------
   Tables — cleaner header, comfortable rows
   ---------------------------------------------------------------------------- */
.fi-ta-header-cell {
    background-color: #f8fafc !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.7rem !important;
    letter-spacing: 0.04em;
    color: #64748b !important;
}

.dark .fi-ta-header-cell {
    background-color: rgba(255,255,255,0.02) !important;
}

.fi-ta-row {
    transition: background-color 0.12s ease;
}

.fi-ta-row:hover {
    background-color: rgba(13, 148, 136, 0.035) !important;
}

/* ----------------------------------------------------------------------------
   Badges — pill shape
   ---------------------------------------------------------------------------- */
.fi-badge {
    border-radius: 9999px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
}

/* ----------------------------------------------------------------------------
   Page headings — generous spacing
   ---------------------------------------------------------------------------- */
.fi-header {
    margin-bottom: 0.5rem;
}

.fi-header-heading {
    font-size: 1.6rem !important;
}

/* ----------------------------------------------------------------------------
   Form inputs — refined focus ring
   ---------------------------------------------------------------------------- */
.fi-input,
.fi-select-input {
    border-radius: 0.6rem !important;
}

/* ----------------------------------------------------------------------------
   Login page — branded backdrop
   ---------------------------------------------------------------------------- */
.fi-simple-layout {
    background:
        radial-gradient(1200px 600px at 100% 0%, rgba(13, 148, 136, 0.12), transparent 60%),
        radial-gradient(900px 500px at 0% 100%, rgba(15, 23, 42, 0.08), transparent 55%),
        var(--ml-bg) !important;
}

.fi-simple-main {
    border-radius: 1.25rem !important;
    border: 1px solid var(--ml-line) !important;
    box-shadow: 0 20px 60px -20px rgba(15, 23, 42, 0.25) !important;
}

/* ----------------------------------------------------------------------------
   Scrollbar polish (webkit)
   ---------------------------------------------------------------------------- */
.fi-sidebar-nav::-webkit-scrollbar { width: 6px; }
.fi-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
}
.fi-sidebar-nav::-webkit-scrollbar-track { background: transparent; }
