/* ==========================================================================
   EstateSys panel theme — loaded after Filament's CSS (no build step needed).
   Brand: survey blue #2a6488, deep navy #12293b, ochre #b67a12, font Onest.
   ========================================================================== */
:root {
  --es-navy: #102536;
  --es-navy-2: #17354b;
  --es-blue: #2a6488;
  --es-blue-soft: #e3eef4;
  --es-ochre: #b67a12;
  --es-ochre-light: #e8b04f;
  --es-ochre-soft: #f6ecd9;
  --es-bg: #eef2f4;
  --es-card: #ffffff;
  --es-line: #dfe5e8;
  --es-shadow: 0 1px 2px rgba(16, 37, 54, .05), 0 12px 32px -18px rgba(16, 37, 54, .28);
  --es-radius: 16px;
}

/* ---------- page background ---------- */
html:not(.dark) .fi-body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(42, 100, 136, .10), transparent 60%),
    radial-gradient(900px 400px at -10% 110%, rgba(182, 122, 18, .07), transparent 60%),
    var(--es-bg);
  background-attachment: fixed;
}
html:not(.dark) .fi-main-ctn::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(16, 37, 54, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(16, 37, 54, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.fi-main { position: relative; z-index: 1; }

/* ---------- sidebar: deep navy ---------- */
.fi-sidebar {
  background: linear-gradient(180deg, var(--es-navy) 0%, var(--es-navy-2) 100%) !important;
  border-right: 0 !important;
  box-shadow: 8px 0 30px -20px rgba(0, 0, 0, .5);
  color: #dbe6ee;
}
.fi-sidebar-header { background: transparent !important; box-shadow: none !important; border-bottom: 1px solid rgba(255, 255, 255, .07) !important; color: #fff; }
.fi-sidebar-header .fi-icon-btn, .fi-sidebar .fi-icon-btn { color: rgba(255, 255, 255, .7) !important; }
.fi-sidebar-nav { padding-top: 1rem; }
.fi-sidebar-group-label { color: rgba(255, 255, 255, .45) !important; font-size: .7rem !important; letter-spacing: .12em; text-transform: uppercase; }
.fi-sidebar-group-collapse-btn { color: rgba(255, 255, 255, .4) !important; }
.fi-sidebar-item-btn { border-radius: 10px !important; transition: background .15s ease; }
.fi-sidebar-item-label { color: rgba(255, 255, 255, .82) !important; font-weight: 500; }
.fi-sidebar-item-icon { color: rgba(255, 255, 255, .5) !important; }
.fi-sidebar-item-btn:hover { background: rgba(255, 255, 255, .07) !important; }
.fi-sidebar-item.fi-active .fi-sidebar-item-btn {
  background: linear-gradient(90deg, rgba(232, 176, 79, .22), rgba(232, 176, 79, .06)) !important;
  box-shadow: inset 3px 0 0 var(--es-ochre-light);
}
.fi-sidebar-item.fi-active .fi-sidebar-item-label { color: #fff !important; font-weight: 600; }
.fi-sidebar-item.fi-active .fi-sidebar-item-icon { color: var(--es-ochre-light) !important; }
.fi-sidebar-item-grouped-border-part, .fi-sidebar-item-grouped-border-part-not-first, .fi-sidebar-item-grouped-border-part-not-last { background: rgba(255, 255, 255, .15) !important; }

/* tenant (agency) switcher on dark */
.fi-tenant-menu-trigger { border-radius: 12px !important; background: rgba(255, 255, 255, .06) !important; }
.fi-tenant-menu-trigger:hover { background: rgba(255, 255, 255, .1) !important; }
.fi-tenant-menu-trigger-tenant-name, .fi-tenant-menu-trigger-text { color: #fff !important; }
.fi-tenant-menu-trigger-text span:not(.fi-tenant-menu-trigger-tenant-name) { color: rgba(255, 255, 255, .55) !important; }
.fi-tenant-menu-trigger .fi-icon { color: rgba(255, 255, 255, .6) !important; }
.fi-tenant-avatar { background: var(--es-ochre) !important; color: #fff !important; border-radius: 9px !important; }

/* ---------- topbar ---------- */
html:not(.dark) .fi-topbar, html:not(.dark) .fi-topbar-ctn > nav {
  background: rgba(255, 255, 255, .78) !important;
  backdrop-filter: saturate(1.4) blur(12px);
  box-shadow: 0 1px 0 rgba(16, 37, 54, .06) !important;
}
.fi-user-avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--es-blue-soft); }

/* ---------- page header ---------- */
.fi-header-heading {
  font-weight: 800 !important;
  letter-spacing: -.025em;
  font-size: clamp(1.5rem, 2.4vw, 2rem) !important;
  color: var(--es-navy);
}
.dark .fi-header-heading { color: #fff; }
.fi-breadcrumbs-item-label { font-size: .8rem; }

/* ---------- cards: sections, tables, widgets ---------- */
html:not(.dark) .fi-section,
html:not(.dark) .fi-ta-ctn,
html:not(.dark) .fi-wi-stats-overview-stat,
html:not(.dark) .fi-wi-widget > .fi-section {
  border-radius: var(--es-radius) !important;
  box-shadow: var(--es-shadow) !important;
  --tw-ring-color: rgba(16, 37, 54, .06) !important;
}
.fi-section-header-heading { font-weight: 700 !important; letter-spacing: -.01em; }
html:not(.dark) .fi-section-header { border-bottom: 1px solid var(--es-line); }

/* tables */
html:not(.dark) .fi-ta-header-cell { background: #f6f8f9 !important; }
.fi-ta-header-cell, .fi-ta-header-cell-sort-btn { font-size: .72rem !important; letter-spacing: .06em; text-transform: uppercase; color: #5f6e7b !important; }
html:not(.dark) .fi-ta-row:hover { background: #f7fafb !important; }
.fi-ta-image img { border-radius: 10px !important; box-shadow: 0 2px 8px -2px rgba(16, 37, 54, .25); }
.fi-ta-cell-price .fi-ta-text-item { font-weight: 700 !important; font-variant-numeric: tabular-nums; }

/* badges & buttons */
.fi-badge { border-radius: 999px !important; font-weight: 600 !important; }
.fi-btn.fi-color-primary:not(.fi-outlined) {
  background-image: linear-gradient(135deg, #3576a0, #22587a) !important;
  box-shadow: 0 6px 16px -8px rgba(34, 88, 122, .8) !important;
}
.fi-btn { border-radius: 11px !important; font-weight: 600 !important; }

/* ---------- stats cards: coloured ---------- */
.fi-wi-stats-overview-stat { position: relative; overflow: hidden; }
.fi-wi-stats-overview-stat::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%;
  background: currentColor; opacity: .06; pointer-events: none;
}
.fi-wi-stats-overview-stat-value { font-weight: 800 !important; letter-spacing: -.03em; font-size: 2.1rem !important; }
.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(1) { background: linear-gradient(135deg, #2a6488, #173c55) !important; color: #fff; }
.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(1) * { color: #fff !important; }
.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(1) .fi-wi-stats-overview-stat-description { color: rgba(255, 255, 255, .75) !important; }
html:not(.dark) .fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(2) { background: linear-gradient(135deg, #fff, #eef5f9) !important; }
html:not(.dark) .fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(3) { background: linear-gradient(135deg, #fff, #fbf3e4) !important; }

/* ---------- welcome banner widget ---------- */
.es-welcome {
  position: relative; overflow: hidden; border-radius: 20px; padding: 26px 28px; color: #fff;
  background:
    radial-gradient(600px 240px at 100% 0%, rgba(232, 176, 79, .35), transparent 60%),
    linear-gradient(120deg, #102536 0%, #1d4a69 60%, #2a6488 100%);
  box-shadow: 0 24px 50px -30px rgba(16, 37, 54, .9);
}
.es-welcome::before {
  content: ""; position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 36px 36px; mask-image: linear-gradient(90deg, transparent 30%, #000); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.es-welcome > * { position: relative; }
.es-welcome .es-eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--es-ochre-light); font-weight: 700; }
.es-welcome h2 { margin: .35rem 0 .3rem; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.es-welcome p { margin: 0; color: rgba(255, 255, 255, .78); max-width: 60ch; }
.es-quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.es-quick a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: .9rem;
  color: #fff; text-decoration: none; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); transition: background .15s ease;
}
.es-quick a:hover { background: rgba(255, 255, 255, .18); }
.es-quick a.es-primary { background: var(--es-ochre); border-color: var(--es-ochre); }
.es-quick a.es-primary:hover { background: #9f6a0e; }
.es-quick svg { width: 18px; height: 18px; }

/* empty states */
.fi-ta-empty-state-heading { font-weight: 700 !important; }
.fi-ta-empty-state-icon-bg { background: var(--es-blue-soft) !important; }

/* ---------- mobile ---------- */
@media (max-width: 1023px) {
  .fi-header-heading { font-size: 1.45rem !important; }
  .es-welcome { padding: 20px; border-radius: 16px; }
  .es-quick a { flex: 1 1 calc(50% - 10px); justify-content: center; }
  .fi-wi-stats-overview-stat-value { font-size: 1.7rem !important; }
  .fi-main { padding-inline: .75rem !important; }
}

/* ---------- sign-in pages (split screen) ---------- */
@media (min-width: 1024px) {
  .fi-simple-layout {
    background:
      linear-gradient(90deg, rgba(14, 30, 44, .15), rgba(14, 30, 44, .15)) left top / 50% 100% no-repeat,
      url('/img/login-1200.webp') left center / 50% 100% no-repeat;
  }
  .fi-simple-layout::after {
    content: "Всеки имот, клиент и оглед — на едно място.";
    position: fixed; left: 3rem; bottom: 3rem; width: calc(50% - 6rem);
    font-family: 'Onest', sans-serif; font-weight: 700;
    font-size: 1.6rem; line-height: 1.25; color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
  }
  .fi-simple-main-ctn { margin-left: 50%; width: 50%; }
}

/* phones: tighter tables so title + price fit without sideways scrolling */
@media (max-width: 639px) {
  .fi-ta-cell, .fi-ta-header-cell { padding-inline: .6rem !important; }
  .fi-ta-selection-cell, .fi-ta-header-cell.fi-ta-selection-cell { padding-inline: .5rem !important; }
  .fi-ta-cell-price .fi-ta-text-description { display: none; }
  .fi-ta-text-description { font-size: .78rem !important; }
}
