/*
 * The MaSta ERP workspace look, for every ERP's tenants (asked by Amol, 2026-11-17): a silver gradient canvas with a
 * glossy sheen, see-through glass boxes, tabs, tables and side menu with soft blurred shadows. Three colours drive it:
 * --es-a (primary), --es-b (secondary) and --es-bg (background). The defaults are silver and ink; a tenant sets its
 * own under Branding (primary on every plan; secondary and background on Ultra Premium). Light mode only.
 * Plain CSS over Filament's own classes, loaded after Filament's stylesheet.
 */
:root {
    --es-a: #1f2937;
    --es-b: #64748b;
    --es-bg: #dfe3e8;
    --es-ink: #111827;
    --es-soft: #3b4756;
    --es-muted: #667085;
    --es-glass: rgba(255, 255, 255, 0.46);
    --es-glass-strong: rgba(255, 255, 255, 0.9);
    --es-line: rgba(255, 255, 255, 0.82);
    --es-hair: rgba(17, 24, 39, 0.07);
    --es-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 18px 44px -14px rgba(30, 41, 59, 0.28), 0 4px 14px -6px rgba(30, 41, 59, 0.14);
    --es-blur: blur(24px) saturate(1.5);
    --es-radius: 20px;
    --es-grad: linear-gradient(135deg, var(--es-a), var(--es-b));
}

/* Canvas: brushed silver with moving highlights */
html:not(.dark) body.fi-body {
    color: var(--es-ink);
    background-color: var(--es-bg);
    background-image:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.95) 0, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--es-b) 26%, transparent) 0, transparent 38%),
        radial-gradient(circle at 78% 92%, rgba(255, 255, 255, 0.85) 0, rgba(255, 255, 255, 0) 36%),
        radial-gradient(circle at 4% 96%, color-mix(in srgb, var(--es-a) 16%, transparent) 0, transparent 40%),
        linear-gradient(125deg, color-mix(in srgb, var(--es-bg) 70%, #ffffff) 0%, var(--es-bg) 32%, color-mix(in srgb, var(--es-bg) 55%, #ffffff) 50%, color-mix(in srgb, var(--es-bg) 88%, #6b7280) 74%, color-mix(in srgb, var(--es-bg) 62%, #ffffff) 100%);
    background-attachment: fixed;
}

/* Glass: every box, table, tab strip, the side menu and the top bar */
html:not(.dark) body.fi-body .fi-sidebar,
html:not(.dark) body.fi-body .fi-topbar,
html:not(.dark) body.fi-body .fi-section:not(.fi-section-not-contained),
html:not(.dark) body.fi-body .fi-ta-ctn,
html:not(.dark) body.fi-body .fi-wi-stats-overview-stat,
html:not(.dark) body.fi-body .fi-wi-widget > .fi-section,
html:not(.dark) body.fi-body .fi-simple-main,
html:not(.dark) body.fi-body .es-card {
    position: relative;
    background-color: var(--es-glass);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0) 120px), linear-gradient(160deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.18) 42%, rgba(255, 255, 255, 0.34) 100%);
    -webkit-backdrop-filter: var(--es-blur);
    backdrop-filter: var(--es-blur);
    border: 1px solid var(--es-line);
    box-shadow: var(--es-shadow);
    --tw-ring-color: transparent;
}
html:not(.dark) body.fi-body .fi-section:not(.fi-section-not-contained),
html:not(.dark) body.fi-body .fi-ta-ctn,
html:not(.dark) body.fi-body .fi-wi-stats-overview-stat,
html:not(.dark) body.fi-body .es-card {
    border-radius: var(--es-radius);
}
/* Only the small cards clip their gloss; boxes with forms must let drop-down lists open over their edge. */
html:not(.dark) body.fi-body .fi-wi-stats-overview-stat,
html:not(.dark) body.fi-body .es-card {
    overflow: hidden;
}
/* The gloss: a soft band of light across the top of each box */
html:not(.dark) body.fi-body .fi-wi-stats-overview-stat::before,
html:not(.dark) body.fi-body .es-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 46%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    pointer-events: none;
    border-radius: var(--es-radius) var(--es-radius) 60% 60% / var(--es-radius) var(--es-radius) 18% 18%;
    z-index: 0;
    opacity: .9;
}
html:not(.dark) body.fi-body .fi-wi-stats-overview-stat > *,
html:not(.dark) body.fi-body .es-card > * {
    position: relative;
    z-index: 1;
}
html:not(.dark) body.fi-body .fi-wi-stats-overview-stat,
html:not(.dark) body.fi-body .es-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
html:not(.dark) body.fi-body .fi-wi-stats-overview-stat:hover,
html:not(.dark) body.fi-body .es-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 26px 54px -16px rgba(30, 41, 59, 0.36), 0 6px 16px -6px rgba(30, 41, 59, 0.16);
}

/* Floating side menu */
@media (min-width: 64rem) {
    html:not(.dark) body.fi-body .fi-sidebar {
        margin: 16px 0 16px 16px;
        height: calc(100dvh - 32px);
        top: 16px;
        border-radius: 24px;
    }
}
html:not(.dark) body.fi-body .fi-sidebar-header,
html:not(.dark) body.fi-body.fi-body-has-topbar .fi-sidebar-header {
    background: transparent;
    box-shadow: none;
}
html:not(.dark) body.fi-body .fi-sidebar-nav {
    padding-inline: 14px;
    padding-block: 18px 22px;
    row-gap: 20px;
}
html:not(.dark) body.fi-body .fi-sidebar-group-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--es-muted);
}
html:not(.dark) body.fi-body .fi-sidebar-group-label::before {
    content: "";
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: var(--es-grad);
    flex-shrink: 0;
}
html:not(.dark) body.fi-body .fi-sidebar-item-btn {
    border-radius: 12px;
    padding-block: 8px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
html:not(.dark) body.fi-body .fi-sidebar-item-btn:hover {
    background-color: rgba(255, 255, 255, 0.72);
    box-shadow: 0 6px 16px -10px rgba(30, 41, 59, 0.5);
}
html:not(.dark) body.fi-body .fi-sidebar-item-label {
    color: var(--es-soft);
    font-weight: 600;
}
html:not(.dark) body.fi-body .fi-sidebar-item-icon {
    color: var(--es-muted);
}
html:not(.dark) body.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: var(--es-a);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 52%), var(--es-grad);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 12px 22px -10px color-mix(in srgb, var(--es-a) 70%, transparent);
}
html:not(.dark) body.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
html:not(.dark) body.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon {
    color: #ffffff;
}
html:not(.dark) body.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    --tw-ring-color: transparent;
}

/* Floating top bar */
html:not(.dark) body.fi-body .fi-topbar-ctn {
    padding: 16px 16px 0;
}
html:not(.dark) body.fi-body .fi-topbar {
    border-radius: var(--es-radius);
}

/* Page heading */
html:not(.dark) body.fi-body .fi-main {
    padding-top: 6px;
}
html:not(.dark) body.fi-body .fi-header-heading {
    font-weight: 700;
    letter-spacing: -0.04em;
    background: linear-gradient(100deg, var(--es-ink) 0%, var(--es-a) 45%, var(--es-b) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
html:not(.dark) body.fi-body .fi-header-subheading {
    color: var(--es-muted);
}
html:not(.dark) body.fi-body .fi-section-header-heading {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Tables */
html:not(.dark) body.fi-body .fi-section:not(.fi-section-not-contained) > .fi-section-content-ctn > .fi-section-footer,
html:not(.dark) body.fi-body .fi-ta-header,
html:not(.dark) body.fi-body .fi-ta-header-toolbar,
html:not(.dark) body.fi-body .fi-ta-content,
html:not(.dark) body.fi-body .fi-ta-footer,
html:not(.dark) body.fi-body .fi-pagination {
    border-color: var(--es-hair);
    background-color: transparent;
}
html:not(.dark) body.fi-body .fi-ta-table > thead > tr,
html:not(.dark) body.fi-body .fi-ta-header-cell {
    background-color: rgba(255, 255, 255, 0.28);
}
html:not(.dark) body.fi-body .fi-ta-header-cell-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--es-muted);
}
html:not(.dark) body.fi-body .fi-ta-table > tbody > tr,
html:not(.dark) body.fi-body .fi-ta-row {
    border-color: var(--es-hair);
    background-color: transparent;
}
html:not(.dark) body.fi-body .fi-ta-row:hover,
html:not(.dark) body.fi-body .fi-ta-row.fi-clickable:hover {
    background-color: rgba(255, 255, 255, 0.6);
}
html:not(.dark) body.fi-body .fi-ta-table > :not(:last-child),
html:not(.dark) body.fi-body .fi-ta-table > tbody {
    border-color: var(--es-hair);
}
html:not(.dark) body.fi-body .fi-wi-stats-overview-stat-value {
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--es-a);
}

/* Fields */
html:not(.dark) body.fi-body .fi-input-wrp {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 6px 14px -10px rgba(30, 41, 59, 0.3);
    --tw-ring-color: rgba(17, 24, 39, 0.1);
}
html:not(.dark) body.fi-body .fi-input-wrp:focus-within {
    --tw-ring-color: var(--es-a);
}

/* Buttons: glossy, in the workspace's two colours */
html:not(.dark) body.fi-body .fi-btn {
    border-radius: 12px;
}
html:not(.dark) body.fi-body .fi-btn.fi-color-primary:not(.fi-outlined) {
    background-color: var(--es-a);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 50%), var(--es-grad);
    color: #ffffff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 12px 22px -12px color-mix(in srgb, var(--es-a) 80%, transparent);
}
html:not(.dark) body.fi-body .fi-btn.fi-color-primary:not(.fi-outlined):hover {
    filter: brightness(1.08);
}
html:not(.dark) body.fi-body .fi-btn.fi-color-gray:not(.fi-outlined),
html:not(.dark) body.fi-body .fi-btn.fi-outlined {
    background-color: rgba(255, 255, 255, 0.66);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 8px 16px -12px rgba(30, 41, 59, 0.4);
}

/* Tabs */
html:not(.dark) body.fi-body .fi-tabs {
    background-color: rgba(255, 255, 255, 0.4);
    -webkit-backdrop-filter: var(--es-blur);
    backdrop-filter: var(--es-blur);
    border: 1px solid var(--es-line);
    border-radius: 14px;
    box-shadow: 0 10px 24px -14px rgba(30, 41, 59, 0.35);
    --tw-ring-color: transparent;
}
html:not(.dark) body.fi-body .fi-tabs-item {
    border-radius: 10px;
}
html:not(.dark) body.fi-body .fi-tabs-item.fi-active {
    background-color: #ffffff;
    background-image: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.7));
    box-shadow: 0 6px 14px -8px rgba(30, 41, 59, 0.4);
}
html:not(.dark) body.fi-body .fi-tabs-item.fi-active .fi-tabs-item-label,
html:not(.dark) body.fi-body .fi-tabs-item.fi-active .fi-icon {
    color: var(--es-a);
}

/* Floating layers stay readable */
html:not(.dark) body.fi-body .fi-dropdown-panel,
html:not(.dark) body.fi-body .fi-modal-window {
    background-color: var(--es-glass-strong);
    -webkit-backdrop-filter: var(--es-blur);
    backdrop-filter: var(--es-blur);
    border: 1px solid var(--es-line);
    border-radius: var(--es-radius);
    box-shadow: 0 30px 70px -20px rgba(30, 41, 59, 0.45);
}
html:not(.dark) body.fi-body .fi-modal-close-overlay {
    background-color: rgba(17, 24, 39, 0.3);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
html:not(.dark) body.fi-body .fi-simple-main {
    border-radius: 24px;
}
html:not(.dark) body.fi-body .fi-badge {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

/* The workspace's own blocks (dashboards, theme cards, org chart, knowledge base) */
.es-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.es-card { padding: 18px 20px; display: block; }
.es-card .es-k { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--es-muted); }
.es-card .es-v { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin-top: 6px; background: var(--es-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.es-card .es-h { font-size: 13px; color: var(--es-muted); margin-top: 4px; }
.es-list { display: grid; gap: 8px; margin-top: 10px; font-size: 14px; }
.es-list div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--es-hair); }
.es-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.es-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--es-a) 12%, #ffffff); color: var(--es-a); }

@media (prefers-reduced-motion: reduce) {
    html body.fi-body * { transition: none !important; }
}
