/* ============================================================================
   Medikal ERP — Pro UI (ERP Maestro inspired)
   Light: temiz beyaz sidebar + indigo aksan
   Dark: nötr grafit + mavi aksan — tokenlar theme.css
   ============================================================================ */

:root {
    --merp-font-sans: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --merp-nav-link-size: 13px;
    --merp-nav-link-weight: 500;
    --merp-nav-label-size: 12px;
    --merp-nav-label-weight: 700;
    --merp-nav-label-spacing: 0.07em;
    --rail-width: 54px;
    --flyout-width: 232px;
    --rail-drawer-width: 272px;
    --sidebar-width: 248px;
    --pro-indigo: #4b59a7;
    --pro-indigo-dark: #3d4889;
    --pro-indigo-light: #eef0f8;
    --pro-rail-bg: #3d4889;
    --pro-flyout-bg: #ffffff;
    --pro-flyout-border: #dde2ec;
    --pro-flyout-head-bg: #f8f9fc;
    --pro-flyout-text: #334155;
    --pro-flyout-head-text: #4b59a7;
    --pro-flyout-muted: #64748b;
}

/* ---- Light: profesyonel palet ---- */
html[data-theme="light"] .merp-ui,
html:not([data-theme="dark"]):not([data-theme="classic"]) .merp-ui {
    --merp-navy: #2d3561;
    --merp-navy-mid: #4b59a7;
    --merp-primary: #4b59a7;
    --merp-primary-hover: #3d4889;
    --merp-accent: #5c6bc0;
    --merp-bg: #eceef4;
    --merp-surface: #ffffff;
    --merp-muted: #f5f6fa;
    --merp-border: #dde2ec;
    --merp-text: #1e293b;
    --merp-text-muted: #586579;
    --merp-shadow: 0 1px 3px rgba(45, 53, 97, 0.06), 0 4px 16px rgba(45, 53, 97, 0.05);
    --merp-shadow-lg: 0 8px 28px rgba(45, 53, 97, 0.12);
    --surface: #ffffff;
    --border: #dde2ec;
    --sidebar-bg: #ffffff;
    --sidebar-bg-elevated: #f8f9fc;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #64748b;
    --sidebar-text-muted: #94a3b8;
    --sidebar-text-active: #2d3561;
    --sidebar-accent: #4b59a7;
    --sidebar-accent-hover: #3d4889;
    --sidebar-active-bg: #eef0f8;
    --sidebar-hover-bg: #f5f6fa;
}

html[data-theme="light"] .merp-ui,
html:not([data-theme="dark"]):not([data-theme="classic"]) .merp-ui {
    background: var(--merp-bg);
    background-image: none;
}

html[data-theme="light"] body,
html:not([data-theme="dark"]):not([data-theme="classic"]) body {
    background: var(--merp-bg);
    color: var(--merp-text);
}

.merp-ui {
    font-family: var(--merp-font-sans);
}

/* ---- İkon şeridi + flyout ---- */
.sidebar-rail {
    display: none;
    flex-direction: column;
    align-items: center;
    width: var(--rail-width);
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 10px 0 8px;
    background: var(--pro-rail-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    z-index: var(--merp-z-rail, 1050);
}

.sidebar-rail-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none;
}

.sidebar-rail-logo img,
.sidebar-rail-logo-img {
    width: 32px;
    height: 32px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-rail-icons {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    min-height: 0;
    padding: 6px 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-rail-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 8px 0 4px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-rail-btn--footer.is-active,
.sidebar-rail-btn--footer.is-open {
    background: rgba(255, 255, 255, 0.18);
}

.sidebar-rail-icons::-webkit-scrollbar {
    display: none;
}

.sidebar-rail-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sidebar-rail-mail-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    min-width: 1rem;
    height: 1rem;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(30, 27, 75, 0.95);
    pointer-events: none;
    transform: translate(25%, -25%);
}

.sidebar-rail-mail-badge[hidden] {
    display: none !important;
}

.sidebar-rail-link,
.sidebar-rail-logo {
    color: rgba(255, 255, 255, 0.72);
}

.sidebar-rail-link {
    display: flex;
}

.sidebar-rail-link:hover,
.sidebar-rail-logo:hover {
    color: #fff;
    text-decoration: none;
}

.sidebar-rail-link.is-active {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.sidebar-rail-btn:hover,
.sidebar-rail-btn.is-open {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    text-decoration: none;
}

.sidebar-rail-btn.is-active {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.sidebar-rail-mode-btn,
.sidebar-tools,
.sidebar-mode-btn {
    display: none !important;
}

.sidebar-rail-svg,
.sidebar-link-icon .sidebar-svg {
    display: block;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    flex-shrink: 0;
    overflow: visible;
    pointer-events: none;
}

.sidebar-rail-btn .sidebar-rail-svg,
.sidebar-rail-link .sidebar-rail-svg,
.sidebar-link-icon .sidebar-svg {
    color: inherit;
    opacity: 1;
}

.sidebar-rail-btn .sidebar-rail-svg path,
.sidebar-rail-btn .sidebar-rail-svg rect,
.sidebar-rail-btn .sidebar-rail-svg circle,
.sidebar-rail-link .sidebar-rail-svg path,
.sidebar-rail-link .sidebar-rail-svg rect,
.sidebar-rail-link .sidebar-rail-svg circle,
.sidebar-link-icon .sidebar-svg path,
.sidebar-link-icon .sidebar-svg rect,
.sidebar-link-icon .sidebar-svg circle {
    stroke: currentColor;
    vector-effect: non-scaling-stroke;
}

.sidebar-rail-item {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
}

.sidebar-rail-flyouts {
    position: fixed;
    inset: 0;
    z-index: var(--merp-z-rail-flyout, 1350);
    pointer-events: none;
}

.sidebar-rail-flyout-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.sidebar-rail-flyout-backdrop:not([hidden]) {
    opacity: 1;
}

.sidebar-rail-flyout-backdrop[hidden] {
    display: none !important;
}

.sidebar-rail-flyout {
    position: fixed;
    left: var(--rail-width);
    width: var(--flyout-width);
    max-height: min(70vh, 480px);
    display: flex;
    flex-direction: column;
    border-radius: 0 12px 12px 0;
    background: var(--pro-flyout-bg);
    border: 1px solid var(--pro-flyout-border);
    box-shadow: 12px 12px 40px rgba(29, 35, 80, 0.18);
    pointer-events: auto;
    overflow: hidden;
    z-index: calc(var(--merp-z-rail-flyout, 1350) + 1);
}

.sidebar-rail-flyout--drawer {
    top: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    width: var(--rail-drawer-width, 272px);
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    box-shadow: 8px 0 32px rgba(29, 35, 80, 0.14);
    transform: translateX(-12px);
    opacity: 0;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.sidebar-rail-flyout--drawer.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.sidebar-rail-flyout[hidden] {
    display: none !important;
}

.sidebar-rail-flyout-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 12px 16px;
    color: var(--pro-flyout-head-text);
    background: var(--pro-flyout-head-bg);
    border-bottom: 1px solid var(--pro-flyout-border);
    flex-shrink: 0;
}

.sidebar-rail-flyout-head-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sidebar-rail-flyout-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--pro-flyout-border);
    border-radius: 8px;
    background: var(--pro-flyout-bg);
    color: var(--pro-flyout-muted, #64748b);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-rail-flyout-close:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.sidebar-rail-flyout-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.sidebar-rail-flyout-hint {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.35;
    color: #64748b;
    text-transform: none;
}

.sidebar-rail-flyout-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 0 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.rail-flyout-drawers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 8px;
}

.rail-flyout-drawer {
    border: 1px solid var(--pro-flyout-border);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.65);
    overflow: hidden;
}

.rail-flyout-drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.rail-flyout-drawer-toggle:hover {
    background: rgba(241, 245, 249, 0.9);
    color: #1e293b;
}

.rail-flyout-drawer.is-open > .rail-flyout-drawer-toggle {
    color: var(--pro-flyout-head-text);
    background: rgba(232, 235, 245, 0.75);
}

.rail-flyout-drawer-label {
    flex: 1;
    min-width: 0;
}

.rail-flyout-drawer-chevron {
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
    flex-shrink: 0;
    opacity: 0.7;
}

.rail-flyout-drawer.is-open .rail-flyout-drawer-chevron {
    transform: rotate(-135deg);
}

.rail-flyout-drawer-panel {
    padding: 2px 0 6px;
    border-top: 1px solid rgba(221, 226, 236, 0.85);
}

.rail-flyout-drawer-panel[hidden] {
    display: none !important;
}

.rail-flyout-flat-links {
    display: flex;
    flex-direction: column;
    padding: 0 4px;
}

.sidebar-rail-flyout--drawer .sidebar-rail-flyout-link {
    padding: 8px 12px 8px 14px;
    margin: 0 6px;
    border-radius: 8px;
    border-left: none;
}

.sidebar-rail-flyout--drawer .sidebar-rail-flyout-link.is-active {
    border-left: none;
    box-shadow: inset 3px 0 0 var(--pro-indigo, #4b59a7);
}

.sidebar-rail-flyout-section-label {
    padding: 10px 16px 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.sidebar-rail-flyout-section-label:first-child {
    padding-top: 6px;
}

.sidebar-subsection {
    margin-bottom: 2px;
}

.sidebar-subsection-label {
    padding: 10px 14px 4px 2.25rem;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.sidebar-subsection-label:first-child {
    padding-top: 4px;
}

.sidebar-group-items--accordion {
    padding-left: 4px;
}

.sidebar-subgroup {
    margin: 1px 0 3px;
}

.sidebar-subgroup-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px 8px 1.35rem;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-subgroup-toggle:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

.sidebar-subgroup.is-open > .sidebar-subgroup-toggle {
    color: var(--sidebar-text-active);
}

.sidebar-subgroup-label {
    flex: 1;
    min-width: 0;
}

.sidebar-chevron--sm {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    opacity: 0.65;
}

.sidebar-subgroup.is-open .sidebar-chevron--sm {
    transform: rotate(45deg);
}

.sidebar-subgroup-items {
    display: none;
    padding: 0 0 4px 1.5rem;
}

.sidebar-subgroup.is-open .sidebar-subgroup-items {
    display: block;
}

.sidebar-subgroup .sidebar-link-nested {
    padding-left: 10px;
}

html[data-theme="dark"] .sidebar-subgroup-toggle {
    color: #94a3b8;
}

html[data-theme="dark"] .sidebar-subgroup.is-open > .sidebar-subgroup-toggle {
    color: #e2e8f0;
}

.sidebar-scroll .sidebar-nav {
    min-height: 100%;
}

.sidebar-group--footer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .sidebar-group--footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.sidebar-rail-flyout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 18px;
    font-size: var(--merp-nav-link-size);
    font-weight: var(--merp-nav-link-weight);
    color: var(--pro-flyout-text);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    border-left: 3px solid transparent;
}

.sidebar-rail-flyout-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.82;
}

.sidebar-rail-flyout-link-icon .sidebar-svg,
.sidebar-rail-flyout-svg {
    width: 18px;
    height: 18px;
}

.sidebar-rail-flyout-link-text {
    min-width: 0;
}

.sidebar-rail-flyout-link:hover {
    background: #f1f5f9;
    color: #1e293b;
    text-decoration: none;
}

.sidebar-rail-flyout-link.is-active {
    background: #e8ebf5;
    color: #2d3561;
    font-weight: 600;
    border-left-color: #714b67;
}

html[data-theme="dark"] .sidebar-rail-flyout-head {
    color: var(--pro-flyout-head-text);
    background: var(--pro-flyout-head-bg);
    border-bottom-color: var(--pro-flyout-border);
}

/* Nav modu: rail vs classic sidebar */
@media (min-width: 768px) {
    html[data-nav-mode="rail"] .sidebar {
        display: none !important;
    }

    html[data-nav-mode="classic"] .sidebar-rail,
    html[data-nav-mode="classic"] .sidebar-rail-flyouts {
        display: none !important;
    }
}

/* Sidebar logo — çerçevesiz */
.sidebar-brand {
    flex-direction: row;
    align-items: center;
    gap: 0;
}

.sidebar-logo-wrap {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: auto !important;
}

.sidebar-logo {
    max-height: 40px;
}

.sidebar-mode-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: 1px solid var(--sidebar-border, rgba(148, 163, 184, 0.2));
    border-radius: 8px;
    background: transparent;
    color: var(--sidebar-text, #94a3b8);
    cursor: pointer;
}

.sidebar-mode-btn:hover {
    background: var(--sidebar-hover-bg, rgba(255, 255, 255, 0.06));
    color: var(--sidebar-text-active, #f8fafc);
}

html[data-nav-mode="classic"] .sidebar-tools,
html[data-nav-mode="classic"] .sidebar-mode-btn,
.sidebar-rail-mode-btn {
    display: none !important;
}

@media (min-width: 768px) {
    html[data-nav-mode="classic"] .sidebar-tools,
    html[data-nav-mode="classic"] .sidebar-mode-btn {
        display: none !important;
    }
}

.sidebar-brand-block .sidebar-brand {
    flex: 1;
    min-width: 0;
}

.sidebar-close {
    position: absolute;
    top: 14px;
    right: 12px;
}

/* ---- Sidebar: light = beyaz panel ---- */
html[data-theme="light"] .sidebar,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar {
    background: #fff;
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: none;
}

html[data-theme="light"] .sidebar-brand-block,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-brand-block {
    background: #fff;
    border-bottom-color: var(--sidebar-border);
}

html[data-theme="light"] .sidebar-group-toggle,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-group-toggle {
    color: #475569;
    font-size: var(--merp-nav-label-size);
    font-weight: var(--merp-nav-label-weight);
    letter-spacing: var(--merp-nav-label-spacing);
    text-transform: uppercase;
}

html[data-theme="light"] .sidebar-group-toggle:hover,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-group-toggle:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

html[data-theme="light"] .sidebar-link,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-link {
    color: #475569;
    font-size: var(--merp-nav-link-size);
    font-weight: var(--merp-nav-link-weight);
}

html[data-theme="light"] .sidebar-section > .sidebar-link,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-section > .sidebar-link {
    font-size: var(--merp-nav-label-size);
    font-weight: var(--merp-nav-label-weight);
    letter-spacing: var(--merp-nav-label-spacing);
    text-transform: uppercase;
}

html[data-theme="light"] .sidebar-link:hover,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--pro-indigo);
}

html[data-theme="light"] .sidebar-link.is-active,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-link.is-active,
html[data-theme="light"] .sidebar-link-nested.is-active,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-link-nested.is-active {
    background: var(--sidebar-active-bg);
    color: var(--pro-indigo);
    font-weight: 600;
}

html[data-theme="light"] .sidebar-link-nested,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-link-nested {
    color: #64748b;
    font-size: 12px;
}

html[data-theme="light"] .sidebar-theme,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-theme {
    background: #fafbfc;
    border-top-color: var(--sidebar-border);
}

html[data-theme="light"] .sidebar-close,
html:not([data-theme="dark"]):not([data-theme="classic"]) .sidebar-close {
    background: var(--merp-muted);
    color: #64748b;
}

html[data-theme="light"] .merp-ui .sidebar-link.is-active,
html:not([data-theme="dark"]):not([data-theme="classic"]) .merp-ui .sidebar-link.is-active,
html[data-theme="light"] .merp-ui .sidebar-link-nested.is-active,
html:not([data-theme="dark"]):not([data-theme="classic"]) .merp-ui .sidebar-link-nested.is-active {
    background: var(--sidebar-active-bg);
    color: var(--pro-indigo);
}

/* ---- Topbar ---- */
.merp-ui .topbar {
    background: var(--merp-surface);
    border-bottom: 1px solid var(--merp-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 0 16px;
    min-height: var(--merp-topbar-height, 56px);
    height: var(--merp-topbar-height, 56px);
    box-sizing: border-box;
    flex-wrap: nowrap;
    gap: 8px;
}

.merp-ui .topbar::after {
    height: 2px;
    background: linear-gradient(90deg, var(--pro-indigo-dark) 0%, var(--pro-indigo) 50%, #7c8fd4 100%);
    opacity: 0.85;
}

/* Sayfa başlıkları içerik alanında; üst çubukta modül bağlamı gösterilir */
.topbar-heading {
    display: none;
}

.merp-ui .topbar-context-icon {
    background: color-mix(in srgb, var(--pro-indigo) 12%, var(--merp-surface));
    color: var(--pro-indigo-dark);
}

.merp-ui .topbar-context-module {
    color: var(--merp-text-muted);
}

.merp-ui a.topbar-context-module:hover {
    color: var(--pro-indigo);
}

.merp-ui .topbar-context-page {
    color: var(--merp-navy);
    letter-spacing: -0.02em;
}

.merp-ui .topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--merp-navy);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ---- Kabuk scrollport: document kaymasın, yalnızca .app-content ---- */
html:has(body.merp-ui) {
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

body.merp-ui {
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

.merp-ui .app-shell {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

/* ---- Kartlar & sayfa ---- */
.merp-ui .app-content {
    padding: 0 16px 16px;
    padding-top: 0;
}

html.midas-native-app.merp-ui .app-content {
    padding: 0 0 calc(8px + env(safe-area-inset-bottom, 0px));
}

html.midas-native-app.merp-ui .app-page {
    padding: 0;
    max-width: none;
}

html.midas-native-app.merp-ui .app-main {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.merp-ui .app-content:has(.einv-desk-v2),
.merp-ui .app-content:has(.list-page-card),
.merp-ui .app-content:has(.acc-page-wrap),
.merp-ui .app-content:has(.acc-hub),
.merp-ui .app-content:has(.reports-hub),
.merp-ui .app-content:has(> .app-page > .acc-hub-nav),
.merp-ui .app-content:has(> .app-page > .acc-report-shell) {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: calc(var(--merp-pagination-dock-h, 38px) + 8px);
}

.merp-ui .app-content:has(.cfm-shell) {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.merp-ui .page-header {
    border-left-color: var(--pro-indigo);
    border-radius: 8px;
    padding: 22px 24px;
}

.merp-ui .app-content:has(.list-page-card) .page-header,
.merp-ui .app-content:has(.acc-page-wrap) .page-header {
    padding: 12px var(--merp-edge-pad, 12px);
    border-radius: 0;
    border-left: none;
    margin-bottom: 0;
    box-shadow: none;
    background: transparent;
}

.merp-ui .page-title {
    color: var(--merp-navy);
    font-size: 1.5rem;
}

.merp-ui .card {
    border-radius: 8px;
    border-color: var(--merp-border);
    box-shadow: none;
}

.merp-ui .card-header {
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
    padding: 14px 20px;
}

.merp-ui .card-title {
    color: var(--merp-navy-mid);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.merp-ui .stat-card::before {
    display: none;
}

.merp-ui .stat-value {
    color: var(--merp-navy);
}

.merp-ui .btn-primary {
    background: var(--pro-indigo, #4b59a7);
    border-color: transparent;
    box-shadow: none;
}

.merp-ui .btn-primary:hover {
    background: var(--pro-indigo-dark, #3d4889);
}

.merp-ui .table-wrap {
    border-radius: 8px;
    border-color: var(--merp-border);
}

.merp-ui .table thead th {
    background: #f0f2f8;
    color: var(--merp-navy-mid);
    font-size: 10px;
    letter-spacing: 0.08em;
}

.merp-ui .tabs {
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.merp-ui .tab.is-active {
    background: transparent;
    color: var(--pro-indigo);
    border-color: var(--pro-indigo);
    box-shadow: none;
    font-weight: 600;
}

/* ---- Dashboard ---- */
.merp-ui .dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 24px 26px;
    background: var(--merp-surface);
    border: 1px solid var(--merp-border);
    border-radius: 8px;
    box-shadow: none;
    border-left: 4px solid var(--pro-indigo);
}

.merp-ui .dashboard-hero-greeting {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--merp-text-muted);
}

.merp-ui .dashboard-hero-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--merp-navy);
    letter-spacing: -0.03em;
}

.merp-ui .dashboard-hero-sub {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--merp-text-muted);
}

.merp-ui .dashboard-quick-card {
    border-radius: 8px;
    border-color: var(--merp-border);
}

.merp-ui .dashboard-quick-card::before {
    background: var(--pro-indigo);
}

.merp-ui .dashboard-finance-card,
.merp-ui .dashboard-alert {
    border-radius: 8px;
}

.merp-ui .dashboard-chart-card .card-header {
    background: #fafbfc;
}

.merp-ui .dashboard-chart-badge {
    background: var(--pro-indigo-light);
    color: var(--pro-indigo);
}

/* ---- Auth ---- */
html[data-theme="light"] .auth-body,
html:not([data-theme="dark"]):not([data-theme="classic"]) .auth-body {
    background: #0b1020;
}

html[data-theme="light"] .auth-card,
html:not([data-theme="dark"]):not([data-theme="classic"]) .auth-card {
    border: 1px solid var(--merp-border);
    box-shadow: none;
}

/* ---- Tablet+ kabuk: ikon şeridi ---- */
@media (min-width: 768px) {
    .merp-ui .app-shell {
        align-items: stretch;
    }

    html[data-nav-mode="rail"] .sidebar-rail {
        display: flex;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        width: var(--rail-width);
    }

    html[data-nav-mode="rail"] .app-main {
        margin-left: var(--rail-width);
        width: calc(100% - var(--rail-width));
        max-width: calc(100% - var(--rail-width));
    }

    /* Tablet (768–1023): ikon şeridi gizli → ana alan tam genişlik (sağda boş şerit kalmasın).
       Tüm sayfalarda yüklenen dosyada olmalı; posta gibi list-chrome yüklemeyen ekranlar da var. */
    @media (max-width: 1023px) {
        html[data-nav-mode="rail"] .app-main {
            margin-left: 0;
            width: 100%;
            max-width: 100%;
        }
    }

    html.midas-native-app .sidebar-rail {
        top: var(--merp-safe-top, 0px);
        height: calc(100vh - var(--merp-safe-top, 0px) - var(--merp-safe-bottom, 0px));
        height: calc(100dvh - var(--merp-safe-top, 0px) - var(--merp-safe-bottom, 0px));
        max-height: calc(100vh - var(--merp-safe-top, 0px) - var(--merp-safe-bottom, 0px));
        max-height: calc(100dvh - var(--merp-safe-top, 0px) - var(--merp-safe-bottom, 0px));
    }

    html[data-nav-mode="rail"] .sidebar,
    html[data-nav-mode="rail"] .sidebar.is-open {
        inset-inline-start: var(--rail-width);
    }

    html[data-nav-mode="rail"] .sidebar-overlay,
    html[data-nav-mode="rail"] .sidebar-overlay.is-open {
        left: var(--rail-width);
    }

    .sidebar {
        width: var(--sidebar-width);
    }
}

/* ============================================================================
   Dark mode — bileşen stilleri (tokenlar theme.css)
   ============================================================================ */
html[data-theme="dark"] .merp-ui {
    background: var(--merp-bg);
    background-image:
        radial-gradient(ellipse 85% 55% at 100% -12%, rgba(59, 130, 246, 0.05), transparent 52%),
        radial-gradient(ellipse 55% 40% at 0% 100%, rgba(30, 90, 158, 0.04), transparent 48%);
    background-attachment: fixed;
}

/* ---- Sidebar & rail ---- */
html[data-theme="dark"] .sidebar-rail {
    background: var(--pro-rail-bg);
    border-right-color: var(--dark-border);
}

html[data-theme="dark"] .sidebar-rail-btn {
    color: var(--sidebar-text);
}

html[data-theme="dark"] .sidebar-rail-btn:hover,
html[data-theme="dark"] .sidebar-rail-btn.is-open {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

html[data-theme="dark"] .sidebar-rail-link.is-active,
html[data-theme="dark"] .sidebar-rail-btn.is-active {
    background: var(--sidebar-active-bg);
    color: var(--merp-accent);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

html[data-theme="dark"] .sidebar-rail-mode-btn {
    background: rgba(255, 255, 255, 0.04);
    color: var(--sidebar-text);
}

html[data-theme="dark"] .sidebar-rail-mode-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--sidebar-text-active);
}

html[data-theme="dark"] .sidebar-rail-flyout-backdrop {
    background: rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .sidebar-rail-flyout-close {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--pro-flyout-border);
    color: var(--pro-flyout-muted);
}

html[data-theme="dark"] .sidebar-rail-flyout-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text-active);
}

html[data-theme="dark"] .rail-flyout-drawer {
    background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .rail-flyout-drawer-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-text-active);
}

html[data-theme="dark"] .rail-flyout-drawer.is-open > .rail-flyout-drawer-toggle {
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text-active);
}

html[data-theme="dark"] .rail-flyout-drawer-panel {
    border-top-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .sidebar-rail-flyout {
    background: var(--pro-flyout-bg);
    border-color: var(--pro-flyout-border);
    box-shadow: 12px 12px 40px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .sidebar-rail-flyout--drawer {
    box-shadow: 8px 0 36px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .sidebar-rail-flyout-hint {
    color: var(--sidebar-text);
    opacity: 0.65;
}

html[data-theme="dark"] .sidebar-rail-flyout-section-label,
html[data-theme="dark"] .sidebar-subsection-label {
    color: var(--merp-text-muted, #94a3b8);
}

html[data-theme="dark"] .sidebar-rail-flyout-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

html[data-theme="dark"] .sidebar-rail-flyout-link.is-active {
    background: var(--sidebar-active-bg);
    color: var(--merp-accent);
    border-left-color: var(--merp-accent);
}

html[data-theme="dark"] .sidebar {
    background: var(--sidebar-bg);
    border-right-color: var(--sidebar-border);
    box-shadow: none;
}

html[data-theme="dark"] .sidebar-brand-block {
    background: rgba(255, 255, 255, 0.02);
    border-bottom-color: var(--dark-border);
}

html[data-theme="dark"] .sidebar-logo-wrap {
    background: rgba(255, 255, 255, 0.95);
}

html[data-theme="dark"] .sidebar-group-toggle {
    color: var(--merp-text-label);
}

html[data-theme="dark"] .sidebar-group-toggle:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

html[data-theme="dark"] .sidebar-link,
html[data-theme="dark"] .sidebar-link-nested {
    color: var(--sidebar-text);
}

html[data-theme="dark"] .sidebar-link:hover,
html[data-theme="dark"] .sidebar-link-nested:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

html[data-theme="dark"] .sidebar-link.is-active,
html[data-theme="dark"] .sidebar-link-nested.is-active,
html[data-theme="dark"] .merp-ui .sidebar-link.is-active,
html[data-theme="dark"] .merp-ui .sidebar-link-nested.is-active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    box-shadow: inset 3px 0 0 var(--merp-primary);
}

html[data-theme="dark"] .sidebar-theme {
    background: rgba(255, 255, 255, 0.02);
    border-top-color: var(--dark-border);
}

html[data-theme="dark"] .sidebar-theme-label {
    color: var(--sidebar-text-muted);
}

html[data-theme="dark"] .theme-switch--sidebar {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .theme-switch--sidebar .theme-switch-btn {
    color: var(--sidebar-text);
}

html[data-theme="dark"] .theme-switch--sidebar .theme-switch-btn:hover {
    color: var(--sidebar-text-active);
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .theme-switch--sidebar .theme-switch-btn.is-active {
    background: rgba(59, 130, 246, 0.16);
    color: var(--sidebar-text-active);
    box-shadow: none;
}

/* ---- Topbar ---- */
html[data-theme="dark"] .merp-ui .topbar {
    background: var(--dark-surface);
    border-bottom: 1px solid var(--dark-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .merp-ui .topbar::after {
    height: 2px;
    opacity: 0.85;
    background: linear-gradient(90deg, #1e5a9e 0%, #3b82f6 55%, #60a5fa 100%);
}

html[data-theme="dark"] .merp-ui .topbar-title {
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .topbar-hamburger {
    color: var(--merp-text, #e5e7eb);
}
html[data-theme="dark"] .merp-ui .topbar-hamburger span {
    background: currentColor;
}

html[data-theme="dark"] .merp-ui .topbar-actions {
    background: color-mix(in srgb, var(--dark-surface) 80%, transparent);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .merp-ui .topbar-search-field {
    background: var(--dark-surface);
    border-color: var(--dark-border);
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .topbar-search-field:focus-within {
    background: var(--ctl-field, #1f2937);
    border-color: var(--ctl-line, #374151);
}

html[data-theme="dark"] .merp-ui .topbar-quick-menu-toggle {
    background: var(--dark-surface);
    border-color: var(--dark-border);
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .topbar-quick-menu-panel {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .merp-ui .topbar-quick-menu-item {
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .topbar-quick-menu-item:hover {
    background: var(--dark-surface);
    border-color: var(--dark-border);
}

/* ---- Kartlar ---- */
html[data-theme="dark"] .merp-ui .card,
html[data-theme="dark"] .merp-ui .stat-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    box-shadow: none;
}

html[data-theme="dark"] .merp-ui .card:hover,
html[data-theme="dark"] .merp-ui a.stat-card:hover {
    transform: none;
    border-color: var(--dark-border-accent);
    background: var(--dark-card-hover);
    box-shadow: none;
}

html[data-theme="dark"] .merp-ui .card-header {
    background: transparent;
    border-bottom-color: var(--dark-border);
}

html[data-theme="dark"] .merp-ui .card-title {
    color: var(--merp-text-label);
}

html[data-theme="dark"] .merp-ui .card-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top-color: var(--dark-border);
}

html[data-theme="dark"] .merp-ui .stat-card::before {
    background: linear-gradient(90deg, #1e5a9e, #3b82f6);
}

html[data-theme="dark"] .merp-ui .stat-value {
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .stat-label {
    color: var(--merp-text-muted);
}

/* ---- Dashboard header ---- */
html[data-theme="dark"] .merp-ui .dashboard-hero {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-left: 3px solid var(--merp-primary);
    box-shadow: none;
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .dashboard-hero-greeting {
    color: var(--merp-text-label);
    opacity: 1;
}

html[data-theme="dark"] .merp-ui .dashboard-hero-title {
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .dashboard-hero-sub {
    color: var(--merp-text-muted);
    opacity: 1;
}

/* ---- Hızlı erişim (glass) ---- */
html[data-theme="dark"] .merp-ui .dashboard-quick-access {
    background: var(--ctl-field, #1f2937);
    border: 1px solid var(--dark-border);
    box-shadow: none;
}

html[data-theme="dark"] .merp-ui .dashboard-quick-access-title {
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .dashboard-quick-access-settings {
    color: var(--merp-accent);
}

html[data-theme="dark"] .merp-ui .dashboard-quick-access-settings:hover {
    color: var(--merp-primary-hover);
}

html[data-theme="dark"] .merp-ui .dashboard-quick-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--dark-border);
    color: var(--merp-text);
    box-shadow: none;
}

html[data-theme="dark"] .merp-ui .dashboard-quick-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--dark-border-accent);
    box-shadow: none;
}

html[data-theme="dark"] .merp-ui .dashboard-quick-label {
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .dashboard-quick-arrow {
    color: var(--merp-text-muted);
    opacity: 0.7;
}

/* ---- Finans & uyarı kartları ---- */
html[data-theme="dark"] .merp-ui .dashboard-finance-card,
html[data-theme="dark"] .merp-ui .dashboard-alert {
    background: linear-gradient(180deg, var(--dark-card) 0%, var(--dark-surface) 100%);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .merp-ui .dashboard-finance-card:hover,
html[data-theme="dark"] .merp-ui .dashboard-alert:hover {
    border-color: var(--dark-border-accent);
}

html[data-theme="dark"] .merp-ui .dashboard-finance-label,
html[data-theme="dark"] .merp-ui .dashboard-section-title {
    color: var(--merp-text-muted);
}

html[data-theme="dark"] .merp-ui .dashboard-finance-value {
    color: var(--merp-text);
    font-weight: 800;
}

html[data-theme="dark"] .merp-ui .dashboard-finance-positive {
    color: var(--merp-success);
}

html[data-theme="dark"] .merp-ui .dashboard-finance-negative {
    color: var(--merp-danger);
}

html[data-theme="dark"] .merp-ui .dashboard-alert-body strong {
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .dashboard-alert-body small,
html[data-theme="dark"] .merp-ui .dashboard-alert-arrow {
    color: var(--merp-text-muted);
}

html[data-theme="dark"] .merp-ui .dashboard-alert-warning .dashboard-alert-count {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

html[data-theme="dark"] .merp-ui .dashboard-alert-info .dashboard-alert-count {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

html[data-theme="dark"] .merp-ui .dashboard-alert-danger .dashboard-alert-count {
    background: rgba(239, 68, 68, 0.15);
    color: var(--merp-danger);
}

/* ---- Grafik alanı ---- */
html[data-theme="dark"] .merp-ui .dashboard-chart-card .card-header {
    background: var(--merp-surface);
}

html[data-theme="dark"] .merp-ui .dashboard-chart-badge {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 999px;
    padding: 5px 10px;
}

html[data-theme="dark"] .merp-ui .dashboard-chart-badge-pie {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.18);
}

/* ---- Butonlar & tablo ---- */
html[data-theme="dark"] .merp-ui .btn-primary {
    background: #3b82f6;
    border-color: transparent;
    box-shadow: none;
}

html[data-theme="dark"] .merp-ui .btn-primary:hover {
    background: #2563eb;
    box-shadow: none;
    color: #fff;
}

html[data-theme="dark"] .list-columns-panel,
html[data-theme="dark"] .einv-columns-panel {
    background: var(--dark-card, var(--merp-surface));
    border-color: var(--dark-border, var(--merp-border));
}

html[data-theme="dark"] .einv-columns-head {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: var(--dark-border, var(--merp-border));
}

html[data-theme="dark"] .einv-columns-title {
    color: var(--merp-text);
}

html[data-theme="dark"] .einv-columns-actions {
    background: var(--dark-card, var(--merp-surface));
    border-top-color: var(--dark-border, var(--merp-border));
}

html[data-theme="dark"] .einv-columns-panel label.einv-col-check:hover {
    color: var(--merp-text);
}

html[data-theme="dark"] .list-col-check {
    color: var(--merp-text);
}

html[data-theme="dark"] .list-col-check:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .table thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--merp-text-label);
    border-bottom-color: var(--dark-border);
}

html[data-theme="dark"] .merp-ui .table tbody td {
    border-bottom-color: var(--dark-border);
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .table tbody tr:hover {
    background: var(--ctl-btn-hover, #4b5563);
}

html[data-theme="dark"] .merp-ui .tabs {
    background: transparent;
}

html[data-theme="dark"] .merp-ui .tab.is-active {
    color: var(--merp-accent);
    background: transparent;
    border-color: var(--merp-accent);
    box-shadow: none;
}

html[data-theme="dark"] .merp-ui .page-header {
    background: var(--dark-surface);
    border-color: var(--dark-border);
    border-left-color: var(--merp-primary);
}

html[data-theme="dark"] .merp-ui .page-title {
    color: var(--merp-text);
}

html[data-theme="dark"] .merp-ui .page-subtitle {
    color: var(--merp-text-muted);
}

html[data-theme="dark"] .merp-ui .stat-card-link:hover,
html[data-theme="dark"] .merp-ui .dashboard-kpi-card:hover {
    border-color: var(--dark-border);
}

html[data-theme="dark"] .merp-ui .stat-value-sm {
    color: var(--merp-text);
    font-weight: 800;
}

/* ============================================================================
   Kenar çubuğu 2026-11: ikon altında etiket, yumuşak vurgu, çakışmayan rozet
   Klasik tema kendi şerit görünümünü korur.
   ============================================================================ */

html:not([data-theme="classic"]) {
    --rail-width: 68px;
}

html[data-theme="classic"] .sidebar-rail-label {
    display: none;
}

html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-icons {
    gap: 2px;
    padding: 4px 0;
}

html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-btn {
    flex-direction: column;
    gap: 3px;
    width: 58px;
    height: auto;
    min-height: 48px;
    padding: 6px 2px 5px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
}

html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
}

html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 550;
    line-height: 1.15;
    letter-spacing: 0;
    color: inherit;
    pointer-events: none;
}

html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-btn:hover,
html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-btn.is-open {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: none;
}

html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-btn.is-active,
html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-link.is-active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: none;
}

/* Etkin bölüm: solda ince işaret çizgisi */
html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-btn.is-active::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -5px;
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: #fff;
    transform: translateY(-50%);
}

html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: -2px;
}

/* Koyu temanın genel bağlantı rengi (mavi) şerit bağlantılarına da uygulanıyordu */
html:not([data-theme="classic"]) .sidebar-rail a.sidebar-rail-btn {
    color: rgba(255, 255, 255, 0.7) !important;
}

html:not([data-theme="classic"]) .sidebar-rail a.sidebar-rail-btn:hover,
html:not([data-theme="classic"]) .sidebar-rail a.sidebar-rail-btn.is-active {
    color: #fff !important;
}

/* E-posta rozeti: ikonun sağ üstünde, şerit dışına taşmadan */
html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-mail-badge {
    top: 2px;
    right: 6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 17px;
    font-variant-numeric: tabular-nums;
    transform: none;
    box-shadow: 0 0 0 2px var(--pro-rail-bg, #3d4889);
}

html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-btn:hover .sidebar-rail-mail-badge,
html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-link.is-active .sidebar-rail-mail-badge {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pro-rail-bg, #3d4889) 80%, #fff);
}

/* ---- Açılır menü: kutular yerine sade bölüm başlıkları ---- */

html:not([data-theme="classic"]) .rail-flyout-drawers {
    gap: 6px;
    padding: 0 6px;
}

html:not([data-theme="classic"]) .rail-flyout-drawer {
    border: 0;
    border-radius: 0;
    background: transparent;
}

html:not([data-theme="classic"]) .rail-flyout-drawer + .rail-flyout-drawer {
    padding-top: 6px;
    border-top: 1px solid var(--pro-flyout-border);
}

html:not([data-theme="classic"]) .rail-flyout-drawer-toggle,
html:not([data-theme="classic"]) .rail-flyout-drawer.is-open > .rail-flyout-drawer-toggle {
    padding: 8px 12px 6px;
    border-radius: 8px;
    background: transparent;
    color: var(--pro-flyout-muted, #64748b);
    font-size: 0.66rem;
    letter-spacing: 0.07em;
}

html:not([data-theme="classic"]) .rail-flyout-drawer-toggle:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #1e293b;
}

html:not([data-theme="classic"]) .rail-flyout-drawer-panel {
    padding: 0 0 4px;
    border-top: 0;
}

html[data-theme="dark"] .rail-flyout-drawer-toggle:hover {
    color: var(--sidebar-text-active);
}

@media (prefers-reduced-motion: reduce) {
    html:not([data-theme="classic"]) .sidebar-rail .sidebar-rail-btn {
        transition: none;
    }
}
