:root {
    --bg: #f6f4f3;
    --panel: #ffffff;
    --border: #e6dfdd;
    --text: #241b1a;
    --text-muted: #7a6c6a;
    --primary: #900000;
    --primary-dark: #690000;
    --primary-light: #f6e3e1;
    --success: #1c9d63;
    --danger: #d64545;
    --warning: #b8790f;
    --sidebar-bg: #1b1315;
    --sidebar-text: #d9cac8;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- App shell --- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 230px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem 1.4rem; }
.brand.center { justify-content: center; padding-bottom: 1.5rem; }
.brand-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: linear-gradient(135deg, #c23b3b, var(--primary));
    flex-shrink: 0;
}
.brand-logo-chip {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border-radius: 8px; padding: 0.3rem 0.55rem;
    flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.brand-logo { display: block; max-height: 30px; max-width: 150px; width: auto; object-fit: contain; }
.brand.center .brand-logo-chip { padding: 0.5rem 0.9rem; border-radius: 10px; }
.brand.center .brand-logo { max-height: 42px; max-width: 220px; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    background: linear-gradient(135deg, #c23b3b, var(--primary));
    color: #fff; font-weight: 700; font-size: 0.95rem;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: 0.01em;
}
.brand-name { font-weight: 700; color: #fff; font-size: 1rem; }
.brand-sub { font-size: 0.75rem; color: #9c8b89; }

.nav-link {
    display: block;
    padding: 0.6rem 0.7rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 0.92rem;
    margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,0.06); text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link.small { font-size: 0.82rem; color: #9c8b89; }

.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08); }
.user-chip { font-size: 0.85rem; color: #fff; padding: 0.4rem 0.7rem; }

.nav-group-title {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #8a7573; margin: 1rem 0 0.35rem 0.7rem; font-weight: 700;
}
.nav-group-title:first-of-type { margin-top: 0; }

.role-badge {
    display: inline-block; padding: 0.1rem 0.45rem; border-radius: 999px;
    font-size: 0.65rem; font-weight: 700; margin-left: 0.35rem; vertical-align: middle;
}
.role-admin { background: var(--primary); color: #fff; }
.role-teknik { background: #5a4d4c; color: #efe6e5; }
.role-denetci { background: #8a6a1f; color: #fff8e6; }

/* --- Döviz kuru ticker (sidebar) --- */
.rate-ticker { margin-top: 1.4rem; padding: 0.8rem 0.7rem; background: rgba(255,255,255,0.05); border-radius: 10px; }
.rate-ticker-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; color: #9c8b89; margin-bottom: 0.5rem; }
.rate-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: #efe6e5; padding: 0.15rem 0; }
.rate-row-muted { color: #8a7573; }
.rate-updated { font-size: 0.7rem; color: #9c8b89; margin: 0.3rem 0 0.6rem; }
.rate-error { font-size: 0.7rem; color: #f2a4a4; margin: 0.2rem 0 0.6rem; line-height: 1.4; }
.rate-ticker form { margin: 0; }
.rate-ticker .btn { background: rgba(255,255,255,0.08); color: #e4e7ef; }
.rate-ticker .btn:hover { background: rgba(255,255,255,0.16); }

.content { flex: 1; padding: 1.75rem 2rem; max-width: 1200px; }

/* --- Auth pages --- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--sidebar-bg); }
.auth-wrap { width: 100%; max-width: 400px; padding: 1rem; }
.auth-card { background: var(--panel); border-radius: var(--radius); padding: 2rem; box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
.auth-card .brand-name { color: var(--text); }
.auth-card .brand-sub { color: var(--text-muted); }
.auth-title { font-size: 1.3rem; margin: 0 0 1.2rem; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 0.9rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.auth-form input { padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; }
.auth-alt { text-align: center; margin-top: 1.1rem; font-size: 0.88rem; color: var(--text-muted); }
.auth-form .hint { font-size: 0.78rem; color: var(--text-muted); margin: -0.4rem 0 0; }
.hint { font-size: 0.78rem; color: var(--text-muted); margin: 0.9rem 0 0; }

/* --- Flash messages --- */
.flash-stack { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.flash { padding: 0.7rem 1rem; border-radius: 8px; font-size: 0.9rem; }
.flash-success { background: #e3f7ec; color: #12734a; }
.flash-error { background: #fbe9e9; color: #a92c2c; }
.flash-info { background: var(--primary-light); color: var(--primary-dark); }

/* --- Page header --- */
.page-header { margin-bottom: 1.4rem; }
.page-header h1 { margin: 0 0 0.2rem; font-size: 1.5rem; }
.page-sub { color: var(--text-muted); margin: 0; font-size: 0.9rem; }
.page-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }

/* --- Stat cards --- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; border-top: 3px solid var(--border); }
.stat-positive { border-top-color: var(--success); }
.stat-negative { border-top-color: var(--danger); }
.stat-tax { border-top-color: var(--warning); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.stat-value { overflow-wrap: anywhere; font-size: 1.5rem; font-weight: 700; margin-top: 0.3rem; }
.stat-warning { color: var(--danger); font-size: 0.78rem; margin-top: 0.4rem; }
.stat-hint { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.4rem; }
.stat-eq { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.2rem; }

/* --- Panels --- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-bottom: 1.5rem; }
.panel-narrow { max-width: 640px; }
.panel h2 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.panel-sub { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* --- Tables --- */
/* Geniş tablolar için yatay kaydırma (satır içi form alanları taşmasın) */
.table-scroll { overflow-x: auto; }
.table-scroll .data-table { min-width: 980px; }
.table-scroll .row-actions { white-space: nowrap; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 0.5rem 0.6rem; border-bottom: 2px solid var(--border); font-size: 0.78rem; text-transform: uppercase; }
.data-table td { padding: 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr.row-overdue td { background: #fdf1f1; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* --- Badges & pills --- */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: #f1ecea; color: var(--text-muted); }
.badge-musteri { background: var(--primary-light); color: var(--primary-dark); }
.badge-tedarikci { background: #fef2e0; color: #b8790f; }
.badge-alacak { background: #e3f7ec; color: #12734a; }
.badge-borc { background: #fbe9e9; color: #a92c2c; }
.badge-iade { background: #fff4d6; color: #8a5a00; }

.status-pill { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-bekliyor { background: #fef2e0; color: #b8790f; }
.status-kismi { background: var(--primary-light); color: var(--primary-dark); }
.status-odendi { background: #e3f7ec; color: #12734a; }

.text-pos { color: var(--success); font-weight: 600; }
.text-neg { color: var(--danger); font-weight: 600; }

/* --- Vade / kalan gün göstergesi --- */
.due-pill { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.due-overdue { background: #fbe9e9; color: #a92c2c; }
.due-today { background: #ffe6cf; color: #a5580a; }
.due-soon { background: #fef2e0; color: #b8790f; }
.due-normal { background: #f1ecea; color: var(--text-muted); font-weight: 600; }
.due-paid { background: transparent; color: var(--text-muted); font-weight: 400; }

/* --- Buttons --- */
.btn { display: inline-block; padding: 0.55rem 1rem; border-radius: 8px; border: 1px solid transparent; font-size: 0.88rem; font-weight: 600; cursor: pointer; background: #f1ecea; color: var(--text); }
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #f1ecea; color: var(--text); border-color: var(--border); }
.btn-success { background: #e3f7ec; color: #12734a; }
.btn-danger { background: #fbe9e9; color: #a92c2c; }
.btn-small { padding: 0.32rem 0.65rem; font-size: 0.78rem; }
.btn-block { width: 100%; text-align: center; }

/* --- Forms --- */
.filter-bar { display: flex; gap: 0.6rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.88rem; }

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.6rem; }
.inline-form input, .inline-form select { padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.85rem; }
.inline-form input[type="text"], .inline-form input[type="number"] { flex: 1; min-width: 110px; }

.direction-toggle { display: flex; gap: 0.5rem; }
.direction-option {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.8rem; border-radius: 8px; border: 2px solid var(--border);
    font-size: 0.85rem; font-weight: 700; cursor: pointer; color: var(--text-muted);
    background: #fff;
}
.direction-option input { accent-color: currentColor; }
.direction-alacak:has(input:checked) { border-color: var(--success); color: var(--success); background: #e3f7ec; }
.direction-borc:has(input:checked) { border-color: var(--danger); color: var(--danger); background: #fbe9e9; }

.mini-form { display: inline-flex; gap: 0.3rem; align-items: center; }
.mini-input { width: 90px; padding: 0.3rem 0.4rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.78rem; }

.stack-form { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 0.8rem; }
.stack-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.84rem; color: var(--text-muted); font-weight: 600; }
.stack-form input, .stack-form select, .stack-form textarea {
    padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 8px;
    font-size: 0.9rem; font-family: inherit; width: 100%; min-width: 0; max-width: 100%;
    box-sizing: border-box;
}
.stack-form select { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 0.5rem !important; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; }

.empty-state { color: var(--text-muted); font-size: 0.9rem; padding: 1rem 0; }

/* --- Tax type cards --- */
.tax-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.tax-type-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: #fbfaf9; }
.tax-type-card.inactive { opacity: 0.55; }
.tax-type-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.tax-type-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.tax-type-notes { font-size: 0.78rem; color: var(--text-muted); background: #fff; padding: 0.5rem; border-radius: 6px; margin: 0.4rem 0; }
.tax-type-edit summary, .tax-type-new summary { cursor: pointer; font-size: 0.8rem; color: var(--primary); margin-top: 0.6rem; }

.template-cols { font-size: 0.85rem; color: var(--text-muted); padding-left: 1.2rem; }

/* --- Cash flow chart (pure CSS bars, no JS dependency) --- */
.cashflow-chart { display: flex; gap: 1.5rem; align-items: flex-end; height: 220px; padding-top: 1rem; }
.cashflow-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.cashflow-bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; width: 100%; justify-content: center; }
.bar { width: 28px; border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.2s; }
.bar-in { background: linear-gradient(180deg, #34c281, var(--success)); }
.bar-out { background: linear-gradient(180deg, #ef7d7d, var(--danger)); }
.cashflow-label { margin-top: 0.6rem; font-size: 0.82rem; font-weight: 600; color: var(--text); }
.cashflow-net { font-size: 0.78rem; margin-top: 0.15rem; }

.legend { display: flex; gap: 1.2rem; margin-top: 0.8rem; font-size: 0.8rem; color: var(--text-muted); }
.legend-item { display: flex; align-items: center; gap: 0.4rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* --- Servis & Stok modülleri --- */
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-value-sm { font-size: 1.15rem; font-weight: 700; margin-top: 0.3rem; }

.serial-search-bar {
    background: linear-gradient(135deg, #2a1416, #1b1315);
    border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1.5rem;
}
.serial-search { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.serial-search-label {
    color: #9c8b89; font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.05em; font-weight: 700; margin-right: 0.2rem;
}
.serial-input {
    flex: 1; min-width: 260px; padding: 0.65rem 0.9rem; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06);
    color: #fff; font-size: 0.95rem; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.serial-input::placeholder { color: #93807e; font-family: inherit; }
.serial-input:focus { outline: none; border-color: var(--primary); background: rgba(255,255,255,0.1); }
.serial-search-hint { color: #93807e; font-size: 0.75rem; margin-top: 0.55rem; }

.detail-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.detail-table th {
    text-align: left; color: var(--text-muted); font-weight: 600; width: 38%;
    padding: 0.45rem 0.6rem 0.45rem 0; vertical-align: top; font-size: 0.82rem;
}
.detail-table td { padding: 0.45rem 0; border-bottom: 1px solid var(--border); }

.cell-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.row-muted td { opacity: 0.55; }

.stock-count { font-weight: 700; font-size: 1rem; padding: 0.15rem 0.5rem; border-radius: 6px; }
.stock-ok { background: #e3f7ec; color: #12734a; }
.stock-low { background: #fbe9e9; color: #a92c2c; }

.status-sahada { background: #e3f7ec; color: #12734a; }
.status-serviste { background: #fef2e0; color: #b8790f; }
.status-iade { background: var(--primary-light); color: var(--primary-dark); }
.status-hurda { background: #f1ecea; color: var(--text-muted); }

.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
.form-grid .form-actions { grid-column: 1 / -1; }
.form-grid label { min-width: 0; }
.panel-summary { cursor: pointer; font-weight: 700; font-size: 1rem; color: var(--primary); }
.inline-details summary { cursor: pointer; font-size: 0.78rem; color: var(--primary); }
.inline-details .stack-form { min-width: 220px; }

.role-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; background: #fbfaf9; }
.role-card h3 { margin: 0 0 0.6rem; font-size: 0.98rem; }
.role-card ul { margin: 0; padding-left: 1.1rem; font-size: 0.84rem; color: var(--text-muted); line-height: 1.7; }
.role-card-admin { border-left: 4px solid var(--primary); }
.role-card-teknik { border-left: 4px solid var(--text-muted); }

.info-box {
    margin-top: 1.2rem; padding: 0.9rem 1.1rem; background: var(--primary-light);
    border-left: 4px solid var(--primary); border-radius: 8px;
    font-size: 0.83rem; color: var(--primary-dark);
}
.info-box ul { margin: 0.5rem 0 0; padding-left: 1.2rem; line-height: 1.7; }
.sub-heading { font-size: 0.9rem; color: var(--text-muted); margin: 1.4rem 0 0.6rem; text-transform: uppercase; letter-spacing: 0.02em; }

.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.mini-panel { border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1rem; background: #fbfaf9; }
.mini-panel h3 { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 0.45rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.15rem; align-items: flex-start; }
.mini-list li:last-child { border-bottom: none; }

@media (max-width: 1200px) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .form-grid { grid-template-columns: 1fr; }
    .stat-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .three-col { grid-template-columns: 1fr; }
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .sidebar-footer { margin-top: 0; margin-left: auto; border: none; padding: 0; display: flex; align-items: center; gap: 0.6rem; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-col { grid-template-columns: 1fr; }
    .content { padding: 1.2rem; }
}

/* --- Sıralama menüsü (tabloların üstünde) --- */
.sort-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin: 0 0 .85rem;
    padding: .55rem .7rem;
    background: #f7f9fc;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.sort-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sort-bar select {
    padding: .35rem .5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel);
    font-size: .88rem;
    color: var(--text);
    max-width: 280px;
}
.sort-bar .btn { padding: .35rem .7rem; }

/* Personel/bordro tabloları */
.data-table tfoot th {
    background: #f2f5f9;
    border-top: 2px solid var(--border);
    font-size: .84rem;
    color: var(--text);
    text-transform: none;
}
.row-muted { opacity: .62; }

/* Hareket tablosunda fatura/vade tarihi düzenleme (tek form, iki tarih) */
.date-edit-form { display: flex; flex-direction: column; gap: .25rem; min-width: 150px; }
.date-edit-form label {
    display: flex; align-items: center; gap: .35rem;
    font-size: .72rem; color: var(--text-muted); text-transform: uppercase;
}
.date-edit-form label span { min-width: 42px; }
.date-edit-form .mini-input { width: 118px; font-size: .8rem; padding: .2rem .3rem; }
.date-edit-form .btn { align-self: flex-start; padding: .2rem .5rem; font-size: .75rem; }

/* Bordro parametreleri: gelir vergisi dilimleri bloğu */
.bracket-block { grid-column: 1 / -1; margin-top: .5rem; }
.bracket-table { max-width: 520px; }
.bracket-table input { width: 100%; padding: .4rem .55rem; border: 1px solid var(--border); border-radius: 6px; font-size: .88rem; }

/* --- Masraflar --- */
.masraf-bar { background: #f1ecea; border-radius: 999px; height: 10px; overflow: hidden; min-width: 60px; }
.masraf-bar-in { background: linear-gradient(90deg, #e07a7a, #d64545); height: 100%; border-radius: 999px; }
.data-table tr.row-secili td { background: var(--primary-light); }
.badge-fatura { background: #fef2e0; color: #b8790f; }
.badge-maas { background: var(--primary-light); color: var(--primary-dark); }
.badge-ekstra { background: #f0e8fb; color: #6b3fb8; }
.badge-sgk { background: #fbeee4; color: #9a4a12; }
.badge-vergi { background: #eef1f4; color: #3f4f5f; }
.stat-value-sm { font-size: 1.2rem; font-weight: 700; margin-top: .3rem; }

/* --- Personel baş harf avatarları --- */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #b23a3a, var(--primary));
    color: #fff; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.01em;
}
.avatar-lg { width: 54px; height: 54px; font-size: 1.25rem; }
.avatar-muted { background: linear-gradient(135deg, #a38f8d, #7a6c6a); }
.name-with-avatar { display: flex; align-items: center; gap: 0.7rem; }
.name-with-avatar:hover { text-decoration: none; }
.name-with-avatar:hover strong { text-decoration: underline; }
.name-with-avatar .name-col { display: flex; flex-direction: column; }
.name-with-avatar .cell-sub { color: var(--text-muted); }

/* Ekstralar paneli (personel kartı) */
.ekstra-ozet { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .2rem 0 1rem; }
.ekstra-ozet div { background: #faf7ff; border: 1px solid #ece4fa; border-radius: 8px; padding: .6rem .9rem; }
.ekstra-ozet .k { font-size: .72rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.ekstra-ozet .v { font-size: 1.05rem; font-weight: 700; }

/* ===== v4.0 — Ana ekran (uygulama kutucukları) ===== */
.nav-home { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.nav-home svg { flex-shrink: 0; opacity: 0.85; }

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 1rem;
    margin-bottom: 1.8rem;
}
.app-tile {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 0.35rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.4rem 1.1rem 1.1rem;
    color: var(--text);
    min-height: 178px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
a.app-tile:hover {
    text-decoration: none;
    border-color: #d9b8b4;
    box-shadow: 0 6px 18px rgba(105, 0, 0, 0.08);
    transform: translateY(-1px);
}
a.app-tile:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.app-icon {
    width: 54px; height: 54px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light); color: var(--primary);
    margin-bottom: 0.45rem;
}
.app-title { font-weight: 700; font-size: 1rem; }
.app-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; max-width: 24ch; }
.app-status {
    margin-top: auto; padding-top: 0.7rem;
    font-size: 0.75rem; color: var(--text-muted);
}
.app-status-alert { color: var(--danger); font-weight: 600; }
.app-section-title { font-size: 1rem; margin: 0.4rem 0 0.8rem; color: var(--text-muted); }
.app-tile-soon {
    background: transparent;
    border-style: dashed;
    color: var(--text-muted);
}
.app-tile-soon .app-icon { background: #efe9e8; color: #9c8b89; }
.app-tile-soon .app-title { color: #5a4d4c; }
@media (prefers-reduced-motion: reduce) { .app-tile { transition: none; } a.app-tile:hover { transform: none; } }
@media (max-width: 560px) {
    .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
    .app-tile { min-height: 150px; padding: 1rem 0.7rem 0.8rem; }
    .app-desc { display: none; }
}

/* Kullanıcılar: modül seçimi */
.module-picker summary { font-size: 0.82rem; }
.module-form { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.6rem 0 0.2rem; min-width: 190px; }
.module-form label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.84rem; color: var(--text); }
.module-form .btn { align-self: flex-start; margin-top: 0.3rem; }
.role-select { width: 110px; }

/* Hesabım / iki adımlı doğrulama */
.setup-steps { padding-left: 1.2rem; line-height: 1.7; font-size: 0.9rem; margin: 0.4rem 0 1rem; }
.setup-steps li { margin-bottom: 0.5rem; }
.secret-key {
    font-family: Consolas, "Courier New", monospace; font-size: 1.05rem; letter-spacing: 0.06em;
    background: #fbfaf9; border: 1px solid var(--border); border-radius: 8px;
    padding: 0.55rem 0.8rem; margin: 0.4rem 0; display: inline-block; user-select: all;
}
.code-input { letter-spacing: 0.3em; font-size: 1.1rem; text-align: center; }
.mini-input.code-input { width: 130px; }
.panel-narrow .stack-form { max-width: 360px; }

/* v4.0: içerik alanı geniş tablolar yüzünden sayfayı yana taşırmasın */
.content { min-width: 0; }
.sidebar .brand-sub { white-space: nowrap; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-col > .panel { overflow-x: auto; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* v4.0: uygulamanın içindeyken sol menüde sadece o uygulama */
.nav-app { display: flex; align-items: center; gap: 0.6rem; margin: 1rem 0.3rem 0.6rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08); }
.nav-app-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; flex-shrink: 0; }
.nav-app-icon svg { width: 20px; height: 20px; }
.nav-app-name { color: #fff; font-weight: 700; font-size: 0.95rem; }

/* ===== v4.1 — Cari ===== */
.num { text-align: right; white-space: nowrap; }
.data-table th.num { text-align: right; }
.cari-ad { font-weight: 600; }
.segment-bar { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; }
.segment-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 0.84rem;
    background: var(--panel); border: 1px solid var(--border); color: var(--text);
}
.segment-chip b { font-weight: 700; color: var(--text-muted); }
.segment-chip:hover { text-decoration: none; border-color: #d9b8b4; }
.segment-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.segment-chip.active b { color: #fff; }
.seg-pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.seg-duzenli { background: #e3f7ec; color: #12734a; }
.seg-ara_sira { background: #f1ecea; color: #5a4d4c; }
.seg-yeni { background: var(--primary-light); color: var(--primary-dark); }
.seg-tek { background: #fef2e0; color: #9a6508; }
.seg-uyuyan { background: #ece9f1; color: #5b5470; }
.seg-islem_yok { background: transparent; color: var(--text-muted); border: 1px dashed var(--border); }

.cari-kimlik { display: flex; align-items: center; gap: 0.9rem; }
.cari-kimlik h1 { margin: 0 0 0.25rem; }
.cari-kimlik .page-sub { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

.tabs { display: flex; gap: 0.2rem; border-bottom: 2px solid var(--border); margin: 0 0 1.2rem; overflow-x: auto; }
.tab {
    padding: 0.65rem 1rem; color: var(--text-muted); font-weight: 600; font-size: 0.9rem;
    border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count { display: inline-block; min-width: 1.4rem; padding: 0 0.35rem; margin-left: 0.25rem; border-radius: 999px; background: #f1ecea; color: var(--text-muted); font-size: 0.72rem; text-align: center; }
.tab.active .tab-count { background: var(--primary-light); color: var(--primary-dark); }

.info-list { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0.55rem 1rem; margin: 0.8rem 0 0; font-size: 0.9rem; }
.info-list dt { color: var(--text-muted); }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
.note-box { background: #fbfaf9; border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.9rem; font-size: 0.86rem; margin: 1rem 0 0; white-space: pre-line; }
.person-card { display: flex; gap: 0.8rem; align-items: flex-start; margin-top: 0.6rem; }
.person-lines { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.4rem; font-size: 0.86rem; }
.addr-line { padding: 0.55rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.addr-line:last-child { border-bottom: none; }
.name-with-avatar { display: flex; align-items: center; gap: 0.6rem; }

.month-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.4rem; align-items: end; height: 170px; margin-top: 0.8rem; }
.month-col { display: flex; flex-direction: column; align-items: center; height: 100%; }
.month-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.bar { width: 38%; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 0; }
.bar-satis { background: var(--success); }
.bar-alis { background: #d98c8c; }
.month-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 0.25rem 0 0.8rem; vertical-align: middle; }
.legend-satis { background: var(--success); margin-left: 0; }
.legend-alis { background: #d98c8c; }

.add-block { margin-top: 1rem; }
.add-block > summary { cursor: pointer; font-weight: 700; color: var(--primary); padding: 0.4rem 0; }
.check-label { flex-direction: row !important; align-items: center; gap: 0.45rem !important; }
@media (max-width: 900px) { .info-list { grid-template-columns: 1fr; gap: 0.1rem; } .info-list dd { margin-bottom: 0.5rem; } }

/* ===== v4.2 — arama, yaklaşanlar, notlar, dosyalar, ürün kartı, fatura, etiket ===== */
.side-search { margin: 0 0.2rem 0.6rem; }
.side-search input { width: 100%; padding: 0.5rem 0.7rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #fff; font-size: 0.85rem; }
.side-search input::placeholder { color: #9c8b89; }
.home-search { margin: -0.4rem 0 0.8rem; }
.home-search input { width: 100%; max-width: 640px; padding: 0.8rem 1rem; font-size: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.home-search input:focus, .side-search input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.3rem; }
.upcoming { margin-top: -0.4rem; }
.upcoming-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.upcoming-list li a { display: grid; grid-template-columns: 120px 150px minmax(0, 1fr) auto; gap: 0.8rem; align-items: center; padding: 0.55rem 0.2rem; border-bottom: 1px solid var(--border); color: var(--text); font-size: 0.88rem; }
.upcoming-list li:last-child a { border-bottom: none; }
.upcoming-list li a:hover { background: #fbfaf9; text-decoration: none; }
.up-type { color: var(--text-muted); font-size: 0.8rem; }
.up-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-amount { font-weight: 700; white-space: nowrap; }
.search-list { list-style: none; margin: 0; padding: 0; }
.search-list li { padding: 0.45rem 0; border-bottom: 1px solid var(--border); }

.note-form { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 0.5rem; align-items: start; margin-bottom: 1rem; }
.note-form select, .note-form textarea { padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.88rem; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.tl-item { position: relative; padding: 0 0 1rem 1rem; }
.tl-item::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #cbbdbb; }
.tl-ariza::before { background: var(--danger); }
.tl-konfigurasyon::before { background: var(--primary); }
.tl-servis::before { background: var(--warning); }
.tl-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.tl-body { margin-top: 0.3rem; font-size: 0.9rem; white-space: pre-line; }
.tl-del { margin-left: auto; }
.note-kind { font-size: 0.72rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px; background: #f1ecea; color: #5a4d4c; }
.nk-ariza { background: #fbe9e9; color: #a92c2c; }
.nk-konfigurasyon { background: var(--primary-light); color: var(--primary-dark); }
.nk-servis { background: #fef2e0; color: #9a6508; }
.link-btn { background: none; border: none; color: var(--text-muted); font-size: 0.78rem; cursor: pointer; padding: 0; text-decoration: underline; }
.link-btn:hover { color: var(--danger); }

.upload-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.upload-form input[type=text] { padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; flex: 1; min-width: 160px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; margin-top: 1rem; }
.gallery-item { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fbfaf9; }
.gallery-item img { display: block; width: 100%; height: 130px; object-fit: cover; }
.gallery-item figcaption { display: flex; justify-content: space-between; gap: 0.4rem; padding: 0.35rem 0.5rem; font-size: 0.75rem; color: var(--text-muted); overflow-wrap: anywhere; }

.thumb-cell { width: 52px; padding-right: 0 !important; }
.thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; display: flex; align-items: center; justify-content: center; }
.thumb-empty { background: #f1ecea; color: #b3a3a1; }
.thumb-empty svg { width: 20px; height: 20px; }
.product-cover { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--border); }
.product-cover-empty { background: var(--primary-light); color: var(--primary); }
.barcode-preview { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem; max-width: 320px; }
.barcode-preview .barcode { width: 100%; height: 70px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.stat-value-sm { font-size: 1.1rem; }

.label-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.3rem 1rem; max-height: 340px; overflow: auto; }
.label-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 70px; gap: 0.5rem; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.86rem; }
.label-sheet { display: flex; flex-wrap: wrap; gap: 4mm; margin-top: 1rem; }
.label { box-sizing: border-box; border: 1px dashed #bbb; padding: 1.5mm 2mm; display: flex; flex-direction: column; background: #fff; overflow: hidden; color: #000; font-family: Arial, sans-serif; }
.label-company { font-size: 6pt; color: #555; }
.label-name { font-size: 8pt; font-weight: 700; line-height: 1.1; max-height: 2.3em; overflow: hidden; }
.label-model { font-size: 7pt; }
.label-code { flex: 1; min-height: 0; margin-top: 0.5mm; }
.label-code .barcode { width: 100%; height: 100%; }

.invoice-sheet { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.invoice-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 1.5rem; margin-bottom: 1.2rem; }
.inv-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.inv-party { font-size: 1.15rem; font-weight: 700; }
.inv-meta { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 0.3rem 0.8rem; margin: 0; font-size: 0.88rem; }
.inv-meta dt { color: var(--text-muted); } .inv-meta dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: Consolas, monospace; font-size: 0.78rem; }
.invoice-totals { display: flex; flex-direction: column; align-items: flex-end; margin-top: 1rem; }
.invoice-totals dl { display: grid; grid-template-columns: auto 160px; gap: 0.3rem 1.2rem; margin: 0; font-size: 0.92rem; }
.invoice-totals dd { margin: 0; text-align: right; }
.invoice-totals .grand { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--text); padding-top: 0.4rem; }
.desc-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-range { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--text-muted); }
.pager { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 1rem; }
.pager a { padding: 0.3rem 0.65rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.pager a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

@media print {
    .sidebar, .no-print, .flash-stack { display: none !important; }
    .app-shell { display: block; } .content { padding: 0; max-width: none; }
    body { background: #fff; }
    .invoice-sheet { border: none; padding: 0; }
    .label-sheet { margin: 0; gap: 0; }
    .label-roll .label { border: none; page-break-after: always; }
    .label-sheet-a4 { gap: 0; }
    .label-sheet-a4 .label { border: none; width: 66mm !important; height: 34mm !important; margin: 0 2mm 1.5mm 0; }
}
@media (max-width: 900px) {
    .invoice-head { grid-template-columns: 1fr; }
    .upcoming-list li a { grid-template-columns: 100px minmax(0, 1fr); }
    .up-type, .up-amount { display: none; }
    .note-form { grid-template-columns: 1fr; }
}
.invoice-sheet .table-scroll .data-table { min-width: 760px; }
@media (max-width: 900px) { .invoice-sheet { padding: 1rem; } .invoice-totals dl { grid-template-columns: auto 130px; } }

/* ===== v4.3 — Personel (İK) ===== */
.section-title { font-size: 1.05rem; margin: 1.6rem 0 0.8rem; }
.progress { width: 90px; height: 6px; background: #efe9e8; border-radius: 99px; overflow: hidden; margin: 0.2rem 0; }
.progress span { display: block; height: 100%; background: var(--success); }
.dv, .dv-pill { display: inline-block; min-width: 1.5rem; text-align: center; font-size: 0.72rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 6px; background: #f1ecea; color: #5a4d4c; }
.dv-pill { font-weight: 600; font-size: 0.76rem; padding: 0.15rem 0.55rem; border-radius: 999px; }
.dv-geldi { background: #e3f7ec !important; color: #12734a !important; }
.dv-saha { background: var(--primary-light) !important; color: var(--primary-dark) !important; }
.dv-uzaktan { background: #eef0f7 !important; color: #444a66 !important; }
.dv-izin { background: #fef2e0 !important; color: #9a6508 !important; }
.dv-rapor, .dv-mazeret { background: #fdeee4 !important; color: #a3521b !important; }
.dv-gelmedi { background: #fbe9e9 !important; color: #a92c2c !important; }
.dv-tatil { background: #ece9f1 !important; color: #5b5470 !important; }
.devam-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.2rem; align-items: center; font-size: 0.8rem; color: var(--text-muted); margin: 0.4rem 0 0.9rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 0.75rem; color: var(--text-muted); text-align: center; padding-bottom: 0.2rem; font-weight: 600; }
.cal-cell { min-height: 64px; border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.4rem; display: flex; flex-direction: column; gap: 0.1rem; background: var(--panel); font-size: 0.75rem; }
.cal-empty { border: none; background: transparent; }
.cal-weekend { background: #faf8f7; }
.cal-day { font-weight: 700; font-size: 0.8rem; }
.cal-status { font-weight: 600; }
.cal-time { color: var(--text-muted); font-size: 0.7rem; }
.puantaj { border-collapse: collapse; font-size: 0.75rem; width: 100%; }
.puantaj th, .puantaj td { border: 1px solid var(--border); padding: 0.25rem 0.2rem; text-align: center; min-width: 24px; }
.puantaj td a { display: block; color: inherit; text-decoration: none; }
.puantaj .p-name { text-align: left; min-width: 150px; white-space: nowrap; padding: 0.3rem 0.5rem; position: sticky; left: 0; background: var(--panel); }
.puantaj .p-we { background: #f5f1f0; }
.doc-table td { vertical-align: top; }
.stack-form input[type=checkbox], .stack-form input[type=radio] { width: auto !important; min-width: 0; flex: 0 0 auto; }
.check-label { justify-content: flex-start; }
.print-only { display: none; }
.sign-row { display: flex; justify-content: space-between; margin-top: 3rem; }
.sign-row div { width: 40%; border-top: 1px solid #000; padding-top: 0.4rem; font-size: 0.85rem; }
@media print { .print-only { display: flex !important; } .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.bar-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 120px; gap: 0.6rem; align-items: center; padding: 0.3rem 0; font-size: 0.86rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: #f1ecea; border-radius: 99px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar-val { text-align: right; font-weight: 600; }

/* ===== v4.7 — Servis kayıtları ===== */
.oncelik-pill { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.oncelik-dusuk { background: #eef0f7; color: #444a66; }
.oncelik-normal { background: #f1ecea; color: #5a4d4c; }
.oncelik-yuksek { background: #fef2e0; color: #9a6508; }
.oncelik-acil { background: #fbe9e9; color: #a92c2c; }
.st-acik { background: var(--primary-light); color: var(--primary-dark); }
.st-atandi { background: #eef0f7; color: #444a66; }
.st-sahada { background: #fef2e0; color: #9a6508; }
.st-parca_bekliyor { background: #fdeee4; color: #a3521b; }
.st-cozuldu { background: #e3f7ec; color: #12734a; }
.st-kapandi { background: #f1ecea; color: #5a4d4c; }
.st-iptal { background: transparent; color: var(--text-muted); border: 1px dashed var(--border); }

/* ===== v4.8 — Sevkiyat, Proje, Dış Ticaret, Notlar ===== */
.sh-hazirlaniyor { background: #fef2e0; color: #9a6508; }
.sh-yolda { background: var(--primary-light); color: var(--primary-dark); }
.sh-teslim_edildi { background: #e3f7ec; color: #12734a; }
.sh-iptal { background: transparent; color: var(--text-muted); border: 1px dashed var(--border); }
.tt-proforma { background: #f1ecea; color: #5a4d4c; }
.tt-siparis { background: #eef0f7; color: #444a66; }
.tt-yolda { background: var(--primary-light); color: var(--primary-dark); }
.tt-gumrukte { background: #fef2e0; color: #9a6508; }
.tt-tamamlandi { background: #e3f7ec; color: #12734a; }
.tt-iptal { background: transparent; color: var(--text-muted); border: 1px dashed var(--border); }

.phase-board { display: flex; gap: 0.9rem; overflow-x: auto; padding-bottom: 0.5rem; }
.phase-col { flex: 0 0 260px; background: #fbfaf9; border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; }
.phase-col-new { background: transparent; border-style: dashed; justify-content: center; }
.phase-head { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; }
.phase-head strong { font-size: 0.9rem; }
.phase-status { font-size: 0.72rem; padding: 0.15rem 0.3rem; border-radius: 6px; border: 1px solid var(--border); }
.phase-bekliyor { background: #f1ecea; }
.phase-devam { background: var(--primary-light); }
.phase-tamamlandi { background: #e3f7ec; }
.task-card { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid #cbbdbb; border-radius: 8px; padding: 0.5rem 0.6rem; font-size: 0.84rem; }
.task-devam { border-left-color: var(--primary); }
.task-tamamlandi { border-left-color: var(--success); opacity: 0.75; }
.task-iptal { border-left-color: var(--text-muted); opacity: 0.6; text-decoration: line-through; }
.task-add { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.3rem; }
.task-add input, .task-add select { padding: 0.3rem 0.4rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.78rem; }

.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; }
.note-card { display: flex; flex-direction: column; gap: 0.3rem; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; color: var(--text); min-height: 130px; position: relative; }
.note-card:hover { border-color: #d9b8b4; text-decoration: none; }
.note-pinned { border-color: var(--primary); background: var(--primary-light); }
.pin-badge { position: absolute; top: 0.6rem; right: 0.7rem; font-size: 0.9rem; }
.note-title { font-size: 0.98rem; }
.note-preview { font-size: 0.82rem; color: var(--text-muted); flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

@media (max-width: 900px) { .phase-board { flex-direction: column; } .phase-col { flex: none; } }
.phase-board-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.phase-board { width: max-content; max-width: none; }

/* ===== v5.1 — Proje: sağlık, ilerleme, Gantt ===== */
.rag { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; flex-shrink: 0; }
.rag-yesil { background: var(--success); }
.rag-sari { background: var(--warning); }
.rag-kirmizi { background: var(--danger); }
h1 .rag { width: 16px; height: 16px; margin-right: 0.2rem; }
.progress-lg { width: 100%; height: 8px; position: relative; overflow: visible; }
.progress-lg span { border-radius: 99px; }
.progress-lg i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: 0.55; }
.plan-preview { padding-left: 1.2rem; line-height: 1.8; font-size: 0.88rem; margin: 0.4rem 0 0; }
.plan-table td { vertical-align: top; }

.gantt { font-size: 0.8rem; overflow-x: auto; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 210px minmax(420px, 1fr); align-items: center; }
.gantt-row { border-bottom: 1px solid var(--border); min-height: 42px; }
.gantt-late .gantt-label { color: var(--danger); }
.gantt-label { padding: 0.35rem 0.6rem 0.35rem 0; overflow: hidden; text-overflow: ellipsis; }
.gantt-track { position: relative; height: 34px; }
.gantt-head .gantt-track { height: 22px; border-bottom: 1px solid var(--border); }
.gantt-month { position: absolute; top: 2px; font-size: 0.68rem; color: var(--text-muted); border-left: 1px solid var(--border); padding-left: 3px; white-space: nowrap; }
.gantt-today { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--danger); opacity: 0.7; z-index: 3; }
.gbar { position: absolute; border-radius: 4px; }
.gbar-base { top: 4px; height: 6px; background: #d8cfcd; }
.gbar-plan { top: 11px; height: 12px; background: #e9b9b5; overflow: hidden; }
.gbar-plan .gbar-fill { display: block; height: 100%; background: var(--primary); }
.gbar-kirmizi { background: #f3c1c1; outline: 1px solid var(--danger); }
.gbar-sari { background: #f7dfb4; }
.gbar-yesil { background: #c6ead6; }
.gbar-yesil .gbar-fill { background: var(--success); }
.gbar-sari .gbar-fill { background: var(--warning); }
.gbar-kirmizi .gbar-fill { background: var(--danger); }
.gbar-actual { top: 25px; height: 5px; background: #3b2f30; }
.gms { position: absolute; top: 10px; width: 13px; height: 13px; margin-left: -6px; background: var(--primary-dark); transform: rotate(45deg); z-index: 2; }
.gms-ok { background: var(--success); }
.gms-late { background: var(--danger); }
.legend-base { background: #d8cfcd; }
.legend-plan { background: var(--primary); }
.legend-actual { background: #3b2f30; }
@media print { .gantt-head, .gantt-row { grid-template-columns: 160px 1fr; } .tabs { display: none; } }
.mini-form { flex-wrap: wrap; max-width: 100%; }
.tl-head { min-width: 0; }
.tl-body { overflow-wrap: anywhere; }
.code-block { background: #1e1a1b; color: #f3ecea; padding: 0.8rem; border-radius: 8px; font-size: 0.74rem; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.search-hero input[type=search] { flex: 1 1 380px; font-size: 1rem; padding: 0.7rem 0.9rem; border: 2px solid var(--primary-light); border-radius: 10px; }
.search-hero input[type=search]:focus { border-color: var(--primary); outline: none; }
.seri-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.4rem 0.8rem; }
.seri-grid label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; }
.seri-grid label span { color: var(--text-muted); min-width: 1.8rem; text-align: right; }
.seri-grid input { flex: 1; min-width: 0; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-family: ui-monospace, monospace; }
.pick-list { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; max-height: 180px; overflow: auto; padding: 0.3rem 0; }
.pick-list label { font-size: 0.8rem; font-family: ui-monospace, monospace; background: #f6f2f1; border-radius: 6px; padding: 0.15rem 0.45rem; display: flex; gap: 0.3rem; align-items: center; }
.masraf-satir select { min-width: 140px; }
.row-sub td { background: #fbf8f7; padding-top: 0.2rem; }

/* ===== Türkçe tarih seçici ===== */
input.tr-date { font-variant-numeric: tabular-nums; min-width: 7.5rem; }
.tr-cal { position: absolute; z-index: 1000; width: 250px; background: var(--panel, #fff); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(40,20,20,.18); padding: 0.55rem; font-size: 0.82rem; }
.tr-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; font-weight: 700; }
.tr-cal-head button { border: 0; background: #f4eeec; border-radius: 6px; width: 28px; height: 26px; cursor: pointer; font-size: 1rem; }
.tr-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.tr-cal-grid b { font-size: 0.7rem; color: var(--text-muted); padding: 0.15rem 0; }
.tr-cal-grid button, .tr-cal-months button { border: 0; background: transparent; border-radius: 6px; padding: 0.3rem 0; cursor: pointer; font: inherit; }
.tr-cal-grid button:hover, .tr-cal-months button:hover { background: var(--primary-light); }
.tr-cal button.bugun { outline: 1px solid var(--primary); }
.tr-cal button.sec { background: var(--primary); color: #fff; }
.tr-cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tr-cal-foot { display: flex; justify-content: space-between; margin-top: 0.45rem; }
.tr-cal-foot button { border: 0; background: transparent; color: var(--primary); cursor: pointer; font: inherit; font-weight: 600; }

/* ===== Ödeme takvimi (ana ekran) ===== */
.takvim-nav { display: flex; align-items: center; gap: 0.5rem; }
.takvim-nav strong { min-width: 8.5rem; text-align: center; }
.tk-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tk-gunadi { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-align: center; padding: 0.2rem 0; }
.tk-gun { min-height: 78px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel, #fff); padding: 0.3rem 0.35rem; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; overflow: hidden; }
.tk-gun:hover { border-color: #d9b8b4; }
.tk-diger { opacity: 0.45; }
.tk-bugun { border: 2px solid var(--primary); }
.tk-secili { background: var(--primary-light); }
.tk-no { font-size: 0.8rem; font-weight: 700; }
.tk-tutar { font-size: 0.7rem; font-weight: 700; border-radius: 4px; padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-tutar.tk-alacak { background: #e3f7ec; color: #12734a; }
.tk-tutar.tk-borc { background: #fbe9e9; color: #a92c2c; }
.tk-gec { font-size: 0.65rem; color: var(--danger); font-weight: 700; }
.tk-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.tk-dot.tk-alacak { background: var(--success); } .tk-dot.tk-borc { background: var(--danger); }
.tk-detay { margin-top: 0.8rem; border-top: 1px solid var(--border); padding-top: 0.6rem; }
.tk-detay h3 { font-size: 0.95rem; margin: 0 0 0.4rem; }
@media (max-width: 700px) { .tk-gun { min-height: 52px; } .tk-tutar { font-size: 0.6rem; } }
.due-ok { background: #e3f7ec; color: #12734a; }
.page-header-row { flex-wrap: wrap; row-gap: 0.6rem; }
.page-header-row > form.mini-form { flex-wrap: wrap; }
.inv-totals .tl-ayrac, dt.tl-ayrac, dd.tl-ayrac { border-top: 1px dashed var(--border); padding-top: 0.4rem; margin-top: 0.3rem; }

/* ===== Toplu seçim ===== */
.tp-hucre { width: 34px; text-align: center; padding-left: 0.4rem !important; padding-right: 0.2rem !important; }
.tp-hucre input, .tp-kart input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
tr.tp-secili td { background: var(--primary-light) !important; }
.tp-kart { position: absolute; top: 0.55rem; left: 0.55rem; z-index: 2; background: #fff; border-radius: 4px; padding: 1px 3px; }
[data-toplu] > [data-id] { padding-left: 2rem; }
table[data-toplu] > tbody > tr[data-id] { padding-left: 0; }
.note-card.tp-secili { outline: 2px solid var(--primary); }
.tp-kart-hepsi { display: inline-flex; margin-bottom: 0.5rem; }
.tp-cubuk { position: fixed; left: 50%; bottom: 1.1rem; transform: translateX(-50%); z-index: 900; display: flex; flex-wrap: wrap;
  align-items: center; gap: 0.45rem; background: #1b1315; color: #fff; border-radius: 12px; padding: 0.6rem 0.8rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.28); max-width: calc(100vw - 2rem); }
.tp-cubuk .tp-sayi { font-weight: 700; margin-right: 0.4rem; white-space: nowrap; }
.tp-cubuk .btn-secondary { background: #3a2e30; color: #fff; border-color: #4a3b3d; }
.tp-cubuk .tp-iptal { background: transparent; color: #d8c9c7; border: 0; }
@media print { .tp-cubuk, .tp-hucre, .tp-kart, .tp-kart-hepsi { display: none !important; } }
.tp-cubuk[hidden] { display: none !important; }

/* ===== v6.2.1: Denetçi (salt okunur) — değişiklik yapan formlar hiç gösterilmez ===== */
.denetci-seridi { background: #fff4dc; color: #6b4c00; border: 1px solid #f0d9a0; border-radius: 8px;
  padding: 0.5rem 0.8rem; margin-bottom: 1rem; font-size: 0.88rem; }
body.rol-denetci form[method="post" i]:not(.denetci-izinli),
body.rol-denetci form[method="POST"]:not(.denetci-izinli),
body.rol-denetci button[form],
body.rol-denetci .yazma-islemi,
body.rol-denetci a.btn[href*="/yeni"],
body.rol-denetci a.btn[href*="/ekle"],
body.rol-denetci a.btn[href*="/giris"],
body.rol-denetci a.btn[href*="xml-aktar"] { display: none !important; }
/* :has desteklemeyen eski tarayıcıda yalnızca bu kural yok sayılsın diye ayrı yazıldı */
body.rol-denetci details.inline-details:has(> form[method="post" i]) { display: none !important; }

/* ===== v6.2.1: aranabilir açılır liste ===== */
.ara-select-kutu { display: block; width: 100%; margin-bottom: 0.3rem; font-size: 0.85rem; padding: 0.35rem 0.5rem; }

/* ===== v6.2.1: ödeme ekranı ===== */
.yon-secici { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.yon-kart { display: flex; flex-direction: column; gap: 0.2rem; border: 2px solid var(--border); border-radius: 10px;
  padding: 0.7rem 0.9rem; cursor: pointer; background: #fff; }
.yon-kart input { position: absolute; opacity: 0; pointer-events: none; }
.yon-kart b { font-size: 1.05rem; letter-spacing: 0.02em; }
.yon-kart span { font-size: 0.82rem; color: var(--text-muted, #6b5f5e); }
.yon-kart.secili { border-color: var(--primary); background: var(--primary-light); }
.od-ozet { font-weight: 600; margin: 0.6rem 0; }
.od-ozet.od-hata { color: var(--danger); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem 1rem; }
.info-grid dt { font-size: 0.75rem; color: var(--text-muted, #6b5f5e); text-transform: uppercase; letter-spacing: 0.03em; }
.info-grid dd { margin: 0; font-weight: 600; }
@media (max-width: 560px) { .yon-secici { grid-template-columns: 1fr; } }
.data-table.compact th, .data-table.compact td { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.eski-deger { color: #a92c2c; text-decoration: line-through; }
.yeni-deger { color: #12734a; font-weight: 600; }
.badge-uyari { background: #fbe9e9; color: #a92c2c; }

/* v6.3: tıklanabilir istatistik kartı, Bugün yapılacaklar */
a.stat-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.stat-link:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .7rem; }
.todo-item { display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--panel); color: inherit; text-decoration: none; border-left: 4px solid var(--border); }
.todo-item:hover { border-color: var(--primary); }
.todo-item .todo-sayi { font-size: 1.35rem; font-weight: 700; min-width: 2.2ch; text-align: center; }
.todo-item .todo-metin { display: flex; flex-direction: column; font-size: .88rem; line-height: 1.25; }
.todo-item .todo-metin small { color: var(--text-muted); font-size: .78rem; }
.todo-kritik { border-left-color: #d64545; }
.todo-kritik .todo-sayi { color: #b42323; }
.todo-uyari { border-left-color: #e0a100; }
.todo-uyari .todo-sayi { color: #9a6b00; }
.todo-bilgi { border-left-color: var(--primary); }
.todo-bos { padding: .6rem 0; color: #12734a; }

/* v6.3: ürün fiyat geçmişi / zam radarı */
.fiyat-degisim { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fiyat-degisim.zam { color: #9a6b00; }
.fiyat-degisim.zam-belirgin { color: #b42323; }
.fiyat-degisim.zam-buyuk { color: #fff; background: #b42323; padding: 0 .35rem; border-radius: 4px; }
.fiyat-degisim.indirim { color: #12734a; }
.fiyat-degisim.sabit { color: var(--text-muted); font-weight: 400; }
.data-table tr.row-zam td { background: #fff6f5; }
.data-table tr.row-selected td { background: var(--primary-light); }
.fiyat-grafik { width: 100%; height: auto; max-height: 240px; display: block; }
.fg-eksen { stroke: var(--border); stroke-width: 1; }
.fg-etiket { font-size: 10px; fill: var(--text-muted); }
.fg-cizgi { fill: none; stroke: var(--primary); stroke-width: 2; }
.fg-nokta { fill: #fff; stroke: var(--primary); stroke-width: 2; }
.fg-nokta.zam-belirgin, .fg-nokta.zam-buyuk { fill: #b42323; stroke: #b42323; }
.fg-nokta.indirim { fill: #12734a; stroke: #12734a; }
.filter-bar .ara-select-kutu { display: inline-block; width: 170px; margin-bottom: 0; }
.cashflow-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 0.8rem; font-size: 0.8rem; color: var(--text-muted); }

/* v6.4: teklifler */
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.teklif-taslak { background: #f1ecea; color: #5a4d4c; }
.teklif-gonderildi { background: var(--primary-light); color: var(--primary-dark); }
.teklif-kabul { background: #e3f7ec; color: #12734a; }
.teklif-red { background: #fbe9e9; color: #a92c2c; }
.teklif-iptal, .teklif-revize { background: #eeeaea; color: #8a7d7b; text-decoration: line-through; }
.teklif-revize { text-decoration: none; font-style: italic; }
.teklif-kalemleri td { padding: .35rem .3rem; vertical-align: top; }
.teklif-kalemleri input, .teklif-kalemleri select { width: 100%; min-width: 0; padding: .35rem .4rem; font-size: .88rem; }
.teklif-kalemleri input.num { text-align: right; }
.teklif-kalemleri .satir-tutar { font-weight: 600; white-space: nowrap; padding-top: .6rem; }
.teklif-kalemleri .satir-no { color: var(--text-muted); padding-top: .6rem; }
.fiyat-oneri { margin-top: .25rem; line-height: 1.4; }
.fiyat-oneri a { font-weight: 600; }
.teklif-toplam { display: flex; flex-direction: column; align-items: flex-end; margin-top: 1rem; }
.teklif-toplam dl { display: grid; grid-template-columns: auto 170px; gap: .3rem 1.2rem; margin: 0; font-size: .92rem; }
.teklif-toplam dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.teklif-toplam .grand { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--text); padding-top: .4rem; }
@media (max-width: 900px) { .form-grid-3 { grid-template-columns: 1fr; } }

/* ===== v6.4: telefon / tablet (≤900px) — üst çubuk, açılır yan menü, alt hızlı erişim ===== */
.mobil-ust, .mobil-alt, .mobil-perde { display: none; }
@media (max-width: 900px) {
    .mobil-ust { display: flex; align-items: center; gap: .6rem; position: sticky; top: 0; z-index: 900;
        background: var(--sidebar-bg); color: #fff; padding: .5rem .7rem; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
    .mobil-menu-btn { background: none; border: 0; color: inherit; padding: .35rem; border-radius: 8px; cursor: pointer;
        display: inline-flex; align-items: center; justify-content: center; }
    .mobil-ust .mobil-menu-btn:active { background: rgba(255,255,255,.12); }
    .mobil-marka { color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; text-decoration: none; }
    .mobil-ara { flex: 1; min-width: 0; margin: 0; }
    .mobil-ara input { width: 100%; padding: .45rem .7rem; border-radius: 8px; border: 1px solid rgba(255,255,255,.18);
        background: rgba(255,255,255,.08); color: #fff; font-size: 16px; }
    .mobil-ara input::placeholder { color: #b9a9a7; }

    .app-shell { display: block; }
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000; width: min(86vw, 320px);
        flex-direction: column; flex-wrap: nowrap; align-items: stretch; overflow-y: auto;
        transform: translateX(-105%); transition: transform .2s ease; box-shadow: 4px 0 18px rgba(0,0,0,.35); }
    body.menu-acik .sidebar { transform: none; }
    body.menu-acik { overflow: hidden; }
    .sidebar .side-search { display: none; }
    .sidebar .nav-link { padding: .75rem .8rem; }
    .sidebar-footer { margin-top: auto; margin-left: 0; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1rem;
        display: block; }
    .mobil-perde:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 950; }

    .content { padding: 1rem .9rem 5.2rem; max-width: none; }
    .mobil-alt { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: #fff;
        border-top: 1px solid var(--border); padding: .25rem .2rem calc(.25rem + env(safe-area-inset-bottom)); }
    .mobil-alt a, .mobil-alt button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem;
        padding: .3rem 0; color: var(--text-muted); font-size: .7rem; text-decoration: none; background: none; border: 0; font-family: inherit; }
    .mobil-alt svg { width: 22px; height: 22px; }
    .mobil-alt .aktif { color: var(--primary); font-weight: 700; }
    .page-header h1 { font-size: 1.35rem; }
    .row-actions { flex-wrap: wrap; }
    .filter-bar { flex-wrap: wrap; }
    .filter-bar input[type=text], .filter-bar input[type=search] { min-width: 0 !important; flex: 1 1 200px; }
    .data-table { font-size: .85rem; }
    .todo-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .form-grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
    .stat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .todo-grid { grid-template-columns: 1fr; }
    .page-header-row { flex-direction: column; align-items: stretch; gap: .6rem; }
}
@media print { .mobil-ust, .mobil-alt, .mobil-perde { display: none !important; } }

/* v6.4: katlanabilir form bölümleri (servis girişi) */
details.bolum > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
details.bolum > summary::-webkit-details-marker { display: none; }
details.bolum > summary h2 { margin: 0; }
details.bolum > summary h2::before { content: "▸"; display: inline-block; margin-right: .45rem; color: var(--text-muted); transition: transform .15s; }
details.bolum[open] > summary h2::before { transform: rotate(90deg); }
details.bolum > summary .bolum-ozet { color: var(--text-muted); font-size: .85rem; }
details.bolum[open] > summary { margin-bottom: .9rem; }
details.bolum:not([open]) { padding-top: .9rem; padding-bottom: .9rem; }
@media (max-width: 900px) {
    .servis-kaydet { position: sticky; bottom: 4.4rem; background: var(--bg, #f6f3f2); padding: .5rem 0; z-index: 5; }
    .servis-kaydet .btn { width: 100%; }
}
.filtre-hatirla { background: #fff8e6; border: 1px solid #f0dca8; color: #6b5310; border-radius: 8px; padding: .45rem .8rem;
    font-size: .85rem; margin-bottom: .9rem; }
.filtre-hatirla a { font-weight: 600; margin-left: .3rem; }

/* v6.4: canlı arama önerileri */
.arama-kap { position: relative; }
.arama-oneri { position: absolute; left: 0; top: calc(100% + 4px); z-index: 1100; width: max(100%, 340px); max-width: 92vw;
    max-height: 70vh; overflow-y: auto; background: #fff; color: var(--text); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: .3rem 0; text-align: left; }
.arama-oneri .ao-grup { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: .45rem .8rem .15rem; }
.arama-oneri .ao-oge { display: flex; flex-direction: column; padding: .4rem .8rem; color: var(--text); text-decoration: none; font-size: .88rem; }
.arama-oneri .ao-oge span { color: var(--text-muted); font-size: .78rem; }
.arama-oneri .ao-oge:hover, .arama-oneri .ao-oge.secili { background: var(--primary-light); }
.arama-oneri .ao-bos { padding: .6rem .8rem; color: var(--text-muted); font-size: .85rem; }
.mobil-ara .arama-oneri { right: 0; left: auto; }
.pager { align-items: center; }
.pager-bosluk { padding: 0 .2rem; color: var(--text-muted); }
.pager-bilgi { margin-left: .5rem; font-size: .8rem; color: var(--text-muted); }
.nav-uygulama { display: flex; align-items: center; gap: .55rem; }
.nav-uygulama svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-uygulamalar { margin-top: .4rem; }
.mobil-only { display: none; }
.nav-diger > summary { list-style: none; cursor: pointer; color: #9c8b89; font-size: .85rem; margin-top: .4rem; }
.nav-diger > summary::-webkit-details-marker { display: none; }
.nav-diger > summary::after { content: " ▾"; }
@media (max-width: 900px) { .mobil-only { display: block; } }
.kdv-ayrim { font-size: .8rem; color: var(--text-muted); margin-top: .35rem; }
.kdv-ayrim b { color: var(--text); font-weight: 600; }

/* ===== v6.4.1: telefon düzeni (≤640px) — kart görünümlü tablolar, taşmayan formlar ===== */
@media (max-width: 900px) {
    .date-range { flex-wrap: wrap; }
    .date-range input { flex: 1 1 120px; min-width: 0; }
    input, select, textarea { max-width: 100%; }
    .mini-input { max-width: 100%; }
    .stat-value { overflow-wrap: anywhere; }
    .content img, .content svg { max-width: 100%; }
    .tr-cal { width: min(300px, 94vw); font-size: .95rem; }
    .tr-cal-grid button, .tr-cal-months button { padding: .5rem 0; }
}
@media (max-width: 640px) {
    /* iOS'ta kutuya dokununca sayfanın yakınlaşmaması için 16px */
    input, select, textarea, .filter-bar input, .filter-bar select { font-size: 16px; }
    .content { padding: .8rem .7rem 5.4rem; }
    .panel { padding: .9rem .8rem; border-radius: 10px; }
    .page-header { margin-bottom: .8rem; }
    .page-header h1 { font-size: 1.25rem; }
    .page-sub { font-size: .85rem; }
    .stat-grid, .stat-grid-3, .stat-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .55rem; }
    .stat-card { padding: .7rem .75rem; }
    .stat-value { font-size: 1.15rem; }
    .stat-label { font-size: .7rem; }
    .row-actions { gap: .4rem; }
    .row-actions .btn { flex: 1 1 auto; text-align: center; }
    .filter-bar > * { flex: 1 1 100%; }
    .filter-bar .btn { flex: 1 1 auto; }
    .segment-bar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .2rem; }
    .segment-chip { white-space: nowrap; }
    .sort-bar { flex-wrap: wrap; }
    .sort-bar select { flex: 1 1 140px; min-width: 0; }
    .mini-form { flex-wrap: wrap; }
    .form-grid, .form-grid-2, .form-grid-3 { grid-template-columns: minmax(0, 1fr) !important; }
    .form-grid label[style*="grid-column"] { grid-column: auto !important; }
    .info-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
    .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .tabs .tab { white-space: nowrap; }
    .two-col, .three-col { grid-template-columns: minmax(0, 1fr) !important; }
    .pager { justify-content: center; }
    .pager a { padding: .45rem .75rem; }

    /* Tablolar: 4+ sütunlu listeler kart görünümüne geçer (başlıklar her satırda etiket olur) */
    .table-scroll .data-table.kartli { min-width: 0; }
    table.kartli, table.kartli > tbody, table.kartli > tfoot, table.kartli > tbody > tr, table.kartli > tfoot > tr,
    table.kartli > tbody > tr > td, table.kartli > tfoot > tr > td, table.kartli > tfoot > tr > th { display: block; width: 100%; }
    table.kartli > thead { display: none; }
    table.kartli > tbody > tr, table.kartli > tfoot > tr { border: 1px solid var(--border); border-radius: 10px; margin: 0 0 .6rem;
        padding: .35rem .7rem; background: var(--panel, #fff); }
    table.kartli > tbody > tr > td, table.kartli > tfoot > tr > td, table.kartli > tfoot > tr > th {
        border: 0; padding: .3rem 0; text-align: right; min-height: 1.2rem; overflow-wrap: anywhere; }
    table.kartli > tbody > tr > td + td { border-top: 1px dashed #eee6e4; }
    table.kartli > tbody > tr > td::before, table.kartli > tfoot > tr > td::before, table.kartli > tfoot > tr > th::before {
        content: attr(data-label); float: left; max-width: 45%; text-align: left; color: var(--text-muted);
        font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: .12rem .6rem 0 0; }
    table.kartli > tbody > tr > td::after { content: ""; display: block; clear: both; }
    table.kartli > tbody > tr > td[data-label=""], table.kartli > tfoot > tr > td[data-label=""] { text-align: left; }
    table.kartli > tbody > tr > td[data-label=""]::before { display: none; }
    table.kartli td[colspan] { text-align: left; }
    table.kartli td[colspan]::before { display: none; }
    table.kartli > tbody > tr:first-child > td { }
    table.kartli > tbody > tr.row-overdue { border-left: 4px solid #d64545; }
    table.kartli > tbody > tr.row-muted { opacity: .75; }
    table.kartli .row-actions, table.kartli .mini-form { justify-content: flex-end; }
    table.kartli .cell-sub { display: block; }
    table.kartli td input[type="text"], table.kartli td input:not([type]), table.kartli td select, table.kartli td textarea { width: 100%; }
    table.kartli.clickable-rows > tbody > tr { cursor: pointer; }
    .table-scroll { overflow-x: auto; }
}
@media (max-width: 640px) {
    table.kartli > tbody > tr { position: relative; }
    table.kartli > tbody > tr > td.tp-hucre { position: absolute; top: .35rem; right: .6rem; width: auto; padding: 0; border: 0; }
    table.kartli > tbody > tr > td.tp-hucre + td { border-top: 0; padding-right: 3rem; }
    table.kartli > tbody > tr > td.tp-hucre input { width: 22px; height: 22px; }
}
@media (max-width: 640px) {
    /* Teklif kalemleri: telefonda iki sütunlu kompakt kart */
    .teklif-kalemleri.kartli > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .15rem .6rem; padding-top: .5rem; }
    .teklif-kalemleri.kartli > tbody > tr > td { border-top: 0 !important; text-align: left; padding: .15rem 0; width: auto; }
    .teklif-kalemleri.kartli > tbody > tr > td::before { float: none; display: block; max-width: none; padding: 0 0 .12rem; }
    .teklif-kalemleri.kartli > tbody > tr > td.satir-no { grid-column: 1 / -1; font-weight: 700; color: var(--primary); padding-top: 0; }
    .teklif-kalemleri.kartli > tbody > tr > td.satir-no::before { display: inline; content: "Kalem "; font-size: .85rem; text-transform: none; color: var(--primary); }
    .teklif-kalemleri.kartli > tbody > tr > td:nth-child(2), .teklif-kalemleri.kartli > tbody > tr > td:nth-child(3) { grid-column: 1 / -1; }
    .teklif-kalemleri.kartli > tbody > tr > td.satir-tutar { text-align: right; font-size: 1rem; align-self: end; padding-bottom: .5rem; }
    .teklif-kalemleri.kartli > tbody > tr > td:last-child { position: absolute; top: .35rem; right: .6rem; padding: 0; }
    .teklif-kalemleri.kartli > tbody > tr > td:last-child::before { display: none; }
    .teklif-kalemleri.kartli .satir-sil { font-size: 1.2rem; padding: .1rem .4rem; }
    .satir-ekle-alt { width: 100%; margin-top: .3rem; }
}
@media (min-width: 641px) { .satir-ekle-alt { display: none; } }
@media (max-width: 640px) {
    select[data-ara], .ara-select-kutu { display: block; width: 100% !important; margin-bottom: .35rem; }
    .mini-form > label { flex: 1 1 100% !important; min-width: 0 !important; }
    .mini-form > label > select, .mini-form > label > input { width: 100%; }
    .stack-form input, .stack-form select, .stack-form textarea { width: 100%; }
    .page-header.page-header-row > .btn, .page-header.page-header-row > form { width: 100%; }
}
@media (max-width: 640px) {
    .todo-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: .45rem; }
    .todo-item { padding: .55rem .6rem; gap: .5rem; align-items: flex-start; }
    .todo-item .todo-sayi { font-size: 1.15rem; min-width: 1.6ch; }
    .todo-item .todo-metin { font-size: .8rem; }
    .todo-item .todo-metin small { font-size: .7rem; }
    .quick-actions { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .4rem; padding-bottom: .2rem; }
    .quick-actions .btn { white-space: nowrap; }
    .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: .5rem; }
    .app-tile { padding: .7rem .4rem; }
    .app-tile .app-desc { display: none; }
    .app-tile .app-title { font-size: .8rem; }
    .app-tile .app-status { font-size: .66rem; }
    .app-icon svg { width: 22px; height: 22px; }
}
@media (max-width: 900px) {
    /* Toplu işlem çubuğu alttaki hızlı erişim çubuğunun üstünde dursun */
    .tp-cubuk { bottom: calc(4.2rem + env(safe-area-inset-bottom)); width: calc(100vw - 1.2rem); max-width: 520px; justify-content: center; }
}

/* v6.5: projeden sahaya / müşteriye gönderim */
.sevk-satir { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem .8rem; margin: .8rem 0; }
.sevk-satir legend { font-weight: 600; padding: 0 .3rem; font-size: .9rem; }
.sevk-foto { display: flex; flex-wrap: wrap; gap: 4px; }
.sevk-foto img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.vergi-tahmin tr.satir-vurgu td { background: #faf6f5; border-top: 2px solid var(--border); }
.vergi-tahmin td:first-child { min-width: 230px; }
@media (max-width: 640px) {
    .vergi-tahmin td:first-child { min-width: 130px; position: sticky; left: 0; background: var(--card, #fff); z-index: 1; font-size: .85rem; }
    .vergi-tahmin th:first-child { position: sticky; left: 0; background: var(--card, #fff); z-index: 1; }
}
