@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --ef-font: 'Inter', system-ui, -apple-system, sans-serif;
    --ef-primary: #6366f1;
    --ef-primary-dark: #4f46e5;
    --ef-primary-rgb: 99, 102, 241;
    --ef-sidebar-w: 17rem;
    --ef-topbar-h: 3.75rem;
    --ef-bottom-nav-h: 4.25rem;
    --ef-currency-bar-h: 2.125rem;
    --ef-dock-z: 1035;
    --ef-radius: 1rem;
    --ef-radius-sm: 0.625rem;
    --ef-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    --ef-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --ef-bg: #f4f6fb;
    --ef-surface: #ffffff;
    --ef-border: rgba(15, 23, 42, 0.08);
    --tblr-font-sans-serif: var(--ef-font);
    --tblr-primary: var(--ef-primary);
    --tblr-primary-rgb: var(--ef-primary-rgb);
}

[data-bs-theme="dark"] {
    --ef-bg: #0f1419;
    --ef-surface: #1a1f2e;
    --ef-border: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

body.ef-app {
    font-family: var(--ef-font);
    background: var(--ef-bg);
    min-height: 100dvh;
    margin: 0;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    overflow-x: hidden;
}

html.ef-app-root {
    overflow-x: hidden;
}

/* Sidebar */
.ef-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--ef-sidebar-w);
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 48%, #1e293b 100%);
    color: #e2e8f0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.ef-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem 1rem;
}

.ef-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.25;
}

.ef-brand-text {
    max-width: 10.5rem;
}

.ef-topbar-brand {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ef-text);
    margin-left: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 22rem;
}

.ef-brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
    font-size: 1.15rem;
}

.ef-sidebar-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
}

.ef-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.75rem 1rem;
}

.ef-sidebar-nav .navbar-nav { width: 100%; }

.ef-sidebar-nav .nav-link {
    color: rgba(226, 232, 240, 0.85);
    border-radius: var(--ef-radius-sm);
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background 0.15s, color 0.15s;
}

.ef-sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ef-sidebar-nav .nav-link.active {
    background: rgba(var(--ef-primary-rgb), 0.35);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ef-sidebar-nav .nav-link-icon { opacity: 0.9; font-size: 1.15rem; }

.ef-sidebar-foot {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ef-user-mini {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.ef-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

.ef-sidebar-backdrop.show { display: block; }

@media (max-width: 991.98px) {
    .ef-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--ef-shadow-md);
    }
    .ef-sidebar.open { transform: translateX(0); }
}

/* Main layout — desktop: sidebar + content grid; mobile: overlay sidebar */
.ef-main {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ef-main-auth {
    min-width: 0;
    overflow-x: clip;
}

@media (min-width: 992px) {
    body.ef-app.ef-app--auth {
        display: grid;
        grid-template-columns: var(--ef-sidebar-w) minmax(0, 1fr);
        align-items: stretch;
        width: 100%;
        max-width: 100%;
    }

    body.ef-app.ef-app--auth .ef-sidebar {
        position: sticky;
        top: 0;
        left: auto;
        right: auto;
        bottom: auto;
        height: 100dvh;
        max-height: 100dvh;
        transform: none !important;
        grid-column: 1;
        grid-row: 1;
    }

    body.ef-app.ef-app--auth .ef-main-auth {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: clip;
    }
}

@media (max-width: 991.98px) {
    .ef-main-auth {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
    }
}

/* Top bar */
.ef-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--ef-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ef-border);
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

[data-bs-theme="dark"] .ef-topbar {
    background: rgba(26, 31, 46, 0.9);
}

.ef-topbar-start, .ef-topbar-end {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.ef-topbar-end {
    flex-shrink: 1;
}

.ef-topbar-title {
    font-weight: 600;
    font-size: 1rem;
    margin-left: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 12rem;
}

.ef-icon-btn, .ef-avatar-btn {
    width: 2.875rem;
    height: 2.875rem;
    border: none;
    background: transparent;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s;
}

.ef-icon-btn .ti {
    font-size: 1.375rem;
}

.ef-locale-dropdown {
    margin-right: 0.15rem;
}

.ef-locale-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 2.875rem;
    padding: 0 0.75rem 0 0.65rem;
    border: 1px solid var(--ef-border);
    border-radius: 0.75rem;
    background: var(--tblr-bg-surface, #fff);
    color: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.ef-locale-btn:hover,
.ef-locale-btn.show {
    background: rgba(var(--ef-primary-rgb), 0.06);
    border-color: rgba(var(--ef-primary-rgb), 0.25);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.ef-locale-flag,
.ef-locale-item-flag {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}

.ef-locale-label {
    max-width: 6.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ef-locale-chevron {
    font-size: 0.95rem;
    opacity: 0.55;
    margin-left: -0.1rem;
}

.ef-locale-menu {
    min-width: 13.5rem;
    padding: 0.35rem;
}

.ef-locale-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.55rem;
}

.ef-locale-item.active {
    background: rgba(var(--ef-primary-rgb), 0.08);
}

.ef-locale-item-text strong {
    font-size: 0.875rem;
    font-weight: 600;
}

.ef-locale-item-text small {
    font-size: 0.72rem;
    line-height: 1.2;
}

.ef-locale-check {
    margin-left: auto;
    color: var(--ef-primary);
    font-size: 1.1rem;
}

[data-bs-theme="dark"] .ef-locale-btn {
    background: rgba(255, 255, 255, 0.04);
}

.ef-icon-btn:hover, .ef-avatar-btn:hover {
    background: rgba(var(--ef-primary-rgb), 0.08);
}

/* Content */
.ef-content {
    flex: 1;
    padding: 1rem 0 1.5rem;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.ef-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 1rem;
    min-width: 0;
    overflow-x: hidden;
}

.ef-main-auth .ef-content {
    padding-bottom: calc(
        var(--ef-currency-bar-h) + var(--ef-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 1rem
    );
}

@media (min-width: 992px) {
    .ef-main-auth .ef-content {
        padding-bottom: calc(var(--ef-currency-bar-h) + 1.5rem);
    }
}

.ef-main-auth:has(.ef-currency-bar.expanded) .ef-content {
    padding-bottom: calc(var(--ef-bottom-nav-h) + 13rem + env(safe-area-inset-bottom, 0px) + 1rem);
}

@media (min-width: 992px) {
    .ef-main-auth:has(.ef-currency-bar.expanded) .ef-content {
        padding-bottom: 13rem;
    }
}

.ef-alert { border-radius: var(--ef-radius-sm); margin-bottom: 1rem; }

/* Bottom dock: kur çubuğu + mobil alt menü */
.ef-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--ef-dock-z);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    padding-bottom: env(safe-area-inset-bottom, 0);
    max-width: 100%;
}

.ef-dock > * {
    pointer-events: auto;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    body.ef-app.ef-app--auth .ef-dock {
        left: var(--ef-sidebar-w);
        right: 0;
        width: auto;
        max-width: none;
    }
}

/* Bottom nav */
.ef-bottom-nav {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    height: var(--ef-bottom-nav-h);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--ef-border);
    display: flex;
    align-items: stretch;
    z-index: 1;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] .ef-bottom-nav {
    background: rgba(26, 31, 46, 0.95);
}

.ef-bottom-nav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border: none;
    background: none;
    padding: 0.375rem 0.125rem;
    transition: color 0.15s;
}

.ef-bottom-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.1;
    padding: 0 0.1rem;
}

.ef-bottom-nav-item i { font-size: 1.35rem; }

.ef-bottom-nav-item.active {
    color: var(--ef-primary);
}

.ef-more-sheet { max-height: 70vh; border-radius: 1.25rem 1.25rem 0 0; }

.ef-more-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.875rem 0.5rem;
    border-radius: var(--ef-radius-sm);
    background: var(--ef-bg);
    text-decoration: none;
    color: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    min-height: 100%;
}

button.ef-more-tile {
    cursor: pointer;
}

.ef-more-tile i { font-size: 1.5rem; color: var(--ef-primary); }

/* Cards & components */
.card {
    border-radius: var(--ef-radius);
    border: 1px solid var(--ef-border);
    box-shadow: var(--ef-shadow);
    background: var(--ef-surface);
}

.stat-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ef-shadow-md);
}

.stat-card .stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.kpi-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.kpi-scroll .stat-card {
    flex: 0 0 11.5rem;
    scroll-snap-align: start;
}

.kpi-scroll::-webkit-scrollbar { display: none; }

.chart-card { min-height: 280px; }

.chart-card .apexcharts-canvas { touch-action: pan-x; }

.currency-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.currency-pill {
    position: relative;
}

.currency-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.currency-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    border: 2px solid var(--ef-border);
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--ef-surface);
}

.currency-pill input:checked + span {
    border-color: var(--ef-primary);
    background: rgba(var(--ef-primary-rgb), 0.1);
    color: var(--ef-primary);
}

.amount-input-lg {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: var(--ef-radius-sm);
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.75rem;
}

.doc-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.75rem;
    border-radius: var(--ef-radius-sm);
    border: 1px solid var(--ef-border);
    background: var(--ef-surface);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.doc-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--ef-shadow-md);
}

.doc-tile-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.875rem;
    background: rgba(var(--ef-primary-rgb), 0.1);
    color: var(--ef-primary);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.doc-tile-name {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.doc-tools-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--ef-border);
    background: var(--ef-surface);
    font-size: 0.75rem;
    color: var(--ef-muted);
}

.doc-tools-item i {
    font-size: 1rem;
    color: var(--ef-primary);
}

.doc-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.75rem;
}

.doc-folder-tile-wrap {
    position: relative;
}

.doc-folder-delete {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 2;
}

.doc-folder-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 0.75rem;
    border-radius: var(--ef-radius-sm);
    border: 1px solid var(--ef-border);
    background: var(--ef-surface);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.doc-folder-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--ef-shadow-md);
    color: inherit;
}

.doc-folder-icon {
    font-size: 2.5rem;
    color: #f59e0b;
    margin-bottom: 0.5rem;
}

.doc-folder-name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
}

.doc-tile-wrap {
    position: relative;
}

.doc-tile-actions {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

/* Tabler icon reliability */
.ti {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    font-family: "tabler-icons", sans-serif !important;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* iPad / Finder style document browser */
.files-app {
    display: flex;
    flex-direction: column;
    min-height: 24rem;
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius);
    overflow: hidden;
    background: var(--ef-surface);
    box-shadow: var(--ef-shadow-sm);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 1200px) {
    .files-app:not(.files-app--full) {
        flex-direction: row;
        min-height: 32rem;
        overflow: hidden;
    }
}

.files-sidebar {
    width: 100%;
    max-height: 14rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--ef-border);
    background: color-mix(in srgb, var(--ef-surface) 92%, var(--ef-muted) 8%);
    flex-direction: column;
    display: flex;
}

@media (min-width: 1200px) {
    .files-sidebar {
        width: 14rem;
        max-height: none;
        border-bottom: 0;
        border-right: 1px solid var(--ef-border);
    }
}

.files-sidebar-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--ef-border);
}

.files-sidebar-head .ti {
    font-size: 1.125rem;
    color: var(--ef-primary);
}

.files-sidebar-nav {
    padding: 0.5rem;
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

@media (min-width: 1200px) {
    .files-sidebar-nav {
        overflow-x: hidden;
    }
}

.files-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    color: inherit;
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

@media (min-width: 1200px) {
    .files-sidebar-item {
        margin-bottom: 0.15rem;
        white-space: normal;
    }
}

.files-sidebar-item .ti {
    font-size: 1.125rem;
    color: #f59e0b;
    flex-shrink: 0;
}

.files-sidebar-item.active {
    background: rgba(var(--ef-primary-rgb), 0.12);
    font-weight: 600;
}

.files-sidebar-badge {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--ef-muted);
    background: rgba(148, 163, 184, 0.15);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
}

.files-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.files-mobile-stats {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--ef-muted);
    border-bottom: 1px solid var(--ef-border);
    background: color-mix(in srgb, var(--ef-surface) 94%, var(--ef-muted) 6%);
}

.files-folder-strip {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--ef-border);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.files-folder-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--ef-border);
    background: var(--ef-surface);
    color: inherit;
    text-decoration: none;
    font-size: 0.8125rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.files-folder-chip.active {
    background: rgba(var(--ef-primary-rgb), 0.12);
    border-color: rgba(var(--ef-primary-rgb), 0.35);
    font-weight: 600;
}

.files-folder-chip-count {
    font-size: 0.75rem;
    color: var(--ef-muted);
    background: rgba(148, 163, 184, 0.15);
    border-radius: 999px;
    padding: 0 0.35rem;
}

.files-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ef-border);
    background: color-mix(in srgb, var(--ef-surface) 96%, var(--ef-muted) 4%);
}

.files-toolbar-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.files-toolbar-quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-left: auto;
}

.files-toolbar-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.files-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 0.875rem;
    overflow: hidden;
}

.files-crumb {
    color: var(--ef-muted);
    text-decoration: none;
}

.files-crumb.current {
    color: inherit;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14rem;
}

.files-crumb-sep {
    font-size: 0.75rem;
    color: var(--ef-muted);
}

.files-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    width: 100%;
}

@media (min-width: 768px) {
    .files-toolbar-actions {
        width: auto;
    }
}

.files-search {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.files-search input {
    padding-left: 2rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 2.25rem;
    font-size: 0.875rem;
    box-sizing: border-box;
}

.files-search .ti {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ef-muted);
    pointer-events: none;
    z-index: 1;
}

.files-upload-panel {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ef-border);
    background: linear-gradient(135deg, rgba(var(--ef-primary-rgb), 0.08) 0%, rgba(var(--ef-primary-rgb), 0.02) 100%);
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.files-upload-panel .files-upload-form,
.files-upload-panel .row {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.files-upload-panel .row > [class*="col-"] {
    max-width: 100%;
    min-width: 0;
}

.files-upload-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    max-width: 100%;
}

@media (min-width: 992px) {
    .files-upload-fields {
        grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    }
}

.files-upload-field {
    min-width: 0;
    max-width: 100%;
}

.files-upload-panel.is-highlight {
    animation: files-panel-highlight 1.2s ease;
}

@keyframes files-panel-highlight {
    0%, 100% { box-shadow: inset 0 0 0 0 transparent; }
    30% { box-shadow: inset 0 0 0 2px rgba(var(--ef-primary-rgb), 0.45); }
}

.files-upload-panel .files-upload-head .doc-badge {
    width: 2.25rem;
    height: 2.25rem;
    vertical-align: middle;
}

.files-upload-panel.is-uploading .files-dropzone {
    pointer-events: none;
    opacity: 0.7;
}

.files-upload-head {
    margin-bottom: 0.75rem;
}

.files-upload-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.files-dropzone {
    border: 2px dashed var(--ef-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.files-dropzone.is-dragover,
.files-dropzone:hover {
    border-color: rgba(var(--ef-primary-rgb), 0.55);
    background: rgba(var(--ef-primary-rgb), 0.06);
}

.files-dropzone-input {
    display: none;
}

.files-dropzone-inner .ti {
    font-size: 2rem;
    color: var(--ef-primary);
    margin-bottom: 0.35rem;
}

.files-content {
    flex: 1;
    padding: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    container-type: inline-size;
    container-name: files-main;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
}

.files-grid .files-item {
    min-width: 0;
}

.files-grid .files-item-link {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.65rem 0.35rem 0.5rem;
    gap: 0.35rem;
}

.files-grid .files-item-name {
    font-size: 0.6875rem;
    line-height: 1.2;
    word-break: break-all;
    -webkit-line-clamp: 3;
}

.files-grid .files-item-meta {
    font-size: 0.625rem;
}

.files-grid .doc-badge {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 0.5625rem;
}

.files-grid .files-item-menu {
    padding: 0 0.35rem 0.45rem;
    gap: 0.25rem;
    flex-direction: column;
}

.files-grid .files-item-menu .btn {
    width: 100%;
    font-size: 0.625rem;
    padding: 0.2rem 0.25rem;
    min-height: 1.65rem;
}

.files-grid .files-item-menu form {
    width: 100%;
}

.files-grid .files-item-menu form .btn {
    width: 100%;
}

.files-item {
    position: relative;
    border: 1px solid var(--ef-border);
    border-radius: 0.75rem;
    background: var(--ef-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

.files-item:hover {
    border-color: rgba(var(--ef-primary-rgb), 0.35);
    box-shadow: 0 4px 14px rgba(var(--ef-primary-rgb), 0.08);
}

.files-item-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    padding: 0.85rem 0.9rem;
    color: inherit;
    text-decoration: none;
    min-height: 0;
}

.files-item-body {
    flex: 1;
    min-width: 0;
}

.files-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.files-item-meta {
    font-size: 0.75rem;
    color: var(--ef-muted);
    margin-top: 0.2rem;
}

.doc-badge {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: uppercase;
}

.doc-badge-inner {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.15rem;
}

.doc-badge-folder {
    background: linear-gradient(145deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    border: 1px solid rgba(29, 78, 216, 0.15);
}

.doc-badge-pdf {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.15);
}

.doc-badge-doc {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.doc-badge-xls {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.15);
}

.doc-badge-image {
    background: #faf5ff;
    color: #9333ea;
    border: 1px solid rgba(147, 51, 234, 0.15);
}

.doc-badge-zip {
    background: #f8fafc;
    color: #475569;
    border: 1px solid rgba(71, 85, 105, 0.15);
}

.doc-badge-text {
    background: #ecfeff;
    color: #0891b2;
    border: 1px solid rgba(8, 145, 178, 0.15);
}

.doc-badge-file {
    background: rgba(var(--ef-primary-rgb), 0.1);
    color: var(--ef-primary);
    border: 1px solid rgba(var(--ef-primary-rgb), 0.18);
}

.files-thumb {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.65rem;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--ef-border);
}

.files-item-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid var(--ef-border);
    background: color-mix(in srgb, var(--ef-surface) 96%, var(--ef-muted) 4%);
}

.files-item-menu .btn {
    flex: 1 1 auto;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.files-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
}

.files-icon-folder {
    color: #fff;
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.files-icon-folder .files-svg-icon {
    width: 2rem;
    height: 2rem;
}

.files-icon-pdf { color: #ef4444; background: rgba(239, 68, 68, 0.12); }
.files-icon-doc { color: #2563eb; background: rgba(37, 99, 235, 0.12); }
.files-icon-xls { color: #16a34a; background: rgba(22, 163, 74, 0.12); }
.files-icon-image { color: #9333ea; background: rgba(147, 51, 234, 0.12); }
.files-icon-zip { color: #64748b; background: rgba(100, 116, 139, 0.12); }
.files-icon-text { color: #0ea5e9; background: rgba(14, 165, 233, 0.12); }
.files-icon-file { color: var(--ef-primary); background: rgba(var(--ef-primary-rgb), 0.12); }

.files-thumb {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.85rem;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--ef-border);
}

.files-list {
    border: 1px solid var(--ef-border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.files-list-head,
.files-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7rem 5rem 5.5rem;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0.85rem;
}

.files-list-head {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ef-muted);
    background: color-mix(in srgb, var(--ef-surface) 92%, var(--ef-muted) 8%);
    border-bottom: 1px solid var(--ef-border);
}

.files-list-row {
    border-bottom: 1px solid var(--ef-border);
}

.files-list-row:last-child {
    border-bottom: 0;
}

.files-list-row:hover {
    background: rgba(var(--ef-primary-rgb), 0.04);
}

.files-list-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.files-list-main .doc-badge {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.5625rem;
}

.files-list-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files-list-meta {
    font-size: 0.8125rem;
    color: var(--ef-muted);
}

.files-list-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.15rem;
}

.files-list-actions .btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.files-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--ef-muted);
    padding: 3rem 1rem;
}

.files-list-folders .files-list-head,
.files-list-folders .files-list-row {
    grid-template-columns: minmax(0, 1fr) 6rem 5.5rem;
}

.files-sidebar-stats {
    margin-top: auto;
    padding: 0.75rem;
    border-top: 1px solid var(--ef-border);
}

.files-sidebar-stats-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.files-sidebar-stats-row .ti {
    font-size: 1.25rem;
    color: var(--ef-primary);
}

.files-upload-progress .progress {
    height: 0.5rem;
}

.files-app.is-uploading .files-dropzone {
    pointer-events: none;
    opacity: 0.7;
}

.files-app.is-uploading [data-files-upload-trigger] {
    opacity: 0.65;
}

.files-pagination {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.files-app--full {
    flex-direction: column !important;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 1200px) {
    .files-app.files-app--full {
        flex-direction: column !important;
        overflow: hidden;
        min-height: auto;
    }
}

@media (max-width: 1399.98px) {
    @supports not (container-type: inline-size) {
        .files-grid {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }
    }
}

@container files-main (max-width: 1100px) {
    .files-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@container files-main (max-width: 820px) {
    .files-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@container files-main (max-width: 560px) {
    .files-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container files-main (max-width: 360px) {
    .files-grid {
        grid-template-columns: 1fr;
    }
}

.files-svg-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: block;
}

.files-icon-fallback {
    display: none !important;
}

.files-create-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin: 0;
    border-bottom: 1px solid var(--ef-border);
    background: linear-gradient(135deg, rgba(var(--ef-primary-rgb), 0.08) 0%, rgba(var(--ef-primary-rgb), 0.02) 100%);
}

.files-create-banner-icon .files-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: transparent;
}

.files-create-banner-icon .files-svg-icon {
    width: 3rem;
    height: 3rem;
}

.files-create-banner-body {
    flex: 1;
    min-width: 12rem;
}

.files-upload-btn-prominent {
    font-weight: 600;
    padding: 0.45rem 1rem;
    box-shadow: 0 2px 8px rgba(var(--ef-primary-rgb), 0.25);
}

.files-item-menu--visible {
    opacity: 1;
    pointer-events: auto;
    padding: 0 0.5rem 0.65rem;
}

.files-item-menu--visible .btn-primary {
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .files-app {
        min-height: auto;
    }

    .files-upload-btn-prominent {
        width: 100%;
        justify-content: center;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }

    .files-grid .files-item-link {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .files-grid .doc-badge,
    .files-grid .files-thumb {
        width: 2.75rem;
        height: 2.75rem;
    }

    .files-item-link {
        padding: 0.75rem;
    }

    .files-list-head {
        display: none;
    }

    .files-list-row,
    .files-list-folders .files-list-row {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "main"
            "meta"
            "actions";
        gap: 0.35rem 0.75rem;
    }

    .files-list-main { grid-area: main; }
    .files-list-actions {
        grid-area: actions;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .files-list-meta { grid-area: meta; font-size: 0.75rem; }
    .files-list-row .files-list-meta:nth-child(3) { display: none; }

    .files-list-actions .btn {
        width: auto;
        height: auto;
        padding: 0.25rem 0.65rem;
    }

    .files-upload-panel {
        padding: 0.85rem 1rem;
    }

    .files-toolbar-actions .btn-group,
    .files-toolbar-actions .dropdown {
        flex: 1 1 auto;
    }
}

.pdf-editor-card {
    border: 1px solid var(--ef-border);
}

.pdf-editor-card .card-header {
    background: rgba(var(--ef-primary-rgb), 0.06);
}

.pdf-editor-upload {
    border: 2px dashed var(--ef-border);
    background: rgba(var(--ef-primary-rgb), 0.03);
}

.kanban-board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.kanban-col {
    flex: 0 0 17rem;
    max-width: 17rem;
    background: var(--ef-bg);
    border-radius: var(--ef-radius);
    padding: 0.75rem;
}

.kanban-card {
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.priority-urgent { background: #fef2f2; color: #dc2626; }
.priority-high { background: #fff7ed; color: #ea580c; }
.priority-medium { background: #eff6ff; color: #2563eb; }
.priority-low { background: #f8fafc; color: #64748b; }

.email-list-item {
    display: block;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--ef-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
    overflow: hidden;
    max-width: 100%;
}

.email-list-item:hover { background: rgba(var(--ef-primary-rgb), 0.04); }
.email-list-item.unread { background: rgba(var(--ef-primary-rgb), 0.03); }
.email-list-item.unread .email-list-subject { font-weight: 600; }

.email-inbox-card {
    overflow: hidden;
    max-width: 100%;
}

.email-list-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
    margin-bottom: 0.25rem;
}

.email-list-from {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--tblr-secondary, #64748b);
}

.email-list-date {
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: var(--tblr-secondary, #64748b);
    white-space: nowrap;
}

.email-list-subject {
    font-weight: 500;
    color: var(--ef-text, inherit);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}

.email-list-preview {
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.2rem;
}

.email-list-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.email-filters-card .form-label {
    margin-bottom: 0.15rem;
}

.email-folder-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.email-folder-tabs .btn {
    flex: 0 1 auto;
}

.email-show-card .card-header {
    overflow: hidden;
    word-break: break-word;
}

.email-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-sm);
    background: var(--ef-surface);
    color: inherit;
    text-decoration: none;
    font-size: 0.8125rem;
    max-width: 100%;
}

.email-attachment-chip:hover {
    border-color: var(--ef-primary);
    background: rgba(var(--ef-primary-rgb), 0.06);
    color: inherit;
}

.email-attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14rem;
}

.email-attachment-size {
    color: var(--ef-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.email-body-frame {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-sm);
    padding: 1rem;
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.email-body-content {
    font-size: 0.9375rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.email-body-content img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 0.5rem 0;
}

.email-body-content table {
    max-width: 100% !important;
    width: 100% !important;
    table-layout: fixed;
    border-collapse: collapse;
}

.email-body-content td,
.email-body-content th {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.email-body-content pre {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
    overflow-x: auto;
}

.email-body-content a { color: #2563eb; word-break: break-all; }

.email-body-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1e293b;
    background: transparent;
    margin: 0;
}

[data-bs-theme="dark"] .email-body-frame {
    background: #ffffff;
    color: #1e293b;
}

[data-bs-theme="dark"] .email-body-content,
[data-bs-theme="dark"] .email-body-text {
    color: #1e293b;
}

@media (max-width: 767.98px) {
    .email-list-top {
        flex-wrap: wrap;
    }

    .email-list-date {
        width: 100%;
        text-align: left;
    }

    .email-filters-card .col-md-4,
    .email-filters-card .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .email-body-frame {
        padding: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .email-list-item {
        padding: 0.75rem 0.875rem;
    }

    .email-list-subject,
    .email-list-preview {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.email-compose-editor {
    min-height: 12rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-sm);
    background: var(--ef-surface, #fff);
    line-height: 1.6;
    overflow-x: auto;
    word-break: break-word;
}

.email-compose-editor:focus {
    outline: none;
    border-color: var(--ef-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--ef-primary-rgb), 0.15);
}

.email-compose-editor-sm { min-height: 8rem; }

.email-compose-preview {
    min-height: 4rem;
    max-height: 14rem;
    overflow: auto;
}

.email-signature-preview img { max-width: 100%; height: auto; }

.ef-email-signature img { max-width: 100%; height: auto; }

.audit-log-card { overflow: hidden; max-width: 100%; }

.audit-log-table td,
.audit-log-table th { vertical-align: top; }

.audit-log-details {
    min-width: 12rem;
    max-width: 28rem;
    word-break: break-word;
}

.audit-change-line {
    font-size: 0.8125rem;
    line-height: 1.45;
    padding: 0.15rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}

.audit-change-line:last-child { border-bottom: none; }

.audit-change-field {
    font-weight: 600;
    color: var(--tblr-secondary, #64748b);
}

.audit-change-old { color: #b45309; }
.audit-change-new { color: #15803d; font-weight: 500; }
.audit-change-arrow { color: var(--tblr-secondary, #94a3b8); }

@media (max-width: 767.98px) {
    .audit-log-table thead { display: none; }

    .audit-log-table tbody tr {
        display: block;
        border-bottom: 1px solid var(--ef-border);
        padding: 0.75rem 0;
    }

    .audit-log-table tbody td {
        display: block;
        border: none;
        padding: 0.15rem 1rem;
        max-width: 100%;
    }

    .audit-log-details { max-width: 100%; }
}

.trade-row {
    background: var(--ef-bg);
    border-radius: var(--ef-radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.margin-badge {
    font-weight: 700;
    color: #16a34a;
}

.table-modern thead th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #64748b;
}

.btn-primary {
    --tblr-btn-bg: var(--ef-primary);
    border-radius: 0.625rem;
}

.page-header { margin-bottom: 1.25rem; }

.settings-nav .list-group-item {
    border: none;
    border-radius: var(--ef-radius-sm) !important;
    margin-bottom: 0.125rem;
}

.settings-nav .list-group-item.active {
    background: rgba(var(--ef-primary-rgb), 0.12);
    color: var(--ef-primary);
}

@media (min-width: 992px) {
    .d-desktop-only { display: block !important; }
}

/* Tablet/telefon: kart görünümü; masaüstü: tablo */
@media (max-width: 991.98px) {
    .hide-mobile { display: none !important; }
}

/* Yatay kaydırma — tablolar, geniş formlar, listeler */
.ef-hscroll,
.table-responsive,
.card > .table-responsive,
.card-body > .table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
}

.table-responsive > .table,
.ef-hscroll > .table,
.ef-hscroll > table {
    width: max-content;
    min-width: 100%;
    margin-bottom: 0;
}

/* İşlem sütunu — kaydırırken düzenle/sil görünür kalsın */
.table-responsive .ef-table-actions,
.table .ef-table-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--ef-surface);
    box-shadow: -6px 0 10px rgba(15, 23, 42, 0.06);
    min-width: 5.5rem;
    vertical-align: middle;
}

.table-responsive thead .ef-table-actions {
    z-index: 3;
}

[data-bs-theme="dark"] .table-responsive .ef-table-actions,
[data-bs-theme="dark"] .table .ef-table-actions {
    background: var(--ef-surface);
    box-shadow: -6px 0 10px rgba(0, 0, 0, 0.25);
}

.ef-table-actions .btn {
    min-width: 2.375rem;
    min-height: 2.375rem;
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.ef-table-actions .btn-ghost-primary,
.ef-table-actions .btn-outline-primary {
    color: var(--ef-primary) !important;
    background: rgba(var(--ef-primary-rgb), 0.1) !important;
    border: 1px solid rgba(var(--ef-primary-rgb), 0.25) !important;
}

.ef-table-actions .btn-ghost-danger,
.ef-table-actions .btn-outline-danger {
    color: #dc2626 !important;
    background: rgba(220, 38, 38, 0.08) !important;
    border: 1px solid rgba(220, 38, 38, 0.25) !important;
}

.ef-table-actions .btn-ghost-success,
.ef-table-actions .btn-outline-success {
    color: #16a34a !important;
    background: rgba(22, 163, 74, 0.08) !important;
    border: 1px solid rgba(22, 163, 74, 0.25) !important;
}

.ef-table-actions .btn i {
    font-size: 1.125rem;
    line-height: 1;
}

.card:has(.table-responsive) {
    overflow: visible;
}

.card:has(.table-responsive) > .table-responsive {
    margin-left: -0.05rem;
    margin-right: -0.05rem;
}

/* Geniş form satırları (sipariş kalemleri vb.) */
.ef-form-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    max-width: 100%;
}

@media (min-width: 768px) {
    .trade-row {
        min-width: 42rem;
    }

    #items.ef-form-scroll,
    .ef-form-scroll .trade-row {
        min-width: 42rem;
    }
}

.ef-page-header-actions {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    max-width: 100%;
}

.page-header .d-flex.gap-2,
.page-header .btn-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    flex-wrap: nowrap;
}

.nav-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.nav-tabs .nav-item {
    flex-shrink: 0;
}

/* Currency bar */
.ef-currency-bar {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: 2;
    order: -1;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--ef-border);
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.05);
    min-height: var(--ef-currency-bar-h);
}

.ef-currency-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 0.8rem;
}

.ef-currency-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
    color: var(--ef-primary);
    font-weight: 600;
}

.ef-currency-compact-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ef-currency-compact-meta {
    color: var(--ef-muted);
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
}

.ef-currency-panel {
    padding: 0 1rem 0.5rem;
    border-top: 1px solid var(--ef-border);
}

.ef-currency-bar.expanded .ef-currency-panel {
    padding-bottom: 0.75rem;
}

.ef-finance-nav .nav-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

[data-bs-theme="dark"] .ef-currency-bar {
    background: rgba(26, 31, 46, 0.96);
}

.ef-currency-bar-inner { max-width: 1320px; margin: 0 auto; padding: 0.375rem 1rem; }

.ef-currency-rates {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.125rem;
}

.ef-currency-label {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--ef-primary);
}

.ef-currency-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.ef-currency-scroll::-webkit-scrollbar { display: none; }

.ef-rate-chip {
    font-size: 0.75rem;
    white-space: nowrap;
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    background: var(--ef-bg);
    border: 1px solid var(--ef-border);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.ef-rate-chip-dual {
    flex: 0 0 auto;
    min-width: 7.5rem;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.35rem 0.55rem;
}

.ef-rate-chip:hover {
    border-color: var(--ef-primary);
    background: rgba(99, 102, 241, 0.08);
}

.ef-rate-code {
    font-weight: 700;
    color: var(--ef-primary);
}

.ef-rate-name {
    color: var(--ef-muted);
    display: none;
}

@media (min-width: 768px) {
    .ef-rate-name { display: inline; }
}

.ef-rate-value {
    font-weight: 600;
}

.ef-quick-amounts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.ef-rate-chip-dual { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.ef-rate-dual { display: flex; flex-direction: column; gap: 0.05rem; }
.ef-rate-line { font-size: 0.7rem; line-height: 1.2; }
.ef-rate-line small { color: var(--ef-muted); margin-right: 0.2rem; }

.ef-currency-meta { white-space: nowrap; margin-left: auto; }

.ef-chevron { transition: transform 0.2s; display: inline-block; }
.ef-chevron.rotated { transform: rotate(180deg); }

.ef-currency-bar.expanded .ef-currency-tools {
    padding: 0.5rem 0 0.25rem;
    border-top: 1px solid var(--ef-border);
    margin-top: 0.375rem;
}

/* Branding & profile avatars */
.ef-avatar-img {
    object-fit: cover;
}

.ef-brand-mark {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    flex-shrink: 0;
}

.ef-login-logo {
    max-height: 4.5rem;
    max-width: 100%;
    object-fit: contain;
}

.ef-profile-avatar-wrap .ef-profile-avatar {
    width: 6rem;
    height: 6rem;
    font-size: 1.75rem;
}

.ef-profile-avatar-wrap .ef-avatar-img {
    width: 6rem;
    height: 6rem;
}

.ef-brand-preview img {
    max-height: 3rem;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0.375rem;
    background: var(--ef-surface-2, #f8fafc);
    padding: 0.25rem;
}

.ef-brand-preview-panel .ef-brand-preview-login,
.ef-brand-preview-panel .ef-brand-preview-sidebar {
    background: var(--tblr-bg-surface-secondary, #f1f5f9);
    border: 1px solid var(--ef-border, #e2e8f0);
}

.ef-brand-preview-logo {
    max-height: 3rem;
    object-fit: contain;
}

.ef-brand-preview-icon {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

.ef-brand-preview-panel .text-primary {
    color: var(--ef-primary) !important;
}

.ef-brand-preview-panel .bg-primary-lt {
    background: rgba(var(--ef-primary-rgb), 0.12) !important;
    color: var(--ef-primary) !important;
}

/* Mobil liste kartları */
.ef-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.ef-mobile-card {
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-sm);
    box-shadow: var(--ef-shadow);
    overflow: hidden;
}

.ef-mobile-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ef-mobile-card-link:hover .ef-mobile-card-title {
    color: var(--ef-primary);
}

.ef-mobile-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem 0.75rem;
}

.ef-mobile-card-main {
    flex: 1;
    min-width: 0;
}

.ef-mobile-card-title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.35;
    word-break: break-word;
}

.ef-mobile-card-sub {
    font-size: 0.8125rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.ef-mobile-card-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

.ef-mobile-card-badge {
    flex-shrink: 0;
    max-width: 42%;
    text-align: right;
    white-space: normal;
}

.ef-mobile-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.625rem 1rem 0.875rem;
    border-top: 1px solid var(--ef-border);
    background: rgba(var(--ef-primary-rgb), 0.03);
}

.ef-mobile-action-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0.375rem 0.75rem !important;
    font-weight: 600;
    font-size: 0.8125rem;
}

.ef-mobile-action-btn i {
    font-size: 1.125rem;
    line-height: 1;
}

.ef-mobile-action-btn span {
    line-height: 1.2;
}

@media (max-width: 380px) {
    .ef-mobile-action-btn span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }

    .ef-mobile-action-btn {
        min-width: 2.5rem;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* Ayarlar mobil yatay menü */
.ef-settings-nav-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem 1rem;
    padding: 0 1rem;
}

.ef-settings-nav-scroll .settings-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.375rem;
    min-width: max-content;
}

.ef-settings-nav-scroll .settings-nav .list-group-item {
    white-space: nowrap;
    padding: 0.5rem 0.875rem;
    border-radius: 2rem !important;
    font-size: 0.8125rem;
}

.ef-settings-nav-scroll .list-group-item.text-muted.text-uppercase {
    display: none;
}

@media (min-width: 992px) {
    .ef-settings-nav-scroll {
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .ef-settings-nav-scroll .settings-nav {
        flex-direction: column;
        min-width: 0;
    }

    .ef-settings-nav-scroll .list-group-item.text-muted.text-uppercase {
        display: block;
    }
}

/* Form ve tablet iyileştirmeleri */
@media (max-width: 991.98px) {
    .ef-settings-nav-wrap .card {
        position: static;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .ef-settings-nav-wrap .card-body {
        padding: 0;
    }

    .ef-settings-nav-wrap .settings-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.375rem;
        min-width: max-content;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .ef-settings-nav-wrap .settings-nav .list-group-item {
        white-space: nowrap;
        padding: 0.5rem 0.875rem;
        border-radius: 2rem !important;
        font-size: 0.8125rem;
    }

    .ef-settings-nav-wrap .list-group-item.text-muted.text-uppercase {
        display: none;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .card-header form.row {
        flex-direction: column;
    }

    .card-header form .col-auto,
    .card-header form [class*="col-"] {
        width: 100%;
    }

    .btn-list {
        flex-wrap: wrap;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .ef-finance-nav {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    .ef-finance-nav .nav-link {
        white-space: nowrap;
    }

    .kanban-col {
        flex: 0 0 min(85vw, 17rem);
    }

    .trade-row .row > [class*="col-"] {
        margin-bottom: 0.5rem;
    }

    .ef-login-brand {
        margin-top: 1rem !important;
    }

    .container-tight[style*="max-width:24rem"] {
        margin: 1.5rem auto !important;
        padding: 0 1rem;
    }
}

@media (min-width: 992px) {
    .ef-container {
        max-width: 100%;
        padding: 0 1.25rem;
    }
}

/* Patron inceleme alanı */
.ef-patron-tabs .nav-link {
    font-weight: 600;
    font-size: 0.875rem;
}

.ef-patron-stat {
    text-align: center;
    padding: 1rem 0.75rem;
}

.ef-patron-stat .h2 {
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
}

.ef-review-card {
    border-left: 3px solid var(--ef-primary);
}

.ef-review-card.status-completed {
    border-left-color: #16a34a;
}

.ef-review-card.status-cancelled {
    border-left-color: #94a3b8;
    opacity: 0.85;
}

/* Guest login — no app chrome */
html {
    overflow-x: hidden;
    max-width: 100%;
}

body.ef-guest {
    min-height: 100dvh;
    margin: 0;
    background: var(--ef-bg);
    overflow-x: hidden;
}

.ef-guest-main {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.ef-login-wrap {
    max-width: 24rem;
    width: 100%;
    margin: 0 auto;
}

/* Prevent horizontal scroll on mobile */
html.ef-app-root {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body.ef-app {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

.ef-main {
    width: 100%;
    max-width: 100%;
}

/* duplicate ef-container rule removed — full width on desktop */

/* Mobile: fixed topbar + bottom dock stay in place while scrolling */
@media (max-width: 991.98px) {
    .ef-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
    }

    .ef-main-auth {
        padding-top: var(--ef-topbar-h);
    }

    .ef-dock {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: translateZ(0);
        will-change: transform;
    }

    .ef-bottom-nav {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .ef-currency-bar {
        max-width: 100%;
        overflow: hidden;
    }

    .ef-currency-bar-inner {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .ef-currency-compact-meta {
        display: none;
    }

    .ef-locale-label {
        max-width: 4.5rem;
    }

    .ef-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .kpi-scroll {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .card,
    img,
    svg,
    canvas,
    video,
    iframe {
        max-width: 100%;
    }

    .table-responsive,
    .ef-hscroll,
    .ef-form-scroll {
        max-width: 100%;
    }

    .page-header,
    form.row {
        max-width: 100%;
    }
}

/* Password toggle on login */
.input-group .btn-outline-secondary {
    border-color: var(--ef-border);
}

