/* ============================================================
   Application shell — restyles Filament's own chrome to match
   the reference layout: dark sidebar, light canvas, calm top bar.
   Loaded after Filament's stylesheet, so it wins on specificity.
   ============================================================ */

:root {
    --of-nav:        #0f172a;   /* sidebar */
    --of-nav-2:      #111c30;   /* hover */
    --of-nav-text:   #cbd5e1;
    --of-nav-muted:  #64748b;
    --of-nav-active: #ffffff;
    --of-canvas:     #f6f7f9;
}

/* ---------- canvas ---------- */
.fi-body,
.fi-main-ctn,
.fi-main {
    background: var(--of-canvas) !important;
}
.dark .fi-body,
.dark .fi-main-ctn,
.dark .fi-main { background: #0b0f16 !important; }

.fi-main { max-width: 1600px !important; }

/* ---------- sidebar ---------- */
.fi-sidebar,
.fi-sidebar-nav,
aside.fi-sidebar {
    background: var(--of-nav) !important;
    border-right: 0 !important;
}
.fi-sidebar-header {
    background: var(--of-nav) !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
    box-shadow: none !important;
    height: auto !important;
    padding: 20px 18px 16px !important;
}

/* brand text inside the sidebar header */
.fi-sidebar-header .fi-logo,
.fi-sidebar-header a,
.fi-sidebar-header span {
    color: #fff !important;
    font-weight: 800 !important;
    letter-spacing: -.01em;
}

/* nav items */
.fi-sidebar-nav { padding: 12px 12px 24px !important; }

.fi-sidebar-item-btn {
    border-radius: 10px !important;
    color: var(--of-nav-text) !important;
    font-weight: 550 !important;
    padding: 10px 12px !important;
    transition: background .14s, color .14s !important;
}
.fi-sidebar-item-btn:hover { background: var(--of-nav-2) !important; color: #fff !important; }
.fi-sidebar-item-btn .fi-icon,
.fi-sidebar-item-btn svg { color: var(--of-nav-muted) !important; }
.fi-sidebar-item-btn:hover svg { color: #fff !important; }

.fi-sidebar-item-label {
    display: block !important;
    color: var(--of-nav-text) !important;
    font-size: 13.5px !important;
    line-height: 1.25 !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background: rgba(255,255,255,.10) !important;
    color: #fff !important;
    position: relative;
}
.fi-sidebar-item.fi-active .fi-sidebar-item-btn::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--of-primary);
}
.fi-sidebar-item.fi-active .fi-sidebar-item-btn svg { color: var(--of-primary) !important; }
.fi-sidebar-item.fi-active .fi-sidebar-item-label { color: #fff !important; font-weight: 700 !important; }

@media (min-width: 1024px) {
    .fi-main-sidebar { width: 17rem !important; }
    .fi-sidebar-item-btn { gap: 12px !important; min-height: 44px; }
    .fi-sidebar-item-icon { width: 21px !important; height: 21px !important; flex: 0 0 21px; }
}

/* group headings */
.fi-sidebar-group-label,
.fi-sidebar-group-button {
    color: var(--of-nav-muted) !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: .09em !important;
    text-transform: uppercase !important;
}
.fi-sidebar-group-button:hover { background: transparent !important; }

/* badges on nav items */
.fi-sidebar-item-badge,
.fi-badge {
    border-radius: 999px !important;
}

/* collapse button */
.fi-sidebar-close-overlay { background: rgba(2,6,23,.55) !important; }

/* ---------- top bar ---------- */
.fi-topbar > nav,
.fi-topbar {
    background: #fff !important;
    border-bottom: 1px solid var(--of-border) !important;
    box-shadow: none !important;
}
.dark .fi-topbar > nav, .dark .fi-topbar { background: #151b24 !important; }

.fi-topbar .fi-icon-btn { border-radius: 10px !important; }

/* user chip */
.fi-user-menu .fi-dropdown-trigger,
.fi-topbar .fi-avatar { border-radius: 999px !important; }

/* ---------- page header ---------- */
.fi-header-heading {
    font-size: 26px !important;
    font-weight: 750 !important;
    letter-spacing: -.02em !important;
}
.fi-header-subheading { color: var(--of-muted) !important; }

/* ---------- Filament cards/tables, softened to match ---------- */
.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat {
    border-radius: 14px !important;
    border-color: var(--of-border) !important;
    box-shadow: 0 1px 2px rgba(16,24,40,.05) !important;
}
.fi-ta-header { border-radius: 14px 14px 0 0 !important; }
.fi-btn { border-radius: 10px !important; font-weight: 600 !important; }
.fi-input-wrp { border-radius: 10px !important; }

/* ---------- sidebar footer tagline ---------- */
.of-nav-foot {
    padding: 16px 20px 22px;
    border-top: 1px solid rgba(255,255,255,.07);
    color: var(--of-nav-muted);
    font-size: 11.5px;
    line-height: 1.55;
}
.of-nav-foot strong { color: #e2e8f0; display: block; font-weight: 650; }
.of-nav-credit {
    display: inline-block;
    margin-top: 7px;
    color: #94a3b8;
    font-size: 10.5px;
}

/* brand block under the logo */
.of-nav-brand { padding: 0 6px 4px; }
.of-nav-brand .of-nav-sub {
    color: var(--of-nav-muted); font-size: 11px; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; display: block;
}

/* ---------- topbar extras ---------- */
.of-topbar-tools { display: flex; align-items: center; gap: 10px; }
.of-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--of-bg); border: 1px solid var(--of-border);
    border-radius: 10px; padding: 8px 13px; min-width: 250px;
    color: var(--of-faint); font-size: 13px;
}
.of-search input {
    border: 0; background: none; outline: none; flex: 1;
    font-size: 13px; color: var(--of-text);
}
@media (max-width: 1024px) { .of-search { display: none; } }

/* ---------- mobile ---------- */
@media (max-width: 1024px) {
    .fi-sidebar { box-shadow: 0 20px 60px rgba(2,6,23,.4) !important; }
}

/* ============================================================
   Dashboard — donut, day bars, presence rail
   ============================================================ */
.of-dash { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1180px) { .of-dash { grid-template-columns: 1fr; } }

/* ---------- donut ---------- */
.of-donut-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.of-donut-wrap { position: relative; width: 190px; height: 190px; flex-shrink: 0; }
.of-donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.of-donut circle { transition: stroke-dasharray .5s ease; }
.of-donut-hole { fill: var(--of-surface); }
.of-donut-centre {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; pointer-events: none;
}
.of-donut-value { font-size: 21px; font-weight: 750; color: var(--of-text); letter-spacing: -.02em; }

.of-legend { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 9px; }
.of-legend-row { display: flex; align-items: center; gap: 9px; }
.of-legend-dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }

/* ---------- day bars ---------- */
.of-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.of-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.of-bar-track {
    flex: 1; width: 100%; max-width: 34px; background: var(--of-bg);
    border-radius: 7px; display: flex; align-items: flex-end; overflow: hidden;
}
.of-bar-fill {
    width: 100%; background: var(--of-primary); border-radius: 7px;
    transition: height .4s ease; opacity: .85;
}
.of-bar-fill.is-today { opacity: 1; background: var(--of-primary-d); }
.of-bar-label { font-size: 10px; color: var(--of-faint); font-weight: 600; }
.of-bar-label.is-today { color: var(--of-primary-d); font-weight: 750; }

/* ---------- presence rail ---------- */
.of-rail { position: sticky; top: 16px; }
@media (max-width: 1180px) { .of-rail { position: static; } }

.of-rail-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--of-border); }
.of-rail-tab {
    background: none; border: 0; padding: 10px 4px 12px; cursor: pointer;
    border-bottom: 2px solid transparent; transition: .15s;
}
.of-rail-tab.is-on { border-bottom-color: var(--of-primary); }
.of-rail-count { display: block; font-size: 20px; font-weight: 750; color: var(--of-muted); }
.of-rail-tab.is-on .of-rail-count.in   { color: var(--of-ok); }
.of-rail-tab.is-on .of-rail-count.idle { color: var(--of-warn); }
.of-rail-tab.is-on .of-rail-count.out  { color: var(--of-faint); }
.of-rail-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--of-faint); }

.of-rail-list { flex: 1; overflow-y: auto; max-height: 460px; }

.of-presence-dot {
    position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px;
    border-radius: 999px; background: var(--of-faint); border: 2px solid var(--of-surface);
}
.of-presence-dot.is-in   { background: #0e9f6e; }
.of-presence-dot.is-idle { background: #d97706; }
