/* ==========================================================
   Osmanlı Dekor Teklif — arayüz
   Sade, açık tema; sıcak gri yüzeyler, altın vurgu.
   ========================================================== */
:root {
  --ink: #1c1814;            /* ana metin, koyu butonlar */
  --ink-2: #3a332b;
  --navy: var(--ink);        /* eski sınıf adlarıyla uyum */
  --navy-2: var(--ink-2);
  --accent: #a8844f;         /* altın (beyaz metinle 4.5:1 için koyulaştırıldı) */
  --accent-2: #8c6c3b;
  --accent-soft: #f5eee2;
  --bg: #f7f6f3;
  --surface: #ffffff;
  --line: #ebe7e0;
  --line-2: #ddd7cd;
  --muted: #6f675c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 24, 20, .04), 0 1px 1px rgba(28, 24, 20, .02);
  --shadow-lg: 0 12px 32px -12px rgba(28, 24, 20, .18);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --bs-body-font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-primary: #1c1814;
  --bs-primary-rgb: 28, 24, 20;
  --bs-link-color: #7a5d31;
  --bs-link-color-rgb: 122, 93, 49;
  --bs-link-hover-color: #5e4724;
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-focus-ring-color: rgba(168, 132, 79, .28);
}

body { background: var(--bg); font-size: .9375rem; letter-spacing: -.003em; -webkit-font-smoothing: antialiased; }
::selection { background: #ead9bb; }
a, button, .btn, [role="button"], label[for], .form-check-input { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Yerleşim ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--line);
  color: var(--ink-2); display: flex; flex-direction: column;
}
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; } }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; }
.brand-link { text-decoration: none; display: block; }
.brand-logo { max-width: 46px; max-height: 42px; border-radius: 8px; object-fit: contain; }
.brand-logo-beyaz, .brand-logo-koyu { width: 168px; max-width: 100%; display: block; }
.brand-sub { font-size: .72rem; color: var(--muted); }
.brand-link .brand-sub { margin-top: 6px; font-weight: 500; }

.sidebar-nav { padding: 8px 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-nav a, .sidebar-foot a {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .9rem;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.sidebar-nav a i, .sidebar-foot a i { font-size: 1.1rem; color: #8b8378; transition: color .2s; }
.sidebar-nav a:hover, .sidebar-foot a:hover { background: #f4f1ec; color: var(--ink); }
.sidebar-nav a.active { background: var(--accent-soft); color: #5e4724; }
.sidebar-nav a.active i { color: var(--accent-2); }
.sidebar-nav a.nav-yeni { margin: 4px 0 12px; background: var(--ink); color: #fff; justify-content: center; }
.sidebar-nav a.nav-yeni i { color: #fff; }
.sidebar-nav a.nav-yeni:hover { background: var(--ink-2); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar .btn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; }
.content { padding: 32px 36px 56px; max-width: 1440px; }
@media (max-width: 991.98px) { .content { padding: 20px 16px 40px; } }

.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.page-head h1 { font-size: 1.6rem; font-weight: 800; margin: 0; color: var(--ink); letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Bileşenler ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header {
  background: transparent; border-bottom: 1px solid var(--line); font-weight: 700; font-size: .95rem;
  padding: 16px 20px; border-radius: var(--radius) var(--radius) 0 0 !important; color: var(--ink);
}
.card-body { padding: 20px; }
.card-footer { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius) !important; }

.btn { font-weight: 600; border-radius: 10px; padding: .55rem 1rem; transition: background .2s var(--ease), border-color .2s var(--ease), color .2s, box-shadow .2s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 8px; padding: .35rem .7rem; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover, .btn-accent:focus { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-primary { background: var(--ink); border-color: var(--ink); }
.btn-primary:hover, .btn-primary:focus { background: var(--ink-2); border-color: var(--ink-2); }
.btn-outline-primary { color: var(--ink); border-color: var(--line-2); background: #fff; }
.btn-outline-primary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-outline-secondary, .btn-light { background: #fff; border-color: var(--line-2); color: var(--ink-2); }
.btn-outline-secondary:hover, .btn-light:hover { background: #f4f1ec; border-color: var(--line-2); color: var(--ink); }
.btn-check:checked + .btn-outline-secondary { background: var(--ink); border-color: var(--ink); color: #fff; }

.form-label { font-weight: 600; font-size: .82rem; color: var(--ink-2); margin-bottom: 6px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--line-2); min-height: 42px; transition: border-color .2s, box-shadow .2s; }
.form-control:hover, .form-select:hover { border-color: #c9c1b5; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .22rem rgba(168,132,79,.18); }
.form-control::placeholder { color: #a39b90; }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(168,132,79,.2); border-color: var(--accent); }
.form-text { color: var(--muted); }
.input-group-text { background: #f6f3ee; border-color: var(--line-2); color: var(--muted); }

.stat { display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--ink); line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bg-soft-blue { background: #f1ede6; color: var(--ink-2); }
.bg-soft-gold { background: var(--accent-soft); color: var(--accent-2); }
.bg-soft-green { background: #e6f3ea; color: #1d7a45; }
.bg-soft-red { background: #fbeaea; color: #b4332a; }

.table { --bs-table-hover-bg: #faf8f5; --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th {
  font-size: .78rem; color: var(--muted); font-weight: 600; background: #faf9f6;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td, .table th { padding: .8rem 1rem; vertical-align: middle; border-color: var(--line); }
.table td { font-variant-numeric: tabular-nums; }
.table a.row-link { color: inherit; text-decoration: none; font-weight: 700; }
.table a.row-link:hover { color: var(--accent-2); }
.durum-rozet { font-weight: 600; font-size: .75rem; padding: .4em .7em; }
.badge.text-bg-secondary { background: #efebe5 !important; color: var(--ink-2) !important; }
.badge.text-bg-primary { background: #e9eef8 !important; color: #2c4a86 !important; }
.badge.text-bg-success { background: #e4f3e9 !important; color: #1d7a45 !important; }
.badge.text-bg-danger { background: #fbe8e7 !important; color: #b4332a !important; }
.empty { text-align: center; color: var(--muted); padding: 56px 16px; }
.empty i { font-size: 2.2rem; display: block; margin-bottom: 10px; color: #c2b9ac; }

.alert { border-radius: var(--radius); border-width: 1px; }
.pagination { --bs-pagination-border-radius: 8px; --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink); --bs-pagination-color: var(--ink-2); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--ink); }
.modal-content { border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--line); }
.dropdown-menu { border-color: var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .form-control, .toolbar .form-select { width: auto; min-width: 180px; }
@media (max-width: 575.98px) { .toolbar .form-control, .toolbar .form-select { min-width: 0; flex: 1 1 100%; } }

/* ---------- Teklif formu ---------- */
.kalem-tablo { min-width: 980px; }
.kalem-tablo td:nth-child(2) { min-width: 300px; }
.kalem-tablo td { padding: .5rem .4rem; vertical-align: top; }
.kalem-tablo .form-control, .kalem-tablo .form-select { font-size: .875rem; padding: .4rem .55rem; min-height: 38px; border-radius: 8px; }
.kalem-tablo .handle { cursor: grab; color: #b3aa9d; padding-top: .8rem; text-align: center; width: 28px; }
.kalem-tablo .js-tutar { font-weight: 700; padding-top: .8rem; white-space: nowrap; }
.kalem-tablo .aciklama { color: var(--muted); font-size: .8rem !important; }
.sortable-ghost { background: var(--accent-soft); }
.toplam-kutu .satir { display: flex; justify-content: space-between; padding: 7px 0; font-variant-numeric: tabular-nums; }
.toplam-kutu .satir span:first-child { color: var(--muted); }
.toplam-kutu .genel { border-top: 1px solid var(--line-2); margin-top: 8px; padding-top: 12px; font-size: 1.3rem; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(247,246,243,.92); backdrop-filter: blur(8px); padding: 12px 0; border-top: 1px solid var(--line); z-index: 10; }

.ts-wrapper.form-select .ts-control, .ts-wrapper .ts-control { border-radius: 10px; border-color: var(--line-2); min-height: 42px; }
.ts-dropdown { border-radius: 12px; border-color: var(--line); box-shadow: var(--shadow-lg); }
.ts-dropdown .optgroup-header { font-weight: 700; color: var(--accent-2); font-size: .75rem; }
.ts-dropdown .malz-opt { display: flex; justify-content: space-between; gap: 12px; }
.ts-dropdown .malz-opt small { color: var(--muted); white-space: nowrap; }
.ts-dropdown .active { background: var(--accent-soft); color: var(--ink); }

/* ---------- Giriş ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.login-side {
  position: relative; overflow: hidden;
  background: var(--ink);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-side::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(800px 400px at 110% 0%, rgba(168,132,79,.35), transparent 60%),
              repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 64px);
  pointer-events: none;
}
.login-side > * { position: relative; }
.login-side h2 { font-weight: 800; font-size: 2.4rem; line-height: 1.15; letter-spacing: -.02em; }
.login-side .accent { color: #d6b98a; }
.login-side ul { list-style: none; padding: 0; margin: 32px 0 0; color: #ddd3c5; }
.login-side li { margin-bottom: 12px; display: flex; gap: 10px; }
.login-side li i { color: #d6b98a; }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: #fff; }
.login-box { width: 100%; max-width: 380px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-side { display: none; } }

/* ---------- Hesaplama sekmeleri ---------- */
.hesap-sekme { background: #efebe5; padding: 4px; border-radius: 12px; display: inline-flex; flex-wrap: wrap; }
.hesap-sekme .nav-link { color: var(--ink-2); background: transparent; border: 0; font-weight: 600; border-radius: 9px; min-height: 40px; padding: 0 16px; display: flex; align-items: center; transition: background .2s, color .2s, box-shadow .2s; }
.hesap-sekme .nav-link:hover { color: var(--ink); }
.hesap-sekme .nav-link.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(28,24,20,.12); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
.toplam-kutu .satir span:last-child { white-space: nowrap; }
.toplam-kutu .genel { gap: 12px; align-items: baseline; }
