/* Shared Salespype-inspired panel theme. Loaded last so legacy component tokens
 * resolve consistently. Geometry, typography and interaction contracts stay in
 * their existing helpers. Sidebar and content surfaces have independent roles. */
:root {
    --emlaklistem-dropdown-choice-color: #233858;
    --emlaklistem-bg-light: #f4f5f8;
    --emlaklistemcrm-darkbg: #e7efff;
    --emlaklistem-color-danger: #c03945;
    --emlaklistem-color-success: #16794d;
    --emlaklistem-color-success-action: #16794d;
    --emlaklistem-color-success-softest: #e8f6ee;
    --emlaklistem-color-warning-dark: #9a5b10;
    --emlaklistem-color-warning-softest: #fff3df;
    --emlaklistem-color-danger-softest: #fdecee;
    --emlaklistem-blue: #285de5;
    --emlaklistem-color-primary: #285de5;
    --emlaklistem-color-primary-hover: #214fc4;
    --emlaklistem-color-primary-rgb: 40, 93, 229;
    --emlaklistem-shell-sidebar-bg: #191f48;
    --emlaklistem-shell-sidebar-border: #2c355b;
    --emlaklistem-sidebar-hover: #25315d;
    --emlaklistem-sidebar-foreground: #dce4f5;
    --emlaklistem-color-text: #233858;
    --emlaklistem-color-text-deep: #233858;
    --emlaklistem-color-text-strong: #233858;
    --emlaklistem-color-text-strongest: #233858;
    --emlaklistem-color-text-subtle: #233858;
    --emlaklistem-color-text-soft: #5b6b84;
    --emlaklistem-color-muted: #5b6b84;
    --emlaklistem-color-brand-strong: #214fc4;
    --emlaklistem-color-brand-deep: #233858;
    --emlaklistem-color-link: #285de5;
    --emlaklistem-color-link-strong: #214fc4;
    --emlaklistem-color-surface: #ffffff;
    --emlaklistem-color-surface-muted: #f4f5f8;
    --emlaklistem-color-surface-soft: #eaf0fc;
    --emlaklistem-color-surface-info-soft: #e7efff;
    --emlaklistem-color-surface-brand-soft: #e7efff;
    --emlaklistem-color-surface-blue-soft: #e7efff;
    --emlaklistem-color-surface-indigo-soft: #e7efff;
    --emlaklistem-color-surface-purple-soft: #e7efff;
    --emlaklistem-color-header-soft: #eaf0fc;
    --emlaklistem-caption-color: #5b6b84;
    --emlaklistem-color-white-overlay-card: #ffffff;
    --emlaklistem-record-tab-inner-bg: #eaf0fc;
    --emlaklistem-record-tab-level-3-active-bg: #e7efff;
    --emlaklistem-record-tab-level-3-hover-bg: #eaf0fc;
    --emlaklistem-record-tab-level-3-strip-bg: #f4f5f8;
    --emlaklistem-record-tab-tertiary-text: #5b6b84;
    --emlaklistem-table-list-header-bg: #eaf0fc;
    --emlaklistem-table-list-stripe-bg: #f8f9fb;
    --emlaklistem-table-list-hover-bg: #edf3ff;
    --emlaklistem-table-list-active-bg: #e7efff;
    --tkr-record-card-border: #e1e7f0;
    --tkr-record-card-bg: #ffffff;
    --tkr-record-field-border: #e1e7f0;
    --tkr-record-nav-border: #e1e7f0;
    --tkr-record-nav-active-shadow: none;
    --emlaklistem-text-strong: #233858;
    --emlaklistem-text-muted: #5b6b84;
    --color-primary-soft: #e7efff;
    --color-primary-strong: #214fc4;
    --emlaklistem-color-border: #e1e7f0;
    --emlaklistem-color-border-control: #e1e7f0;
    --emlaklistem-color-border-input: #e1e7f0;
    --emlaklistem-color-border-control-alt: #e1e7f0;
    --emlaklistem-color-border-ui: #e1e7f0;
    --emlaklistem-color-border-soft: #e1e7f0;
    --emlaklistem-color-border-muted: #e1e7f0;
    --emlaklistem-color-border-panel-soft: #e1e7f0;
    --emlaklistem-color-border-blue-soft: #e1e7f0;
    --emlaklistem-color-border-row: #e1e7f0;
    --emlaklistem-color-primary-alpha-06: rgba(40, 93, 229, .06);
    --emlaklistem-color-primary-alpha-08: rgba(40, 93, 229, .08);
    --emlaklistem-color-primary-alpha-10: rgba(40, 93, 229, .10);
    --emlaklistem-color-primary-alpha-12: rgba(40, 93, 229, .12);
    --emlaklistem-color-primary-alpha-14: rgba(40, 93, 229, .14);
    --emlaklistem-color-primary-alpha-16: rgba(40, 93, 229, .16);
    --emlaklistem-color-primary-alpha-18: rgba(40, 93, 229, .18);
    --emlaklistem-color-primary-alpha-25: rgba(40, 93, 229, .25);
    --emlaklistem-color-primary-alpha-28: rgba(40, 93, 229, .28);
    --emlaklistem-color-primary-alpha-35: rgba(40, 93, 229, .35);
}

:root, .fi-main {
    --primary-50: 239 244 255;
    --primary-100: 231 239 255;
    --primary-200: 199 216 255;
    --primary-300: 157 187 255;
    --primary-400: 102 148 255;
    --primary-500: 53 109 255;
    --primary-600: 40 93 229;
    --primary-700: 33 79 196;
    --primary-800: 30 65 155;
    --primary-900: 25 31 72;
}
html:not(.dark) body.fi-body,
html:not(.dark) .fi-main-ctn {
    background-color: var(--emlaklistem-color-surface-muted) !important;
}
/* Dark navigation is independent from the user's light/dark content setting. */
html body .fi-sidebar,
html body .fi-sidebar.fi-main-sidebar,
html body .fi-sidebar .fi-sidebar-header,
html body .fi-sidebar .fi-sidebar-nav,
html body .fi-sidebar .fi-sidebar-nav-groups,
html body .fi-sidebar .fi-sidebar-footer {
    background-color: var(--emlaklistem-shell-sidebar-bg) !important;
    border-color: var(--emlaklistem-shell-sidebar-border) !important;
}
html body .fi-sidebar.fi-sidebar-open .fi-sidebar-group > .fi-sidebar-group-btn {
    background: var(--emlaklistem-sidebar-hover) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
html body .fi-sidebar.fi-sidebar-open .fi-sidebar-group > .fi-sidebar-group-btn,
html body .fi-sidebar.fi-sidebar-open .fi-sidebar-group > .fi-sidebar-group-btn :is(.fi-sidebar-group-label, .fi-icon, svg),
html body .fi-sidebar .fi-sidebar-item > :is(.fi-sidebar-item-btn, .fi-sidebar-item-button),
html body .fi-sidebar .fi-sidebar-item > :is(.fi-sidebar-item-btn, .fi-sidebar-item-button) :is(svg, .fi-sidebar-item-label),
html body .fi-sidebar .emlaklistem-sidebar-parent-row-link,
html body .fi-sidebar .emlaklistem-sidebar-parent-row-link :is(svg, span),
html body .fi-sidebar .emlaklistem-settings-footer-link {
    color: var(--emlaklistem-sidebar-foreground) !important;
}
html body .fi-sidebar.fi-sidebar-open .fi-sidebar-group > .fi-sidebar-group-btn > .fi-icon {
    background-color: var(--emlaklistem-sidebar-icon-chip-bg) !important;
}
html body .fi-sidebar .fi-sidebar-item > :is(.fi-sidebar-item-btn, .fi-sidebar-item-button):hover {
    background: var(--emlaklistem-sidebar-hover) !important;
}
html body .fi-sidebar .fi-sidebar-item.fi-active > :is(.fi-sidebar-item-btn, .fi-sidebar-item-button),
html body .fi-sidebar :is(.fi-sidebar-item-btn, .fi-sidebar-item-button).fi-active {
    background: var(--emlaklistem-color-primary) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #ffffff !important;
}
html body .fi-sidebar .fi-sidebar-item.fi-active > :is(.fi-sidebar-item-btn, .fi-sidebar-item-button) :is(svg, .fi-sidebar-item-label) {
    color: #ffffff !important;
}
html body .fi-sidebar :is(.fi-sidebar-group-btn, .fi-sidebar-item-btn, .emlaklistem-settings-footer-link):focus-visible {
    outline: 2px solid #9dbbff !important;
    outline-offset: 2px;
}
/* Tenant artwork retains its original colors on a small neutral logo surface. */
html body .fi-sidebar .emlaklistem-brand-logo--wide {
    background: #ffffff;
    border-radius: 6px;
}
html.dark {
    --emlaklistem-dropdown-choice-color: #dce4f5;
    --emlaklistem-text-strong: #dce4f5;
    --emlaklistem-text-muted: #b5c2d8;
    --emlaklistem-color-text: #dce4f5;
    --emlaklistem-color-text-strong: #e6edfa;
    --emlaklistem-color-text-strongest: #e6edfa;
    --emlaklistem-color-text-subtle: #dce4f5;
    --emlaklistem-color-muted: #b5c2d8;
    --emlaklistem-caption-color: #b5c2d8;
    --emlaklistem-color-surface: #182339;
    --emlaklistem-color-surface-muted: #111b2d;
    --emlaklistem-color-surface-soft: #21314d;
    --emlaklistem-color-surface-brand-soft: #243b64;
    --emlaklistem-record-tab-inner-bg: #21314d;
    --emlaklistem-record-tab-level-3-normal-bg: #182339;
    --emlaklistem-record-tab-level-3-active-bg: #243b64;
    --emlaklistem-record-tab-level-3-active-text: #c7d8ff;
    --emlaklistem-record-tab-level-3-hover-bg: #293f61;
    --emlaklistem-record-tab-level-3-strip-bg: #111b2d;
    --emlaklistem-table-list-header-bg: #21314d;
    --emlaklistem-table-list-stripe-bg: #162137;
    --emlaklistem-table-list-hover-bg: #243858;
    --emlaklistem-table-list-active-bg: #243b64;
    --tkr-record-card-bg: #182339;
    --tkr-record-card-border: #344660;
    --tkr-record-field-border: #344660;
    --tkr-record-nav-border: #344660;

    /* Kayit sekme seviyeleri: L2 orta koyu, L3 bir adim acik (bkz. overrides/17). */
    --emlaklistem-record-tab-inner-bg: #1a2540;
    --emlaklistem-record-tab-level-3-strip-bg: #26365a;
}

html body:not(:has(.fi-simple-layout)) .fi-sidebar:not(.fi-sidebar-open) :is(.fi-sidebar-nav, .fi-sidebar-nav-groups) {
    background-color: var(--emlaklistem-shell-sidebar-bg) !important;
}
html body .fi-sidebar .emlaklistem-sidebar-toggle {
    color: var(--emlaklistem-sidebar-foreground) !important;
}
html body .fi-sidebar .fi-sidebar-group-dropdown-trigger-btn {
    background: var(--emlaklistem-sidebar-hover) !important;
    color: var(--emlaklistem-sidebar-foreground) !important;
}
html body .fi-sidebar .fi-sidebar-group-dropdown-trigger-btn > svg {
    color: inherit !important;
}
.emlaklistem-unified-inbox__metric,
.emlaklistem-unified-inbox-card__metrics > div,
.emlaklistem-unified-inbox__row {
    background: var(--emlaklistem-color-surface);
    border-color: var(--tkr-record-card-border);
}

.fi-sidebar {
    --emlaklistem-sidebar-light-surface: var(--emlaklistem-shell-sidebar-bg);
    --emlaklistem-sidebar-surface: var(--emlaklistem-shell-sidebar-bg);
    --emlaklistem-sidebar-light-border: var(--emlaklistem-shell-sidebar-border);
    --emlaklistem-sidebar-border: var(--emlaklistem-shell-sidebar-border);
    --emlaklistem-sidebar-light-brand: #ffffff;
    --emlaklistem-sidebar-light-text: var(--emlaklistem-sidebar-foreground);
    --emlaklistem-sidebar-light-item-text: var(--emlaklistem-sidebar-foreground);
    --emlaklistem-sidebar-light-item-icon: var(--emlaklistem-sidebar-foreground);
    --emlaklistem-sidebar-light-hover-surface: var(--emlaklistem-sidebar-hover);
    --emlaklistem-sidebar-light-hover-text: var(--emlaklistem-sidebar-foreground);
    --emlaklistem-sidebar-light-active-surface: #285de5;
    --emlaklistem-sidebar-light-active-text: #ffffff;
    --emlaklistem-sidebar-icon-chip-bg: rgb(255 255 255 / 8%);
    --emlaklistem-sidebar-icon-chip-hover-bg: rgb(255 255 255 / 12%);
    --emlaklistem-sidebar-icon-chip-active-bg: rgb(255 255 255 / 18%);
    --emlaklistem-sidebar-text: var(--emlaklistem-sidebar-foreground);
}

/* Uploaded dark-surface artwork carries its own transparent background. */
html body .fi-sidebar .emlaklistem-brand-logo--wide.emlaklistem-brand-logo--dark-surface {
    background: transparent;
}

/* Record tab containers (23.09.2026, light mode): level 2 sits on the darker tone, level 3 on the
   lighter one; resting tabs are white on both. Hovers differ from their own container. */
html:not(.dark) {
    --emlaklistem-record-tab-inner-bg: #dce4f5;
    --emlaklistem-record-tab-level-3-strip-bg: #eaf0fc;
    --emlaklistem-record-tab-inner-hover-bg: #eaf0fc;
    --emlaklistem-record-tab-level-3-hover-bg: #dce4f5;
}

/* L2 kapsayici: uretilmis `karanlik-esler/04.css` bu ogeyi sabit
   `--emlaklistem-dark-surface-raised` ile boyayip temanin jetonunu eziyor.
   `html.dark …` (0,3,1) oradaki `:where(.dark) …` seciciden (0,2,0) daha ozgul. */
html.dark .emlaklistem-record-inner-tabs > .fi-tabs,
html.dark .emlaklistem-tab-scope--inner > .fi-tabs {
    background: var(--emlaklistem-record-tab-inner-bg) !important;
}
