:root {
  --sidebar-w: 248px;
  --sidebar-bg: #0f172a;
  --sidebar-fg: #94a3b8;
  --sidebar-active: #6366f1;
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
}
[data-bs-theme="dark"] {
  --bs-body-bg: #0b1120;
  --bs-tertiary-bg: #111827;
  --bs-link-color: #818cf8;
  --bs-link-color-rgb: 129, 140, 248;
}
body { background: var(--bs-tertiary-bg); font-size: .925rem; }
.btn-primary { --bs-btn-bg: #4f46e5; --bs-btn-border-color: #4f46e5; --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca; --bs-btn-active-bg: #3730a3; }
.btn-outline-primary { --bs-btn-color: #4f46e5; --bs-btn-border-color: #4f46e5; --bs-btn-hover-bg: #4f46e5; --bs-btn-hover-border-color: #4f46e5; }
.text-bg-primary { background-color: #4f46e5 !important; }
.page-item.active .page-link { background: #4f46e5; border-color: #4f46e5; }

/* Kenar çubuğu */
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg) !important; color: var(--sidebar-fg); display: flex; flex-direction: column; }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
}
.sidebar-brand { padding: 1.1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-nav { padding: .5rem .75rem; overflow-y: auto; flex: 1; }
.sidebar-nav .nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 1rem .75rem .35rem; }
.sidebar-nav .nav-link { color: var(--sidebar-fg); border-radius: .5rem; padding: .45rem .75rem; display: flex; align-items: center; gap: .65rem; margin-bottom: 2px; }
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #fff; }
.sidebar-foot { padding: .75rem 1.25rem; color: #475569; border-top: 1px solid rgba(255,255,255,.06); }

.topbar { height: 56px; background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color); position: sticky; top: 0; z-index: 1020; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: #4f46e5; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; }
.main { min-width: 0; }

.card { border: 1px solid var(--bs-border-color); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.table > :not(caption) > * > * { padding: .55rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); font-weight: 600; white-space: nowrap; }

/* Gösterge kartları */
.kpi { border-radius: .75rem; }
.kpi .kpi-icon { width: 44px; height: 44px; border-radius: .65rem; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.kpi .kpi-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.kpi .kpi-label { font-size: .78rem; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .04em; }
.bg-soft-primary { background: rgba(79,70,229,.12); color: #4f46e5; }
.bg-soft-success { background: rgba(22,163,74,.12); color: #16a34a; }
.bg-soft-danger { background: rgba(220,38,38,.12); color: #dc2626; }
.bg-soft-warning { background: rgba(217,119,6,.14); color: #d97706; }
.bg-soft-info { background: rgba(8,145,178,.12); color: #0891b2; }

/* Belge satır düzenleyici */
.doc-items td { vertical-align: middle; }
.doc-items input, .doc-items select { min-width: 70px; }
.doc-items .col-desc { min-width: 220px; }
.doc-totals td { padding: .3rem .75rem; }

/* Kanban (potansiyeller) */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 1rem; overflow-x: auto; }
.kanban-col { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .75rem; padding: .75rem; min-height: 200px; }
.kanban-card { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .6rem .7rem; margin-bottom: .5rem; background: var(--bs-tertiary-bg); }

.login-page { background: linear-gradient(135deg, #0f172a 0%, #312e81 100%); }
.login-logo { width: 56px; height: 56px; border-radius: 14px; background: #4f46e5; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; }

@media print {
  .sidebar, .topbar, footer, .no-print { display: none !important; }
  body { background: #fff; }
  .content { padding: 0 !important; }
}

h1 .badge, .h4 .badge { font-size: .55em; vertical-align: middle; }
