/* ===================================================================
   TEKELPRO - Yönetim paneli tasarım sistemi
   =================================================================== */
:root {
  --tp-sidebar-w: 256px;
  --tp-font: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, sans-serif;
  --tp-bg: #f3f5f9; --tp-panel: #ffffff; --tp-border: #e5e9f0; --tp-text: #0f172a; --tp-muted: #64748b;
  --tp-accent: #2563eb; --tp-accent-soft: rgba(37,99,235,.10);
  --tp-shadow: 0 1px 2px rgba(15,23,42,.05), 0 1px 8px rgba(15,23,42,.05);
  --tp-side-bg: #0f172a; --tp-side-fg: #cbd5e1; --tp-side-hover: rgba(255,255,255,.06); --tp-side-active: rgba(59,130,246,.18);
  --bs-body-font-family: var(--tp-font);
}
[data-bs-theme="dark"] {
  --tp-bg: #0b1220; --tp-panel: #111a2e; --tp-border: #223049; --tp-text: #e8edf5; --tp-muted: #8fa0ba;
  --tp-accent: #3b82f6; --tp-accent-soft: rgba(59,130,246,.18);
  --tp-shadow: 0 1px 2px rgba(0,0,0,.35);
  --tp-side-bg: #0a1020;
  --bs-body-bg: var(--tp-bg); --bs-body-color: var(--tp-text); --bs-border-color: var(--tp-border);
}
html, body { height: 100%; }
body { font-family: var(--tp-font); font-size: 14.5px; background: var(--tp-bg); color: var(--tp-text); }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Kenar çubuğu ---------- */
.tp-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--tp-sidebar-w); background: var(--tp-side-bg); color: var(--tp-side-fg); overflow-y: auto; z-index: 1030; display: flex; flex-direction: column; scrollbar-width: thin; }
.tp-sidebar .brand { padding: 16px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.07); color: #fff; }
.tp-sidebar .brand:hover { text-decoration: none; }
.tp-sidebar .brand .logo { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); display: flex; align-items: center; justify-content: center; flex: 0 0 38px; overflow: hidden; }
.tp-sidebar .brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.tp-sidebar .brand .logo svg { width: 20px; height: 20px; color: #fff; }
.tp-sidebar .brand .name { font-weight: 800; font-size: 1rem; line-height: 1.15; }
.tp-sidebar .brand small { display: block; font-size: .7rem; color: #64748b; font-weight: 500; letter-spacing: .5px; text-transform: uppercase; }
.tp-sidebar .nav-section { font-size: .66rem; text-transform: uppercase; letter-spacing: 1.4px; color: #475569; padding: 16px 20px 6px; font-weight: 700; }
.tp-sidebar a.nav-link { color: var(--tp-side-fg); margin: 1px 10px; padding: 8px 10px 8px 12px; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 500; }
.tp-sidebar a.nav-link:hover { background: var(--tp-side-hover); color: #fff; text-decoration: none; }
.tp-sidebar a.nav-link.active { background: var(--tp-side-active); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #3b82f6; }
.tp-sidebar a.nav-link svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.tp-sidebar a.nav-link .badge { margin-left: auto; font-size: .66rem; }
.tp-sidebar .sidebar-footer { margin-top: auto; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); }
.tp-sidebar .user-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); }
.tp-sidebar .avatar { width: 34px; height: 34px; border-radius: 50%; background: #1e293b; color: #93c5fd; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: 0 0 34px; }
.tp-sidebar .user-card .who { flex: 1; min-width: 0; line-height: 1.15; }
.tp-sidebar .user-card .who b { display: block; color: #fff; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-sidebar .user-card .who small { color: #64748b; font-size: .72rem; }
.tp-sidebar .user-card a { color: #94a3b8; }
.tp-sidebar .user-card a:hover { color: #fca5a5; }

/* ---------- Ana alan ---------- */
.tp-main { margin-left: var(--tp-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
.tp-topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--tp-panel); border-bottom: 1px solid var(--tp-border); position: sticky; top: 0; z-index: 1020; }
.tp-topbar .crumbs { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--tp-muted); white-space: nowrap; overflow: hidden; }
.tp-topbar .crumbs b { color: var(--tp-text); font-weight: 600; }
.tp-topbar .crumbs svg { width: 14px; height: 14px; opacity: .5; }
.tp-topbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tp-topbar .btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--tp-border); background: var(--tp-panel); color: var(--tp-muted); position: relative; }
.tp-topbar .btn-icon:hover { color: var(--tp-accent); border-color: var(--tp-accent); text-decoration: none; }
.tp-topbar .btn-icon svg { width: 18px; height: 18px; }
.tp-topbar .btn-icon .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; border: 2px solid var(--tp-panel); }
.tp-topbar .btn-pos { height: 38px; border-radius: 10px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; background: linear-gradient(135deg, #22c55e, #15803d); border: 0; color: #fff; box-shadow: 0 2px 6px rgba(34,197,94,.35); }
.tp-topbar .btn-pos:hover { filter: brightness(1.07); color: #fff; text-decoration: none; }
.tp-topbar .btn-pos svg { width: 16px; height: 16px; }
.tp-topbar .clock { font-size: .8rem; color: var(--tp-muted); font-variant-numeric: tabular-nums; }
.tp-content { padding: 24px; flex: 1; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.45rem; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.page-head p { margin: 2px 0 0; color: var(--tp-muted); font-size: .9rem; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .actions .btn svg { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
@media (max-width: 991.98px) {
  .tp-sidebar { transform: translateX(-100%); transition: transform .2s; }
  .tp-sidebar.show { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.45); }
  .tp-main { margin-left: 0; }
  .tp-topbar { padding: 0 12px; }
  .tp-content { padding: 14px; }
}

/* ---------- Kartlar ---------- */
.card { border: 1px solid var(--tp-border); border-radius: 14px; box-shadow: var(--tp-shadow); background: var(--tp-panel); }
.card-header { background: transparent; border-bottom: 1px solid var(--tp-border); font-weight: 700; font-size: .92rem; padding: 12px 18px; }
.card-footer { background: transparent; border-top: 1px solid var(--tp-border); }
.card-body { padding: 18px; }
.stat-card { border: 1px solid var(--tp-border); border-radius: 14px; padding: 16px 18px; background: var(--tp-panel); height: 100%; box-shadow: var(--tp-shadow); display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; }
.stat-card .ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 42px; background: var(--tp-accent-soft); color: var(--tp-accent); }
.stat-card .ico svg { width: 20px; height: 20px; }
.stat-card .body { min-width: 0; flex: 1; }
.stat-card .label { font-size: .74rem; color: var(--tp-muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.stat-card .value { font-size: 1.35rem; font-weight: 800; line-height: 1.15; margin-top: 4px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; word-break: break-word; }
.stat-card .sub { font-size: .78rem; color: var(--tp-muted); margin-top: 4px; }
.stat-card.c-primary .ico { background: rgba(37,99,235,.12); color: #2563eb; }
.stat-card.c-success .ico { background: rgba(34,197,94,.14); color: #16a34a; }
.stat-card.c-warning .ico { background: rgba(245,158,11,.16); color: #d97706; }
.stat-card.c-danger .ico { background: rgba(239,68,68,.14); color: #dc2626; }
.stat-card.c-purple .ico { background: rgba(139,92,246,.14); color: #7c3aed; }
.stat-card.c-info .ico { background: rgba(6,182,212,.14); color: #0891b2; }
.stat-card.accent-primary, .stat-card.accent-success, .stat-card.accent-warning, .stat-card.accent-danger, .stat-card.accent-info, .stat-card.accent-purple { display: block; }

/* ---------- Tablolar ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .6rem .85rem; border-bottom-color: var(--tp-border); }
.table-sm > :not(caption) > * > * { padding: .45rem .7rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .7px; color: var(--tp-muted); font-weight: 700; white-space: nowrap; background: color-mix(in srgb, var(--tp-panel) 94%, var(--tp-text)); border-bottom: 1px solid var(--tp-border); }
.table-hover > tbody > tr:hover > * { background: var(--tp-accent-soft); }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tfoot { font-weight: 700; }
.table-responsive { border-radius: 0 0 14px 14px; }
.text-money { font-variant-numeric: tabular-nums; }

/* ---------- Rozetler / düğmeler / formlar ---------- */
.badge { font-weight: 600; letter-spacing: .2px; padding: .35em .6em; border-radius: 6px; }
.badge-soft-success { background: rgba(34,197,94,.14); color: #15803d; }
.badge-soft-danger { background: rgba(239,68,68,.14); color: #b91c1c; }
.badge-soft-warning { background: rgba(245,158,11,.18); color: #b45309; }
.badge-soft-info { background: rgba(6,182,212,.16); color: #0e7490; }
.badge-soft-secondary { background: rgba(100,116,139,.16); color: #475569; }
[data-bs-theme="dark"] .badge-soft-success { color: #86efac; } [data-bs-theme="dark"] .badge-soft-danger { color: #fca5a5; } [data-bs-theme="dark"] .badge-soft-warning { color: #fcd34d; } [data-bs-theme="dark"] .badge-soft-info { color: #67e8f9; } [data-bs-theme="dark"] .badge-soft-secondary { color: #cbd5e1; }
.btn { border-radius: 9px; font-weight: 600; }
.btn-sm { border-radius: 7px; }
.btn svg { width: 16px; height: 16px; vertical-align: -3px; }
.btn-sm svg { width: 14px; height: 14px; vertical-align: -2px; }
.btn-primary { --bs-btn-bg: #2563eb; --bs-btn-border-color: #2563eb; --bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8; }
.form-control, .form-select { border-radius: 9px; border-color: var(--tp-border); background: var(--tp-panel); color: var(--tp-text); }
.form-control:focus, .form-select:focus { border-color: var(--tp-accent); box-shadow: 0 0 0 4px var(--tp-accent-soft); }
.form-label { font-weight: 600; font-size: .85rem; color: var(--tp-muted); margin-bottom: .3rem; }
.input-group-text { background: var(--tp-panel); border-color: var(--tp-border); color: var(--tp-muted); border-radius: 9px; }
.input-group-text svg { width: 18px; height: 18px; }
.form-text { color: var(--tp-muted); }
.alert { border-radius: 12px; }
.list-group-item { background: var(--tp-panel); color: var(--tp-text); border-color: var(--tp-border); }
.modal-content { border-radius: 14px; background: var(--tp-panel); color: var(--tp-text); border-color: var(--tp-border); }
.modal-header, .modal-footer { border-color: var(--tp-border); }
.dropdown-menu { border-radius: 12px; border-color: var(--tp-border); box-shadow: 0 10px 30px rgba(15,23,42,.15); background: var(--tp-panel); }
.dropdown-item { color: var(--tp-text); }
.dropdown-item:hover { background: var(--tp-accent-soft); }
.sticky-actions { position: sticky; bottom: 0; background: var(--tp-panel); padding: 10px 14px; border-top: 1px solid var(--tp-border); border-radius: 0 0 14px 14px; }
.cursor-pointer { cursor: pointer; }
.w-120 { width: 120px; } .w-90 { width: 90px; }
.date-filter .btn { white-space: nowrap; }
.date-filter .btn-check:checked + .btn { background: var(--tp-accent); border-color: var(--tp-accent); color: #fff; }
kbd { background: var(--tp-accent-soft); color: var(--tp-text); border: 1px solid var(--tp-border); border-radius: 4px; padding: 0 5px; font-size: .78em; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.quick-actions a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--tp-border); border-radius: 12px; background: var(--tp-panel); color: var(--tp-text); font-weight: 600; font-size: .88rem; box-shadow: var(--tp-shadow); }
.quick-actions a:hover { border-color: var(--tp-accent); color: var(--tp-accent); text-decoration: none; }
.quick-actions a svg { width: 18px; height: 18px; color: var(--tp-accent); flex: 0 0 18px; }
.chart-box { position: relative; height: 260px; }

/* ---------- Giriş ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% 0%, #1e3a8a 0%, #0f172a 60%); padding: 16px; }
.login-card { width: 100%; max-width: 400px; border-radius: 18px; padding: 34px; background: var(--tp-panel); box-shadow: 0 24px 70px rgba(0,0,0,.45); }

/* ---------- Fiş ---------- */
.receipt { width: 72mm; margin: 0 auto; font-family: "Courier New", monospace; font-size: 12px; color: #000; background: #fff; padding: 4mm; }
.receipt h2 { font-size: 15px; text-align: center; margin: 0 0 4px; }
.receipt .center { text-align: center; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1px 0; vertical-align: top; }
.receipt .r { text-align: right; white-space: nowrap; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
@media print { body { background: #fff; } .no-print { display: none !important; } .receipt { width: 72mm; } @page { margin: 2mm; } }

/* ---------- Yazdırılabilir rapor ---------- */
.print-page { max-width: 1100px; margin: 0 auto; padding: 20px; background: #fff; color: #000; }
.print-page table { font-size: 13px; }

/* ---------- Kategori kârlılık kartları ---------- */
.cat-tile { --c: #64748b; background: var(--tp-panel); border: 1px solid var(--tp-border); border-top: 5px solid var(--c); border-radius: 14px; padding: 14px 16px 12px; box-shadow: var(--tp-shadow); height: 100%; }
.cat-tile.empty { opacity: .55; }
.cat-tile .cat-name { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cat-tile .cat-qty { font-size: .72rem; font-weight: 600; color: var(--tp-muted); background: var(--tp-accent-soft); padding: 2px 8px; border-radius: 999px; }
.cat-tile .cat-row { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; color: var(--tp-muted); }
.cat-tile .cat-row b { font-size: 1.25rem; color: var(--tp-text); font-variant-numeric: tabular-nums; }
.cat-tile .cat-row.profit b { color: #16a34a; }
.cat-tile .cat-row.profit b.neg { color: #dc2626; }
.cat-tile .cat-bar { height: 6px; border-radius: 3px; background: var(--tp-accent-soft); margin: 10px 0 6px; overflow: hidden; }
.cat-tile .cat-bar > div { height: 100%; background: var(--c); border-radius: 3px; }
.cat-tile .cat-foot { display: flex; justify-content: space-between; font-size: .72rem; color: var(--tp-muted); font-weight: 600; }
