/* ====================================================
   AksFlow - Genel Stil Dosyası
   Modern, Responsive, Mobile-First (+ dark theme)
   ==================================================== */

:root {
    /* Marka kırmızısı (logo #b81818) */
    --primary: #b81818;
    --primary-light: #dc2626;
    --primary-dark: #991b1b;
    --accent: #e85d5d;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #64748b;

    /* Yüzey / metin (light) */
    --bg-body: #f9fafb;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-muted: #f3f4f6;
    --text: #374151;
    --text-strong: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --dark: #1f2937;
    --gray-50: var(--bg-body);
    --gray-100: var(--bg-muted);
    --gray-200: var(--border);
    --gray-300: var(--border-strong);
    --gray-500: var(--text-muted);
    --gray-700: var(--text);
    --sidebar-w: 260px;
    --topbar-h: 60px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --theme-transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease;

    /* Bootstrap 5.3 primary override */
    --bs-primary: #b81818;
    --bs-primary-rgb: 184, 24, 24;
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-link-color: #b81818;
    --bs-link-hover-color: #991b1b;
    --bs-link-color-rgb: 184, 24, 24;
}

html[data-theme="dark"],
body[data-theme="dark"] {
    --primary: #b81818;
    --primary-light: #dc2626;
    --primary-dark: #991b1b;
    --accent: #f87171;

    --bg-body: #0b0f14;
    --bg-surface: #12181f;
    --bg-elevated: #1a222d;
    --bg-muted: #1a222d;
    --text: #d1d5db;
    --text-strong: #f3f4f6;
    --text-muted: #94a3b8;
    --border: #243041;
    --border-strong: #334155;

    --dark: #f3f4f6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 40px rgba(0, 0, 0, 0.55);

    --bs-primary: #b81818;
    --bs-primary-rgb: 184, 24, 24;
    --bs-link-color: #f87171;
    --bs-link-hover-color: #fca5a5;
    --bs-link-color-rgb: 248, 113, 113;
    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-body);
    color: var(--text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: var(--theme-transition);
}

/* === Layout === */
.app-wrapper { min-height: 100vh; }

.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1030;
    border-bottom: 1px solid var(--border);
    transition: var(--theme-transition);
}

.topbar-brand {
    display: flex; align-items: center; gap: 0.5rem;
    font-weight: 700; font-size: 1.15rem;
    color: var(--primary);
    text-decoration: none;
    margin-left: 0.5rem;
    padding: 2px 4px;
    background: transparent;
    border-radius: 8px;
    line-height: 0;
}
.topbar-brand:hover { opacity: 0.9; }
.topbar-brand .topbar-logo {
    height: 36px;
    width: auto;
    max-width: 168px;
    object-fit: contain;
    display: block;
}
.topbar-brand .logo-dark { display: none; }
html[data-theme="dark"] .topbar-brand .logo-light { display: none; }
html[data-theme="dark"] .topbar-brand .logo-dark { display: block; }
.topbar-brand i {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}

.sidebar-toggle {
    color: var(--text-strong);
    font-size: 1.25rem;
    padding: 0.25rem 0.75rem;
}
.sidebar-toggle:hover { color: var(--primary); }

.topbar-actions {
    display: flex; align-items: center; gap: 0.25rem;
}
.topbar-icon {
    color: var(--text);
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}
.topbar-icon:hover { background: var(--bg-muted); color: var(--primary); }

.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.theme-toggle:hover {
    background: var(--bg-muted);
    color: var(--primary);
    transform: scale(1.05);
}
.theme-toggle .theme-icon {
    position: absolute;
    font-size: 1.15rem;
    transition: opacity .25s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
}
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(.6); }

.topbar-user {
    color: var(--text);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    display: flex; align-items: center;
}
.topbar-user:hover { background: var(--bg-muted); }

.avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}

/* === Sidebar === */
.sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    transition: transform 0.3s ease, background-color .28s ease, border-color .28s ease;
    z-index: 1020;
}
.sidebar-content { padding: 1rem 0.75rem; }

.sidebar .nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gray-500);
    padding: 1rem 0.75rem 0.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.sidebar .nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    color: var(--gray-700);
    border-radius: 8px;
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
    transition: all 0.15s;
}
.sidebar .nav-link i {
    width: 20px; text-align: center;
    color: var(--gray-500);
}
.sidebar .nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}
.sidebar .nav-link:hover i { color: var(--primary); }
.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(184, 24, 24, 0.3);
}
.sidebar .nav-link.active i { color: white; }

.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1019;
    display: none;
}
.sidebar-overlay.show { display: block; }

/* === Açılır Menü (Collapse) === */
.sidebar .nav-group-toggle {
    cursor: pointer;
    user-select: none;
    position: relative;
}
.sidebar .nav-group-toggle .nav-arrow {
    font-size: 0.7rem;
    transition: transform 0.25s ease;
    margin-left: auto;
    color: var(--gray-500);
}
.sidebar .nav-group-toggle.collapsed .nav-arrow {
    transform: rotate(-90deg);
}
.sidebar .nav-group-toggle.open .nav-arrow,
.sidebar .nav-group-toggle[aria-expanded="true"] .nav-arrow {
    transform: rotate(0deg);
}
.sidebar .nav-submenu {
    list-style: none;
    padding-left: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.02);
    border-left: 2px solid var(--primary);
    margin-left: 0.75rem;
}
.sidebar .nav-submenu .nav-link {
    padding-left: 1rem;
    font-size: 0.875rem;
}
.sidebar .nav-submenu .nav-link i {
    font-size: 0.85rem;
    width: 18px;
}
.sidebar .nav-divider {
    padding: 0.5rem 0 0.25rem;
    border-top: 1px dashed var(--gray-300);
    margin-top: 0.5rem;
}
.sidebar .nav-divider small {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* === Main Content === */
.main-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    min-height: calc(100vh - var(--topbar-h));
    transition: margin-left 0.3s ease;
}

.app-footer {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}
.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.app-footer a:hover { text-decoration: underline; color: var(--primary-dark); }
.app-footer .footer-credit {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
}

/* === Cards & Components === */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    background: var(--bg-surface);
    color: var(--text);
    transition: var(--theme-transition);
}
.card-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    color: var(--text-strong);
}
.card-body { padding: 1.25rem; }

.page-header {
    display: flex; flex-wrap: wrap;
    justify-content: space-between; align-items: center;
    margin-bottom: 1.25rem; gap: 0.75rem;
}
.page-header h1 {
    font-size: 1.5rem; font-weight: 700;
    color: var(--dark); margin: 0;
}
.page-header .breadcrumb {
    margin: 0; font-size: 0.85rem;
}

/* === Stats Cards === */
.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow .2s, background-color .28s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: white;
    margin-bottom: 1rem;
}
.stat-card.primary .stat-icon { background: linear-gradient(135deg, #dc2626, #b81818); }
.stat-card.success .stat-icon { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card.warning .stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card.danger .stat-icon { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.stat-card.info .stat-icon { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.stat-card.purple .stat-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.stat-card .stat-label {
    font-size: 0.85rem; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: 0.05em;
    font-weight: 600;
}
.stat-card .stat-value {
    font-size: 1.75rem; font-weight: 700;
    color: var(--dark); margin: 0.25rem 0;
}
.stat-card .stat-meta {
    font-size: 0.85rem; color: var(--gray-500);
}

/* === Tables === */
.table-card { padding: 0; overflow: hidden; }
.table { margin: 0; }
.table thead th {
    background: var(--bg-muted);
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}
.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.table tbody tr:hover { background: var(--bg-muted); }
.table tbody tr:last-child td { border-bottom: none; }

.table-responsive { border-radius: var(--radius); }

/* === Form === */
.form-label { font-weight: 500; color: var(--gray-700); margin-bottom: 0.35rem; }
.form-control, .form-select {
    border-radius: 8px;
    border-color: var(--border-strong);
    padding: 0.55rem 0.85rem;
    background: var(--bg-surface);
    color: var(--text);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(184, 24, 24, 0.15);
    background: var(--bg-surface);
    color: var(--text);
}
.input-group-text {
    background: var(--bg-muted);
    border-color: var(--border-strong);
    color: var(--text);
}

/* === Buttons === */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.55rem 1rem;
    transition: all 0.15s;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
}
.btn-icon {
    width: 36px; height: 36px;
    padding: 0; display: inline-flex;
    align-items: center; justify-content: center;
}

/* === Badges === */
.badge {
    font-weight: 500; padding: 0.4em 0.7em;
    border-radius: 6px;
}

/* === Select2 Override === */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px !important;
    min-height: calc(1.5em + 1.1rem + 2px) !important;
    padding: 0.55rem 0.85rem !important;
}

/* === Mobile === */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .topbar-brand span { font-size: 1rem; }
    .page-header h1 { font-size: 1.25rem; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .stat-card .stat-icon { width: 44px; height: 44px; font-size: 1.15rem; }
}

@media (max-width: 575.98px) {
    .topbar-brand span { display: none; }
    .topbar { padding: 0 0.5rem; }
    .card-body, .card-header { padding: 1rem; }
    .table thead th, .table tbody td { padding: 0.6rem 0.5rem; font-size: 0.85rem; }
}

/* Yazdırma alanı */
@media print {
    .topbar, .sidebar, .app-footer, .no-print { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
}

/* Yardımcı sınıflar */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cursor-pointer { cursor: pointer; }
.bg-soft-primary { background: rgba(184, 24, 24, 0.1); color: var(--primary); }

/* Bootstrap outline / table primary uyumu */
.btn-outline-primary {
    --bs-btn-color: #b81818;
    --bs-btn-border-color: #b81818;
    --bs-btn-hover-bg: #b81818;
    --bs-btn-hover-border-color: #b81818;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #991b1b;
    --bs-btn-active-border-color: #991b1b;
    --bs-btn-disabled-color: #b81818;
    --bs-btn-disabled-border-color: #b81818;
}
.table-primary {
    --bs-table-bg: rgba(184, 24, 24, 0.12);
    --bs-table-color: #991b1b;
    --bs-table-border-color: rgba(184, 24, 24, 0.25);
    --bs-table-striped-bg: rgba(184, 24, 24, 0.16);
    --bs-table-active-bg: rgba(184, 24, 24, 0.2);
}
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.bg-soft-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.bg-soft-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.bg-soft-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Boş durum */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}
.empty-state i {
    font-size: 3.5rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

/* Mobil kart görünümü (tablo yerine) */
.mobile-card-list { display: none; }
@media (max-width: 575.98px) {
    .desktop-table { display: none; }
    .mobile-card-list { display: block; }
    .mobile-card-list .item {
        background: var(--bg-surface); border-radius: var(--radius);
        padding: 1rem; margin-bottom: 0.75rem;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border);
    }
    .mobile-card-list .item-title {
        font-weight: 600; color: var(--text-strong);
        margin-bottom: 0.35rem;
    }
    .mobile-card-list .item-meta {
        font-size: 0.85rem; color: var(--gray-500);
        display: flex; flex-wrap: wrap; gap: 0.5rem;
    }
    .mobile-card-list .item-actions {
        display: flex; gap: 0.35rem;
        margin-top: 0.6rem;
    }
}

/* Kalem satır tablosu — teklif / fatura / proforma */
#line-items-table,
#itemsTable {
    table-layout: fixed;
    width: 100%;
    font-size: 0.8125rem;
    margin-bottom: 0;
}

#line-items-table thead th,
#itemsTable thead th {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.3rem;
    vertical-align: middle;
    white-space: nowrap;
    color: var(--gray-500);
    border-bottom-width: 1px;
}

#line-items-table tbody td,
#itemsTable tbody td {
    padding: 0.28rem 0.22rem;
    vertical-align: middle;
}

#line-items-table .form-control,
#line-items-table .form-select,
#itemsTable .form-control,
#itemsTable .form-select {
    font-size: 0.8125rem;
    padding: 0.26rem 0.42rem;
    min-height: 1.75rem;
    height: auto;
    line-height: 1.35;
    border-radius: 6px;
}

#line-items-table .form-control-sm,
#line-items-table .form-select-sm,
#itemsTable .form-control-sm,
#itemsTable .form-select-sm {
    font-size: 0.8rem;
    padding: 0.22rem 0.38rem;
    min-height: 1.65rem;
}

#line-items-table .description,
#itemsTable .description {
    margin-bottom: 0.15rem;
}

#line-items-table .product-select,
#itemsTable .product-select {
    margin-top: 0.15rem !important;
}

#line-items-table .input-group-sm > .form-control,
#line-items-table .input-group-sm > .form-select,
#itemsTable .input-group-sm > .form-control,
#itemsTable .input-group-sm > .form-select {
    font-size: 0.78rem;
    padding: 0.2rem 0.32rem;
    min-height: 1.6rem;
}

#line-items-table .col-desc,
#itemsTable .col-desc { width: 28%; min-width: 120px; }

#line-items-table .col-qty,
#itemsTable .col-qty { width: 68px; }

#line-items-table .col-unit,
#itemsTable .col-unit { width: 72px; }

#line-items-table .col-volume,
#itemsTable .col-volume { width: 108px; }

#line-items-table .col-price-base,
#itemsTable .col-price-base { width: 78px; }

#line-items-table .col-price,
#itemsTable .col-price { width: 92px; }

#line-items-table .col-pct,
#itemsTable .col-pct { width: 56px; }

#line-items-table .col-total,
#itemsTable .col-total { width: 76px; }

#line-items-table .col-action,
#itemsTable .col-action { width: 36px; padding-left: 0.1rem; padding-right: 0.1rem; }

#line-items-table input[type="number"],
#itemsTable input[type="number"] {
    text-align: right;
}

#line-items-table .line-total,
#itemsTable .line-total {
    font-size: 0.8125rem;
    padding-right: 0.25rem !important;
    white-space: nowrap;
}

#line-items-table .btn-sm,
#itemsTable .btn-sm {
    padding: 0.18rem 0.4rem;
    font-size: 0.75rem;
}

#line-items-table .volume-unit-select,
#itemsTable .volume-unit-select {
    max-width: 52px !important;
    padding-left: 0.25rem;
    padding-right: 1.2rem;
    flex: 0 0 52px;
}

#line-items-table .price-base,
#itemsTable .price-base {
    padding-left: 0.25rem;
    padding-right: 1.15rem;
    font-size: 0.75rem;
}

@media (max-width: 991.98px) {
    #line-items-table,
    #itemsTable {
        table-layout: auto;
        min-width: 800px;
    }
}

/* === Dark mode — Bootstrap & bileşen uyumu === */
html[data-theme="dark"] .dropdown-menu,
body[data-theme="dark"] .dropdown-menu {
    background: var(--bg-elevated);
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}
html[data-theme="dark"] .dropdown-item { color: var(--text); }
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
    background: var(--bg-muted);
    color: var(--text-strong);
}
html[data-theme="dark"] .dropdown-divider { border-color: var(--border); }
html[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
html[data-theme="dark"] .form-label { color: var(--text); }
html[data-theme="dark"] .breadcrumb { --bs-breadcrumb-divider-color: var(--text-muted); }
html[data-theme="dark"] .breadcrumb-item a { color: var(--primary-light); }
html[data-theme="dark"] .breadcrumb-item.active { color: var(--text-muted); }
html[data-theme="dark"] .page-header h1 { color: var(--text-strong); }
html[data-theme="dark"] .stat-card .stat-value { color: var(--text-strong); }
html[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: var(--bg-muted);
}
html[data-theme="dark"] .modal-content {
    background: var(--bg-surface);
    color: var(--text);
    border-color: var(--border);
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { border-color: var(--border); }
html[data-theme="dark"] .list-group-item {
    background: var(--bg-surface);
    color: var(--text);
    border-color: var(--border);
}
html[data-theme="dark"] .nav-tabs { border-color: var(--border); }
html[data-theme="dark"] .nav-tabs .nav-link { color: var(--text-muted); }
html[data-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--bg-surface);
    color: var(--primary-light);
    border-color: var(--border) var(--border) var(--bg-surface);
}
html[data-theme="dark"] .alert { border: 1px solid var(--border); }
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background: var(--bg-surface) !important;
    border-color: var(--border-strong) !important;
    color: var(--text) !important;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
    background: var(--bg-elevated);
    border-color: var(--border);
    color: var(--text);
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background: var(--primary) !important;
}
html[data-theme="dark"] .sidebar .nav-submenu {
    background: rgba(255, 255, 255, 0.03);
}
html[data-theme="dark"] .bg-soft-primary { background: rgba(184, 24, 24, 0.2); color: var(--primary-light); }
html[data-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #f87171;
    --bs-btn-border-color: #ef4444;
    --bs-btn-hover-bg: #b81818;
    --bs-btn-hover-border-color: #b81818;
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(184, 24, 24, 0.25);
}
html[data-theme="dark"] .empty-state i { color: var(--border-strong); }

/* Tema geçiş animasyonu */
html.theme-animating body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(circle at top right, rgba(184, 24, 24, 0.18), transparent 55%);
    animation: themeFlash .45s ease forwards;
}
@keyframes themeFlash {
    from { opacity: .9; }
    to { opacity: 0; }
}

/* Teklif şartları (Timsan tarzı) */
.condition-quote-row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: var(--bg-elevated, #fff);
}
.condition-row-highlight {
    background: #FFF59D !important;
    border-color: #f6e05e;
}
#itemsTable .col-cf-side { min-width: 160px; max-width: 220px; }
#itemsTable .col-desc { min-width: 220px; }
#itemsTable .col-qty, #itemsTable .col-pct, #itemsTable .col-unit { width: 72px; }
#itemsTable .col-price { width: 100px; }
#itemsTable .col-total { width: 100px; }
#itemsTable .col-action { width: 40px; }
