/* =====================================================================
   DunyaOne - Yeni arayuz temasi (v2)
   styles.css'ten sonra yuklenir ve onu gecersiz kilar.
   Acik, sade, kurumsal bir on muhasebe gorunumu.
   ===================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e6e8ec;
  --border-soft: #eff1f4;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff4ff;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --sidebar-bg: #ffffff;
  --sidebar-text: #1f2937;
  --sidebar-w: 248px;
  --sidebar-mini: 68px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
}

html, body {
  font-family: Inter, 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

svg.i { display: inline-block; vertical-align: middle; flex: 0 0 auto; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--border);
  overflow: visible;
  transition: width .2s ease, transform .25s ease;
}
.sidebar-brand {
  min-height: 64px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft);
  color: var(--text); font-size: 18px; gap: 10px;
}
.sidebar-brand-logo { width: 32px; height: 32px; }
.sidebar-brand .brand-name { font-size: 18px; font-weight: 750; letter-spacing: -.01em; color: var(--text); }

.sidebar-collapse {
  position: absolute; top: 76px; right: -12px; width: 24px; height: 24px; z-index: 5;
  border-radius: 7px; border: 1px solid var(--border); background: #fff; color: var(--muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow);
}
.sidebar-collapse:hover { color: var(--text); border-color: #cfd4dc; }

.sidebar-nav { flex: 1; padding: 8px 10px 16px; overflow-y: auto; overflow-x: hidden; }
.nav-group-title {
  padding: 16px 10px 6px; font-size: 10.5px; letter-spacing: .06em; color: #9aa1ad; font-weight: 600;
}
.nav-item {
  position: relative; gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: 8px;
  border-left: 0; color: var(--sidebar-text); font-size: 13.5px; font-weight: 500;
}
.nav-item .ico { width: 20px; display: inline-flex; justify-content: center; color: #4b5563; }
.nav-item .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: #f3f4f6; color: var(--text); }
.nav-item.active { background: #f1f3f6; color: var(--text); font-weight: 650; border-left: 0; }
.nav-item.active .ico { color: var(--text); }
.nav-badge { margin-left: 0; font-size: 10.5px; padding: 0 7px; line-height: 18px; }

.nav-add {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border: 0; background: transparent; color: #6b7280; border-radius: 6px; cursor: pointer; flex: 0 0 auto;
}
.nav-add:hover { background: #e5e7eb; color: var(--text); }
.nav-caret { display: inline-flex; color: #6b7280; }
.nav-parent { cursor: pointer; user-select: none; }

.nav-tree { border-radius: 10px; margin: 1px 0; }
.nav-tree.open { background: #f7f8fa; }
.nav-tree.has-active > .nav-parent { font-weight: 650; }
.nav-children { display: none; padding: 2px 0 8px; }
.nav-tree.open .nav-children { display: block; }
.nav-child {
  display: block; padding: 7px 10px 7px 40px; margin: 1px 4px; border-radius: 7px;
  color: #374151; text-decoration: none; font-size: 13px;
}
.nav-child:hover { background: #eef0f3; color: var(--text); }
.nav-child.active { background: #e9edf3; color: var(--text); font-weight: 650; }

.sidebar-foot { padding: 10px; border-top: 1px solid var(--border-soft); }
.company-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none; color: var(--text); background: #fff;
}
.company-card:hover { border-color: #cfd4dc; }
.company-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #f1f3f6; color: #374151;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: 0 0 auto;
}
.company-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.company-meta strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-meta small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-check {
  width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}

/* Daraltilmis menu */
@media (min-width: 901px) {
  body.nav-mini .sidebar { width: var(--sidebar-mini); }
  body.nav-mini .main-area { margin-left: var(--sidebar-mini); }
  body.nav-mini .sidebar .lbl,
  body.nav-mini .sidebar .brand-name,
  body.nav-mini .sidebar .nav-add,
  body.nav-mini .sidebar .nav-caret,
  body.nav-mini .sidebar .nav-badge,
  body.nav-mini .sidebar .nav-children,
  body.nav-mini .sidebar .company-meta,
  body.nav-mini .sidebar .company-check { display: none !important; }
  body.nav-mini .nav-group-title { font-size: 0; padding: 10px 0 4px; border-top: 1px solid var(--border-soft); margin-top: 6px; }
  body.nav-mini .nav-group-title:first-child { border-top: 0; }
  body.nav-mini .nav-item { justify-content: center; padding: 9px 0; }
  body.nav-mini .nav-tree.open { background: transparent; }
  body.nav-mini .sidebar-brand { justify-content: center; padding: 14px 0; }
  body.nav-mini .company-card { justify-content: center; padding: 8px 0; border: 0; }
}
.main-area { transition: margin-left .2s ease; }

/* ---------------- Topbar ---------------- */
.topbar { height: 60px; padding: 0 22px; border-bottom: 1px solid var(--border-soft); gap: 8px; }
.topbar-title { font-size: 15.5px; font-weight: 650; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: #4b5563; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:hover { background: #f3f4f6; color: var(--text); }
.icon-badge {
  position: absolute; top: 1px; right: -3px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center;
  border: 2px solid #fff; box-sizing: content-box;
}
.hamburger { color: #374151; }

.account-menu { position: relative; margin-left: 6px; }
.account-btn { padding: 6px 10px 6px 6px; gap: 8px; border-radius: 10px; font-size: 13px; }
.account-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #111827; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.account-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
}
.account-menu.open .account-pop { display: block; }
.account-pop-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; display: flex; flex-direction: column; gap: 3px; }
.account-pop-head small { color: var(--muted); font-size: 12px; }
.account-pop-head .badge { align-self: flex-start; margin-top: 4px; }
.account-pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-size: 13.5px; background: none; border: 0; cursor: pointer;
  font-family: inherit; text-align: left;
}
.account-pop-item:hover { background: #f3f4f6; color: var(--text); }
.account-pop-item.danger { color: var(--danger); }

.content { padding: 22px 24px 28px; }

/* ---------------- Kartlar ve basliklar ---------------- */
.card { border-color: var(--border-soft); box-shadow: var(--shadow); border-radius: var(--radius); }
.card-head { padding: 14px 20px; border-bottom-color: var(--border-soft); min-height: 56px; }
.card-head h2, .card-head h3 { font-size: 14px; font-weight: 650; text-transform: none; letter-spacing: 0; }
.card-head .page-sub { margin-top: 2px; font-size: 12.5px; }
.card-body { padding: 18px 20px; }
.page-head h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 12.5px; }

/* ---------------- Butonlar ---------------- */
.btn { border-radius: 9px; font-weight: 600; font-size: 13px; padding: 8px 14px; border-color: var(--border); }
.btn:hover { background: #f7f8fa; border-color: #d5d9e0; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 3px; color: var(--primary); font-size: 12.5px;
  font-weight: 600; text-decoration: none; padding: 4px 6px; border-radius: 6px;
}
.link-btn:hover { background: var(--primary-soft); }

/* ---------------- Formlar ---------------- */
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea,
input[type="text"], input[type="search"], input[type="date"], input[type="email"], input[type="password"], select, textarea {
  border-radius: 9px; border-color: var(--border);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

/* ---------------- Tablolar ---------------- */
thead th {
  background: #f8f9fb; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600;
  color: #6b7280; border-bottom: 1px solid var(--border-soft);
}
tbody td { border-bottom-color: #f2f3f5; }
tbody tr:hover { background: #fafbfc; }

/* ---------------- Sekmeler ---------------- */
.tabs { border-bottom-color: var(--border-soft); }
.tab { font-size: 13px; }
.pill-tabs {
  background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; padding: 6px; gap: 4px;
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.pill-tabs .tab { border: 0; border-radius: 8px; padding: 7px 12px; color: var(--text-2); }
.pill-tabs .tab:hover { background: #f3f4f6; }
.pill-tabs .tab.active { background: var(--primary-soft); color: var(--primary); border: 0; }

/* ---------------- Bos durum ---------------- */
.empty-state { padding: 36px 20px; }
.empty-state .icon { opacity: 1; margin-bottom: 12px; }
.empty-ill {
  display: inline-flex; width: 84px; height: 84px; border-radius: 50%; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #eef4ff 0%, #f5f8ff 60%, #fbfcff 100%); color: #93b4f4;
  box-shadow: inset 0 0 0 1px #e3ebfb;
}
.empty-state h3 { font-size: 14px; font-weight: 650; }
.empty-state p { font-size: 12.5px; }

/* ---------------- Yan panel (drawer) ---------------- */
.modal-overlay.drawer-overlay { justify-content: flex-end; align-items: stretch; padding: 0; background: rgba(17, 24, 39, .45); overflow: hidden; }
.modal.drawer {
  max-width: 560px; width: 100%; height: 100vh; max-height: 100vh; border-radius: 0;
  animation: drawerIn .22s ease; box-shadow: -12px 0 32px rgba(16, 24, 40, .14);
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: .4; } }
.modal.drawer .modal-head { flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px 24px 14px; border-bottom: 0; position: relative; }
.modal.drawer .modal-head .spacer { display: none; }
.modal.drawer .modal-close { position: absolute; top: 18px; right: 18px; }
.modal-head-ico {
  width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px #dbe6fe;
}
.modal-head-text h2 { font-size: 16px; font-weight: 700; }
.modal-head-text p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal.drawer .modal-body { padding: 8px 24px 0; display: flex; flex-direction: column; }
.modal.drawer .modal-body > form { display: flex; flex-direction: column; flex: 1; }
.modal.drawer .form-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.modal.drawer .form-actions {
  position: sticky; bottom: 0; margin: auto -24px 0; padding: 14px 24px; background: #fff;
  border-top: 1px solid var(--border-soft); display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.modal.drawer .form-actions .btn { width: 100%; padding: 10px 14px; }
.modal.drawer .modal-foot { padding: 14px 24px; }
.modal { border-radius: 14px; }

/* ---------------- KPI ---------------- */
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  border: 1px solid var(--border-soft); border-left: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 14px 16px; position: relative;
}
.kpi.success, .kpi.danger, .kpi.warning { border-left-color: var(--border-soft); }
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-label { font-size: 11.5px; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 600; flex: 1; }
.kpi-ico {
  width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.kpi.success .kpi-ico { background: #ecfdf3; color: var(--success); }
.kpi.danger .kpi-ico { background: #fef2f2; color: var(--danger); }
.kpi.warning .kpi-ico { background: #fffbeb; color: var(--warning); }
.kpi-value { font-size: 20px; font-weight: 700; margin-top: 8px; letter-spacing: -.01em; }
.kpi-sub { font-size: 11.5px; }

/* ---------------- Anasayfa ---------------- */
.dashboard { padding-bottom: 70px; }
.info-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.info-card {
  display: block; background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 12px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
.info-card:hover { border-color: #d5d9e0; }
.info-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.info-card-title { font-size: 13px; font-weight: 650; }
.info-card-ico { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; }
.info-card-ico svg { width: 13px; height: 13px; }
.info-card-body { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.info-card-body strong { color: var(--text); }
.info-card.danger .info-card-ico { background: var(--danger); }
.info-card.warning .info-card-ico { background: var(--warning); }
.info-card.ok .info-card-body svg { color: var(--success); }

.dash-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-grid-2 > .card { margin-bottom: 16px; }
.dash-grid-2.inner { gap: 16px; }

.period-select {
  min-width: 140px; padding: 7px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: 9px; background: #fff;
}

.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 6px 0 4px; }
.ring-svg { width: 210px; height: 210px; }
.legend-grid { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.legend-box {
  border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--text-2);
  display: flex; flex-direction: column; gap: 5px; min-width: 200px; background: #fff;
}
.legend-title { font-size: 12.5px; color: var(--text); }
.legend-row { display: flex; align-items: center; gap: 6px; }
.legend-row strong, .legend-title strong { font-variant-numeric: tabular-nums; }
.legend-row.link { text-decoration: none; color: var(--text-2); padding: 3px 2px; border-radius: 6px; }
.legend-row.link:hover { background: #f7f8fa; }
.legend-row .grow { flex: 1; min-width: 0; }
.legend-row small { color: var(--muted); font-size: 11px; margin-left: 4px; }
.legend-list { width: 100%; max-width: 420px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

.sub-panel { border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; }
.sub-panel-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13px; font-weight: 650;
  background: #f8f9fb; border-bottom: 1px solid var(--border-soft);
}
.sub-panel-head .spacer { flex: 1; }

.pending-list { display: flex; flex-direction: column; }
.pending-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #f2f3f5; cursor: pointer;
}
.pending-item:last-child { border-bottom: 0; }
.pending-item:hover { background: #fafbfc; }
.pending-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pending-main strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-amount { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 90px; text-align: right; }
.lvl-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; flex: 0 0 auto; }
.lvl-danger .lvl-dot { background: var(--danger); }
.lvl-warning .lvl-dot { background: var(--warning); }

.quick-bar {
  position: fixed; bottom: 18px; left: calc(50% + var(--sidebar-w) / 2); transform: translateX(-50%); z-index: 30;
  display: flex; background: #fff; border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-lg);
  padding: 4px; max-width: calc(100vw - var(--sidebar-w) - 32px); overflow-x: auto;
}
body.nav-mini .quick-bar { left: calc(50% + var(--sidebar-mini) / 2); max-width: calc(100vw - var(--sidebar-mini) - 32px); }
.quick-btn {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 8px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; border-radius: 999px; white-space: nowrap;
  font-family: inherit;
}
.quick-btn + .quick-btn { border-left: 1px solid var(--border-soft); border-radius: 0; }
.quick-btn:hover { color: var(--primary); }

/* ---------------- Ayarlar ---------------- */
.info-rows { display: flex; flex-direction: column; }
.info-row { display: grid; grid-template-columns: minmax(160px, 30%) 1fr; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-key { font-weight: 600; color: var(--text-2); }
.info-val { color: var(--text); word-break: break-word; }
.module-row { gap: 14px; }
.module-ico {
  width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}

/* ---------------- Mobil ---------------- */
@media (max-width: 1100px) {
  .dash-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { width: var(--sidebar-w) !important; box-shadow: var(--shadow-lg); }
  .sidebar-collapse { display: none; }
  .info-strip { grid-template-columns: 1fr; }
  .quick-bar { left: 50%; max-width: calc(100vw - 24px); bottom: 12px; }
  .account-btn .txt { display: none; }
  .content { padding: 14px; }
}
@media (max-width: 560px) {
  .modal.drawer { max-width: 100%; }
  .info-row { grid-template-columns: 1fr; gap: 4px; }
  .legend-box { min-width: 0; width: 100%; }
}
@media print {
  .quick-bar, .sidebar-collapse, .account-menu { display: none !important; }
}

/* =====================================================================
   Satislar / Urunler (liste, editor, belge)
   ===================================================================== */
.list-card { overflow: hidden; }
.list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px 20px 14px; }
.list-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.count-chip { font-size: 12px; font-weight: 600; color: var(--muted); background: #f3f4f6; border-radius: 999px; padding: 3px 10px; }
.list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 14px; border-bottom: 1px solid var(--border-soft); }
.list-card .table-wrap { border: 0; border-radius: 0; }
.seg-tabs { display: inline-flex; gap: 2px; background: #f3f4f6; border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg-tabs button:hover { color: var(--text); }
.seg-tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; background: #fff; color: var(--muted); min-width: 240px; }
.search-box input { border: 0; outline: 0; padding: 8px 0; font: inherit; background: transparent; flex: 1; min-width: 0; color: var(--text); }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.sub-text { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 400; }

.seg-radio { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.seg-radio label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 13px; background: #fff; }
.seg-radio label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.seg-radio input { accent-color: var(--primary); margin: 0; }
.seg-radio.wide { max-width: 420px; margin-bottom: 10px; }

.soft-box { background: #f8f9fb; border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.soft-box-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.soft-box > input, .soft-box > select { width: 100%; max-width: 260px; }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text-2); }
.switch-row { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.switch.sm { width: 36px; height: 20px; }
.switch.sm .slider::before { width: 14px; height: 14px; }
.switch.sm input:checked + .slider::before { transform: translateX(16px); }
input.readonly, .readonly { background: #f3f4f6 !important; color: var(--text-2); }
.opt-box { border: 1px dashed var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.opt-box summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--primary); padding: 2px 0; }
.opt-box[open] summary { margin-bottom: 12px; }
.btn-soft { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn-soft:hover { background: #e2eafe; border-color: transparent; color: var(--primary-dark); }
.btn-soft-danger { background: #fef2f2; color: var(--danger); border-color: transparent; }
.btn-soft-danger:hover { background: #fee2e2; border-color: transparent; }

/* Editor */
.editor-page { padding-bottom: 76px; }
.step-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.step-tabs button { border: 0; background: transparent; padding: 10px 14px; font: inherit; font-weight: 650; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.step-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.editor-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.editor-side { position: sticky; top: 76px; }
.ed-card { padding: 16px 18px; }
.ed-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ed-card-head strong { font-size: 14px; }
.ed-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ed-input { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font: inherit; background: #fff; resize: vertical; }
.ed-input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.ed-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); align-items: start; }
.ed-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.ed-row:first-child { padding-top: 2px; }
.ed-lbl { font-size: 13px; font-weight: 600; color: var(--text-2); padding-top: 9px; }
.ed-val { min-width: 0; }
.ed-val > input, .ed-val > select, .ed-inline select, .soft-box input, .soft-box select, .line-card input, .line-card select {
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font: inherit; background: #fff; color: var(--text); min-width: 0;
}
.ed-val > input, .ed-val > select { width: 100%; max-width: 320px; }
.ed-inline { display: flex; gap: 8px; align-items: center; }
.ed-inline select { flex: 1; max-width: 420px; }
.cust-box { background: #f8f9fb; border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.cust-name { font-weight: 650; color: var(--text); font-size: 13.5px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.chip:hover { border-color: #cfd4dc; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.mini-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.line-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fff; }
.line-name { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; color: var(--muted); margin-bottom: 10px; }
.line-name input { border: 0 !important; padding: 9px 0 !important; flex: 1; font-weight: 600; outline: 0; }
.line-name:focus-within { border-color: var(--primary); }
.line-grid { display: grid; grid-template-columns: .7fr .9fr 1.2fr .7fr .8fr 1fr 1.2fr; gap: 8px; }
.line-grid .field { margin: 0; }
.line-grid .field label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.line-grid input, .line-grid select { width: 100%; }
.line-foot { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.line-foot .ln-desc { flex: 1; }
.ed-lines-foot { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-top: 4px; }
.totals-box { min-width: 280px; background: #f8f9fb; border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 14px; }
.totals-title { font-weight: 650; margin-bottom: 6px; font-size: 13px; }
.tot-row { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 13px; color: var(--text-2); }
.tot-row span:last-child { font-variant-numeric: tabular-nums; }
.tot-row.strong { font-weight: 650; color: var(--text); }
.tot-row.grand { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; font-weight: 750; font-size: 15px; color: var(--text); }
.sticky-actions {
  position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: rgba(255,255,255,.96); border-top: 1px solid var(--border); backdrop-filter: blur(6px);
}
body.nav-mini .sticky-actions { left: var(--sidebar-mini); }
.sticky-total { font-weight: 700; font-size: 14px; margin-right: 8px; font-variant-numeric: tabular-nums; }
#ed-back svg, .back-link svg { transform: rotate(180deg); }
.editor-page ~ .quick-bar, body:has(.editor-page) .quick-bar { display: none; }
.tip-card { padding: 18px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.tip-card strong { display: block; color: var(--text); margin-bottom: 8px; font-size: 14px; }
.tip-card ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.tip-ill { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }

/* Detay */
.detail-page { display: flex; flex-direction: column; gap: 14px; }
.back-link { display: inline-flex; width: 30px; height: 30px; border-radius: 8px; align-items: center; justify-content: center; color: var(--text-2); border: 1px solid var(--border); }
.back-link:hover { background: #f3f4f6; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.kv-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--border-soft); }
.kv { padding: 12px 20px; border-right: 1px solid var(--border-soft); font-size: 13px; }
.kv:last-child { border-right: 0; }
.kv span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }

/* Basili belge */
.doc-paper { max-width: 860px; margin: 0 auto; background: #fff; color: #111827; font-size: 12.5px; line-height: 1.5; padding: 8px 4px; }
.doc-top { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid #111827; }
.doc-company-name { font-size: 18px; font-weight: 750; margin-bottom: 4px; }
.doc-muted { color: #6b7280; font-size: 12px; }
.doc-meta { text-align: right; }
.doc-type { font-size: 16px; font-weight: 750; letter-spacing: .06em; color: var(--primary); margin-bottom: 8px; }
.doc-meta-table { margin-left: auto; border-collapse: collapse; }
.doc-meta-table td { padding: 2px 0 2px 14px; text-align: right; font-size: 12px; }
.doc-meta-table td:first-child { color: #6b7280; }
.doc-customer { padding: 16px 0; }
.doc-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin-bottom: 2px; }
.doc-cust-name { font-size: 15px; font-weight: 700; }
.doc-title { font-weight: 650; font-size: 14px; margin-bottom: 10px; }
.doc-lines { width: 100%; border-collapse: collapse; }
.doc-lines th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; background: #f8f9fb; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; }
.doc-lines td { padding: 9px 10px; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
.doc-lines .num { text-align: right; white-space: nowrap; }
.doc-bottom { display: flex; justify-content: space-between; gap: 24px; margin-top: 18px; align-items: flex-start; }
.doc-notes { flex: 1; font-size: 12px; }
.doc-totals { border-collapse: collapse; min-width: 280px; }
.doc-totals td { padding: 5px 0; }
.doc-totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; padding-left: 24px; }
.doc-totals tr.grand td { border-top: 2px solid #111827; font-weight: 750; font-size: 14.5px; padding-top: 8px; }

@media (max-width: 1100px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .line-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .sticky-actions { left: 0; padding: 10px 14px; flex-wrap: wrap; }
  .sticky-total { width: 100%; margin: 0; }
}
@media (max-width: 640px) {
  .ed-row { grid-template-columns: 1fr; gap: 6px; }
  .ed-lbl { padding-top: 0; }
  .line-grid { grid-template-columns: repeat(2, 1fr); }
  .search-box { min-width: 0; width: 100%; }
  .totals-box { min-width: 0; width: 100%; }
  .doc-top, .doc-bottom { flex-direction: column; }
  .doc-meta { text-align: left; }
  .doc-meta-table { margin-left: 0; }
  #sd-csv, #prd-csv { display: none; }
}
@media print {
  body.printing-doc * { visibility: hidden; }
  body.printing-doc .doc-paper, body.printing-doc .doc-paper * { visibility: visible; }
  body.printing-doc .doc-paper { position: absolute; left: 0; top: 0; width: 100%; max-width: none; padding: 0; }
  body.printing-doc .sidebar, body.printing-doc .topbar { display: none !important; }
}
.list-head .spacer, .list-tools .spacer, .sticky-actions .spacer, .ed-card-head .spacer, .ed-lines-foot .spacer, .soft-box-head .spacer { flex: 1; }
.editor-main > .card, .detail-page > .card { margin: 0; }
.sticky-total { display: inline-flex; gap: 8px; align-items: baseline; }
.sticky-total span { font-weight: 500; color: var(--muted); font-size: 12.5px; }
a.btn, a.btn:hover { text-decoration: none; }
#product-form .form-grid + .soft-box { margin-top: 14px; }

/* =====================================================================
   Ayarlar: mali musavir, destek, moduller, disa aktarma
   ===================================================================== */
#set-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
#set-tabs .tab { white-space: nowrap; }
.card-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border-soft); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.5; margin-top: 10px; max-width: 560px; cursor: pointer; }
.check-row input { margin-top: 3px; accent-color: var(--primary); flex: 0 0 auto; }
.benefit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.benefit { border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.benefit p { margin: 10px 0 0; }
.benefit-ico { width: 30px; height: 30px; border-radius: 8px; background: #dcfce7; color: #15803d; display: inline-flex; align-items: center; justify-content: center; }
.export-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.export-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.export-info { flex: 1; min-width: 0; }
.export-info strong { font-size: 13.5px; }
.mod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: start; }
.mod-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px; background: #fff; }
.mod-card.on { border-color: #bfd3fb; background: #f7faff; }
.mod-head { display: flex; align-items: flex-start; gap: 10px; }
.mod-tag { font-size: 11.5px; font-weight: 650; color: var(--primary); }
.mod-title { font-size: 15px; font-weight: 700; margin-top: 2px; }
.mod-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--primary); border: 1px solid #bfd3fb; background: #fff; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.mod-desc { font-size: 13px; color: var(--text-2); line-height: 1.55; margin: 12px 0; }
.mod-features { list-style: none; margin: 0; padding: 12px 0; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.mod-features li { display: flex; align-items: center; gap: 8px; }
.mod-features svg { color: var(--primary); background: var(--primary-soft); border-radius: 50%; padding: 3px; width: 20px; height: 20px; }
.mod-aud { border-top: 1px solid var(--border-soft); padding-top: 12px; }
.mod-aud summary { cursor: pointer; font-weight: 650; font-size: 13px; }
.mod-aud ul { margin: 10px 0 0; padding: 10px 14px; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--text-2); }
@media (max-width: 900px) {
  .benefit-grid, .export-grid, .mod-grid { grid-template-columns: 1fr; }
}
.mod-head .spacer { flex: 1; }

/* =====================================================================
   Depolar ve stok hareketleri
   ===================================================================== */
.stk-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.stk-action { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--border-soft); background: #fff; border-radius: var(--radius); padding: 16px; cursor: pointer; box-shadow: var(--shadow); font: inherit; color: var(--text); }
.stk-action:hover { border-color: #cfd4dc; box-shadow: 0 4px 14px rgba(16,24,40,.06); }
.stk-act-ico { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.stk-action.in .stk-act-ico { background: #dcfce7; color: #15803d; }
.stk-action.out .stk-act-ico { background: #fee2e2; color: #b91c1c; }
.stk-action.tr .stk-act-ico { background: var(--primary-soft); color: var(--primary); }
.stk-act-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stk-act-txt strong { font-size: 14px; }
.stk-act-txt small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.stk-act-go { color: var(--muted); }
.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 0 20px 20px; }
.wh-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.wh-card.inactive { opacity: .6; }
.wh-top { display: flex; align-items: center; gap: 10px; }
.wh-name { flex: 1; min-width: 0; }
.wh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.wh-stats span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.wh-stats strong { font-size: 15px; }
.tool-select { border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 13px; background: #fff; }
.seg-radio.three { grid-template-columns: repeat(3, 1fr); }
.seg-radio label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.stk-line { display: grid; grid-template-columns: minmax(0, 2fr) 110px 150px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.stk-line select, .stk-line input { width: 100%; }
.stk-line .sl-hint { grid-column: 1 / -1; margin-top: -2px; }
.stk-line .sl-cost.hidden { display: none; }
tr.row-muted td { color: var(--muted); }
tr.row-muted td strong { opacity: .7; }
tr.row-highlight td { background: #fffbeb; }
.text-success { color: var(--success); }
@media (max-width: 900px) {
  .stk-actions { grid-template-columns: 1fr; }
  .stk-line { grid-template-columns: 1fr 1fr; }
  .stk-line select { grid-column: 1 / -1; }
}
.stk-line .sl-del { width: auto; justify-self: start; }

/* ---- Bekleyen Odemeler ---- */
.pay-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.pay-tile { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.pay-tile .lbl { font-size: 12.5px; color: var(--muted); }
.pay-tile .val { font-size: 22px; font-weight: 700; margin-top: 4px; }
.pay-tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pay-tile.danger .val { color: var(--danger, #dc2626); }
@media (max-width: 760px) { .pay-summary { grid-template-columns: 1fr; } }
.role-checks { display: flex; gap: 22px; flex-wrap: wrap; }
.role-checks .checkbox-row { padding-top: 0; }

/* ---- Sirket logosu ---- */
.logo-row { display: flex; gap: 18px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.logo-box { width: 180px; height: 84px; border: 1px dashed var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fafbfc; flex-shrink: 0; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-info { flex: 1; min-width: 0; }
.logo-actions { display: flex; gap: 8px; margin-top: 10px; }
.logo-actions label.btn { cursor: pointer; }
.doc-logo { display: block; max-width: 220px; max-height: 80px; object-fit: contain; margin-bottom: 10px; }
