/*
 * IPPBX panel theme. Plain CSS on top of Filament's stylesheet (no Tailwind
 * build needed); registered in AppServiceProvider and published with
 * `php artisan filament:assets`.
 */

:root {
    --ippbx-sidebar-bg: #0b1220;
    --ippbx-sidebar-bg-2: #111a2e;
    --ippbx-sidebar-text: #c7d0e0;
    --ippbx-sidebar-muted: #6b7a93;
    --ippbx-sidebar-hover: rgba(255, 255, 255, 0.06);
    --ippbx-sidebar-active: rgba(99, 102, 241, 0.18);
    --ippbx-accent: #6366f1;
    --ippbx-accent-2: #06b6d4;
    --ippbx-page-bg: #f4f6fb;
    --ippbx-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05);
}

.dark {
    --ippbx-sidebar-bg: #080d18;
    --ippbx-sidebar-bg-2: #0d1424;
    --ippbx-page-bg: #0b1120;
    --ippbx-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ---------- Logo ---------- */

.ippbx-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    height: 100%;
}

.ippbx-logo-mark {
    height: 2rem;
    width: 2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 10px rgba(99, 102, 241, 0.35));
}

.ippbx-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.ippbx-logo-accent {
    background: linear-gradient(90deg, var(--ippbx-accent), var(--ippbx-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Page ---------- */

.fi-body {
    background-color: var(--ippbx-page-bg);
}

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

/* ---------- Sidebar: dark navy in both themes ---------- */

.fi-sidebar {
    background: linear-gradient(180deg, var(--ippbx-sidebar-bg) 0%, var(--ippbx-sidebar-bg-2) 100%) !important;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.04);
}

.fi-sidebar-header {
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #fff;
}

.fi-sidebar .fi-logo {
    color: #fff;
}

.fi-sidebar-group-label {
    color: var(--ippbx-sidebar-muted) !important;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fi-sidebar-group-collapse-btn,
.fi-sidebar-group-btn .fi-icon {
    color: var(--ippbx-sidebar-muted) !important;
}

.fi-sidebar-item-btn {
    border-radius: 0.6rem;
    transition: background-color 0.15s ease;
}

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

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

.fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background: var(--ippbx-sidebar-active) !important;
    box-shadow: inset 3px 0 0 var(--ippbx-accent);
}

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

/* ---------- Topbar ---------- */

.fi-topbar {
    backdrop-filter: saturate(180%) blur(8px);
}

.fi-topbar > nav,
.fi-topbar-ctn > nav {
    box-shadow: none !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.dark .fi-topbar > nav,
.dark .fi-topbar-ctn > nav {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* ---------- Cards, sections, tables ---------- */

.fi-section:not(.fi-section-not-contained),
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-chart .fi-section {
    border-radius: 1rem !important;
    box-shadow: var(--ippbx-card-shadow) !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

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

/* Stat cards get a thin accent bar so the dashboard reads at a glance. */
.fi-wi-stats-overview-stat {
    position: relative;
    overflow: hidden;
}

.fi-wi-stats-overview-stat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ippbx-accent), var(--ippbx-accent-2));
    opacity: 0.85;
}

.fi-wi-stats-overview-stat-value {
    letter-spacing: -0.02em;
}

.fi-ta-header-cell {
    text-transform: uppercase;
    font-size: 0.7rem !important;
    letter-spacing: 0.06em;
}

/* ---------- Login ---------- */

.fi-simple-layout {
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, 0.35), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(6, 182, 212, 0.30), transparent 60%),
        linear-gradient(160deg, #0b1220 0%, #111a2e 100%);
}

.fi-simple-main {
    border-radius: 1.25rem !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fi-simple-header .fi-logo {
    color: #0f172a;
}

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

.ippbx-login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ---------- Sidebar footer status ---------- */

.ippbx-sidebar-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    color: var(--ippbx-sidebar-text);
}

.ippbx-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.ippbx-dot-on {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.ippbx-dot-off {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.fi-sidebar-collapsed .ippbx-sidebar-status-text,
.fi-main-sidebar:not(.fi-sidebar-open) .ippbx-sidebar-status-text {
    display: none;
}

/* ---------- Page header ---------- */

.fi-header-subheading {
    max-width: 60rem;
    color: rgb(100 116 139);
}

/* ---------- Tables ---------- */

.fi-ta-ctn {
    overflow: hidden;
}

.fi-ta-header-ctn,
.fi-ta-header-toolbar {
    background: rgba(248, 250, 252, 0.7);
}

.dark .fi-ta-header-ctn,
.dark .fi-ta-header-toolbar {
    background: rgba(255, 255, 255, 0.02);
}

.fi-ta-table thead tr {
    background: rgb(248 250 252);
}

.dark .fi-ta-table thead tr {
    background: rgba(255, 255, 255, 0.03);
}

.fi-ta-header-cell {
    color: rgb(100 116 139) !important;
}

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

.fi-ta-row:hover {
    background: rgba(99, 102, 241, 0.045) !important;
}

.dark .fi-ta-row:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

.fi-ta-empty-state-icon-bg {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(6, 182, 212, 0.14)) !important;
}

/* ---------- Forms and detail pages ---------- */

.fi-section-header {
    padding-bottom: 0.9rem;
}

.fi-section-header .fi-section-header-heading {
    font-weight: 650;
    letter-spacing: -0.01em;
}

.fi-section-header-icon {
    color: var(--ippbx-accent) !important;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 0.6rem;
    padding: 0.35rem;
    width: 2rem !important;
    height: 2rem !important;
}

.fi-section-content-ctn {
    border-top-color: rgba(15, 23, 42, 0.06) !important;
}

.fi-fo-repeater-item {
    border-radius: 0.8rem !important;
}

.fi-in-entry-label,
.fi-fo-field-label-content {
    font-weight: 550;
}

.fi-badge {
    border-radius: 9999px !important;
}

/* ---------- Recording player ---------- */

.ippbx-player {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.ippbx-player audio {
    height: 2rem;
    width: 15rem;
    /* Tables squeeze cells; below this the native play button disappears. */
    min-width: 13rem;
}

.ippbx-player-wide {
    display: flex;
    width: 100%;
}

.ippbx-player-wide audio {
    flex: 1;
    width: auto;
    height: 2.5rem;
}

.ippbx-player-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    color: rgb(71 85 105);
    background: rgb(241 245 249);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ippbx-player-download:hover {
    color: #fff;
    background: var(--ippbx-accent);
}

.ippbx-player-download-label {
    width: auto;
    padding: 0 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.dark .ippbx-player-download {
    color: rgb(203 213 225);
    background: rgba(255, 255, 255, 0.08);
}

.ippbx-muted {
    color: rgb(148 163 184);
}

/* ---------- Tenant switcher (topbar, super admins) ---------- */

.ippbx-tenant-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.25rem;
    padding: 0 0.4rem 0 0.7rem;
    margin-inline-end: 0.5rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
}

.dark .ippbx-tenant-switcher {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.ippbx-tenant-switcher-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: rgb(100 116 139);
    flex-shrink: 0;
}

.ippbx-tenant-switcher select {
    border: 0;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0 1.8rem 0 0;
    max-width: 14rem;
    color: inherit;
    cursor: pointer;
}

.ippbx-tenant-switcher select:focus {
    outline: none;
    box-shadow: none;
}

/* A picked tenant is highlighted so it is obvious the panel is narrowed down. */
.ippbx-tenant-switcher-active {
    border-color: var(--ippbx-accent);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.ippbx-tenant-switcher-active .ippbx-tenant-switcher-icon {
    color: var(--ippbx-accent);
}

.dark .ippbx-tenant-switcher-active {
    background: rgba(99, 102, 241, 0.16);
}

/* ---------- Sidebar scrollbar: thin and dark, brighter on hover ---------- */

.fi-sidebar,
.fi-sidebar * {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.fi-sidebar:hover,
.fi-sidebar:hover * {
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

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

.fi-sidebar ::-webkit-scrollbar-track,
.fi-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.fi-sidebar ::-webkit-scrollbar-thumb,
.fi-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
}

.fi-sidebar:hover ::-webkit-scrollbar-thumb,
.fi-sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
}
