/* ===================================================================
   Tuma Portal — Stil Sistemi
   Kenar çubuğu: derin slate · Vurgu: indigo · Net durum renkleri
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  /* Yüzeyler */
  --bg:            #f1f5f9;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --sidebar:       #0f172a;
  --sidebar-2:     #1e293b;
  --sidebar-text:  #94a3b8;
  --sidebar-hover: #1e293b;

  /* Metin */
  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;

  /* Çizgiler */
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  /* Marka */
  --primary:       #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft:  #eef2ff;
  --primary-text:  #4338ca;

  /* Durumlar */
  --green:      #059669;  --green-bg:  #d1fae5;  --green-text:  #065f46;
  --blue:       #2563eb;  --blue-bg:   #dbeafe;  --blue-text:   #1e40af;
  --amber:      #d97706;  --amber-bg:  #fef3c7;  --amber-text:  #92400e;
  --red:        #dc2626;  --red-bg:    #fee2e2;  --red-text:    #991b1b;
  --gray:       #64748b;  --gray-bg:   #f1f5f9;  --gray-text:   #475569;

  /* Ölçüler */
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  16px;
  --sidebar-w:  256px;
  --shadow-sm:  0 1px 2px rgba(15,23,42,.06);
  --shadow:     0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:  0 4px 12px rgba(15,23,42,.08);
  --shadow-lg:  0 10px 30px rgba(15,23,42,.12);

  --font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head:  'Plus Jakarta Sans', var(--font);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ============================ LAYOUT ============================ */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar) 0%, #0b1120 100%);
  color: var(--sidebar-text);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}

.sidebar-brand {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(148,163,184,.12);
}
.sidebar-brand .logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 800; font-size: 18px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
}
.sidebar-brand .name {
  font-family: var(--font-head);
  color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2;
}
.sidebar-brand .sub { font-size: 11px; color: var(--sidebar-text); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }
.nav-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #475569;
  padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 500; font-size: 13.5px;
  margin-bottom: 2px; transition: all .15s ease;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.3); }
.nav-item.active svg { color: #fff; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }

.sidebar-footer {
  padding: 14px; border-top: 1px solid rgba(148,163,184,.12);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-footer .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sidebar-2); color: #cbd5e1;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sidebar-footer .info { flex: 1; min-width: 0; }
.sidebar-footer .info .u-name { color: #e2e8f0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .info .u-role { color: var(--sidebar-text); font-size: 11px; }
.sidebar-footer .logout { color: var(--sidebar-text); padding: 6px; border-radius: 6px; display: flex; }
.sidebar-footer .logout:hover { background: var(--sidebar-hover); color: #f87171; }
.sidebar-footer .logout svg { width: 18px; height: 18px; }

/* Ana içerik */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--text); }
.topbar .page-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.topbar-spacer { flex: 1; }
.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text); padding: 8px; border-radius: 8px;
}
.menu-toggle:hover { background: var(--surface-2); }
.menu-toggle svg { width: 22px; height: 22px; }

.content { padding: 28px; max-width: 1400px; width: 100%; }

/* ============================ BUTONLAR ============================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: all .15s ease; white-space: nowrap; line-height: 1.2;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #047857; color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================ KARTLAR ============================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h2 { font-family: var(--font-head); font-size: 16px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 22px; }
.card-body.tight { padding: 0; }

/* İstatistik kartları */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card .icon {
  width: 44px; height: 44px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.stat-card .icon svg { width: 22px; height: 22px; }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.stat-card .value { font-family: var(--font-head); font-size: 25px; font-weight: 800; color: var(--text); margin-top: 3px; letter-spacing: -.01em; }
.stat-card .trend { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-card .trend.up { color: var(--green); }
.stat-card .trend.down { color: var(--red); }

.icon-indigo { background: var(--primary-soft); color: var(--primary); }
.icon-green  { background: var(--green-bg);   color: var(--green); }
.icon-amber  { background: var(--amber-bg);   color: var(--amber); }
.icon-blue   { background: var(--blue-bg);    color: var(--blue); }
.icon-red    { background: var(--red-bg);     color: var(--red); }

/* ============================ TABLOLAR ============================ */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  text-align: left; padding: 12px 18px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data tbody td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s ease; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .strong { font-weight: 600; color: var(--text); }
table.data .muted { color: var(--text-muted); }
table.data .actions { text-align: right; white-space: nowrap; }
table.data .actions a, table.data .actions button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 7px;
  color: var(--text-muted); border: none; background: none; cursor: pointer;
  transition: all .12s ease;
}
table.data .actions a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
table.data .actions button.del:hover { background: var(--red-bg); color: var(--red); }
table.data .actions svg { width: 16px; height: 16px; }

.cell-primary { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ============================ ROZETLER ============================ */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge-green { background: var(--green-bg); color: var(--green-text); }
.badge-blue  { background: var(--blue-bg);  color: var(--blue-text); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); }
.badge-red   { background: var(--red-bg);   color: var(--red-text); }
.badge-gray  { background: var(--gray-bg);  color: var(--gray-text); }
.badge.no-dot::before { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary-text);
}
.chip-hizmet { background: #ecfdf5; color: #047857; }
.chip-urun   { background: #eef2ff; color: #4338ca; }
.chip-manuel { background: #f1f5f9; color: #475569; }

/* ============================ FORMLAR ============================ */

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.field label .req { color: var(--red); }
.field .hint { font-size: 11.5px; color: var(--text-muted); }

.input, .select, .textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px; color: var(--text);
  background: var(--surface); transition: all .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 38px;
}
.input-group { display: flex; align-items: stretch; }
.input-group .addon {
  display: flex; align-items: center; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
}
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 20px; margin-top: 22px; border-top: 1px solid var(--border);
}

/* Toolbar (liste üstü) */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.toolbar .search {
  position: relative; flex: 1; min-width: 220px; max-width: 380px;
}
.toolbar .search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-light);
}
.toolbar .search input {
  width: 100%; padding: 9px 13px 9px 38px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: var(--font); background: var(--surface);
}
.toolbar .search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.toolbar-spacer { flex: 1; }

/* ============================ ALERTLER ============================ */

.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px; font-weight: 500;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-bg); color: var(--green-text); }
.alert-error   { background: var(--red-bg);   color: var(--red-text); }
.alert-info    { background: var(--blue-bg);  color: var(--blue-text); }
.alert-warning { background: var(--amber-bg); color: var(--amber-text); }

.flash-stack { position: fixed; top: 78px; right: 24px; z-index: 60; width: 340px; max-width: calc(100vw - 32px); }
.flash-stack .alert { box-shadow: var(--shadow-lg); animation: slideIn .3s ease; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================ BOŞ DURUM ============================ */

.empty {
  text-align: center; padding: 56px 24px; color: var(--text-muted);
}
.empty .icon {
  width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 16px;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.empty .icon svg { width: 28px; height: 28px; color: var(--text-light); }
.empty h3 { font-family: var(--font-head); font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13.5px; max-width: 360px; margin: 0 auto 18px; }

/* ============================ PAGİNATION ============================ */

.pagination { display: flex; align-items: center; gap: 6px; padding: 16px 22px; border-top: 1px solid var(--border); }
.pagination .info { font-size: 12.5px; color: var(--text-muted); margin-right: auto; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 7px;
  font-size: 13px; font-weight: 600; border: 1px solid var(--border);
  color: var(--text); background: var(--surface);
}
.pagination a:hover { background: var(--surface-2); text-decoration: none; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ============================ MODAL ============================ */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 520px; box-shadow: var(--shadow-lg);
  max-height: 90vh; overflow-y: auto; animation: modalUp .25s ease;
}
.modal.wide { max-width: 720px; }
@keyframes modalUp { from { transform: translateY(20px) scale(.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.modal-head .close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 6px; border-radius: 6px; display: flex; }
.modal-head .close:hover { background: var(--surface-2); color: var(--text); }
.modal-head .close svg { width: 20px; height: 20px; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================ TEKLİF KALEMLERİ ============================ */

.line-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.line-items thead th {
  text-align: left; padding: 9px 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.line-items thead th.num { text-align: right; }
.line-items tbody td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.line-items input, .line-items select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; font-family: var(--font); background: var(--surface);
}
.line-items input:focus, .line-items select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.line-items input.num { text-align: right; }
.line-items .row-total { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-items .row-del {
  width: 30px; height: 30px; border: none; background: none; cursor: pointer;
  color: var(--text-light); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
}
.line-items .row-del:hover { background: var(--red-bg); color: var(--red); }
.line-items .row-del svg { width: 15px; height: 15px; }
.col-w-desc { width: 34%; }
.col-w-qty  { width: 90px; }
.col-w-price { width: 130px; }
.col-w-kdv  { width: 80px; }

.totals-box {
  margin-top: 20px; margin-left: auto; max-width: 340px;
  background: var(--surface-2); border-radius: var(--radius); padding: 18px 20px;
}
.totals-box .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13.5px; }
.totals-box .row .lbl { color: var(--text-muted); }
.totals-box .row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.totals-box .grand { border-top: 2px solid var(--border-strong); margin-top: 8px; padding-top: 12px; }
.totals-box .grand .lbl { font-family: var(--font-head); font-weight: 700; color: var(--text); font-size: 15px; }
.totals-box .grand .val { font-family: var(--font-head); font-weight: 800; color: var(--primary); font-size: 19px; }

/* ============================ DETAY SAYFA ============================ */

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.info-list { display: flex; flex-direction: column; }
.info-list .item { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.info-list .item:last-child { border-bottom: none; }
.info-list .item .k { color: var(--text-muted); }
.info-list .item .v { font-weight: 600; text-align: right; }

.section-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; margin: 4px 0 14px; }

.mini-stat { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.mini-stat:last-child { border-bottom: none; }
.mini-stat .mini-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mini-stat .mini-icon svg { width: 19px; height: 19px; }
.mini-stat .mini-label { font-size: 12px; color: var(--text-muted); }
.mini-stat .mini-value { font-family: var(--font-head); font-weight: 700; font-size: 16px; }

/* ============================ DASHBOARD ÖZEL ============================ */

.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.chart-box { height: 260px; position: relative; }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 20px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-chart .bars { width: 100%; display: flex; gap: 3px; align-items: flex-end; height: 100%; justify-content: center; }
.bar-chart .bar { width: 42%; border-radius: 5px 5px 0 0; min-height: 3px; transition: height .5s ease; }
.bar-chart .bar.income { background: linear-gradient(180deg, var(--primary) 0%, #6366f1 100%); }
.bar-chart .bar.expense { background: linear-gradient(180deg, #f87171 0%, #ef4444 100%); }
.bar-chart .bar-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.chart-legend { display: flex; gap: 18px; justify-content: center; margin-top: 16px; font-size: 12.5px; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.chart-legend .dot { width: 10px; height: 10px; border-radius: 3px; }

.activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-item .a-dot { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.activity-item .a-dot svg { width: 17px; height: 17px; }
.activity-item .a-text { font-size: 13px; flex: 1; }
.activity-item .a-time { font-size: 11.5px; color: var(--text-light); margin-top: 2px; }

/* ============================ YARDIMCI ============================ */

.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 20px; }
.mb-2 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-2 { gap: 10px; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.tag-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* ============================ RESPONSIVE ============================ */

.overlay-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 35; }
.overlay-backdrop.show { display: block; }

@media (max-width: 1024px) {
  .detail-grid, .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .content { padding: 18px; }
  .topbar { padding: 0 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .flash-stack { right: 12px; left: 12px; width: auto; }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .col-w-kdv, .line-items .hide-sm { display: none; }
}

/* ===================================================================
   YAZDIRMA — Teklif & Sözleşme çıktıları
   =================================================================== */

.print-doc { display: none; }

@media print {
  @page { size: A4; margin: 18mm 16mm; }
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .no-print, .overlay-backdrop, .flash-stack { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .print-doc { display: block !important; }
  .card { box-shadow: none; border: none; }
  a { color: inherit; text-decoration: none; }
}

/* Yazdırma belgesi stili (ekranda önizleme + baskı) */
.doc-sheet {
  background: #fff; max-width: 820px; margin: 0 auto;
  padding: 44px 48px; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); color: #1e293b;
}
.doc-header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 24px; border-bottom: 3px solid var(--primary); margin-bottom: 28px; }
.doc-header .firm-name { font-family: var(--font-head); font-size: 24px; font-weight: 800; color: var(--primary); }
.doc-header .firm-slogan { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.doc-header .firm-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.7; }
.doc-header .doc-type { text-align: right; }
.doc-header .doc-type .t { font-family: var(--font-head); font-size: 20px; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: .02em; }
.doc-header .doc-type .no { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.doc-header .doc-type .badge { margin-top: 8px; }

.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.doc-parties .party .label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); margin-bottom: 8px; }
.doc-parties .party .name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.doc-parties .party .line { font-size: 12px; color: var(--text-muted); line-height: 1.7; }

table.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
table.doc-table thead th { background: var(--surface-2); text-align: left; padding: 11px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); border-bottom: 2px solid var(--border-strong); }
table.doc-table thead th.num { text-align: right; }
table.doc-table tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
table.doc-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.doc-table tbody .desc-main { font-weight: 600; }
table.doc-table tbody .desc-sub { font-size: 11px; color: var(--text-muted); }

.doc-totals { margin-left: auto; max-width: 320px; margin-bottom: 28px; }
.doc-totals .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.doc-totals .row .lbl { color: var(--text-muted); }
.doc-totals .row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.doc-totals .grand { border-top: 2px solid var(--primary); margin-top: 6px; padding-top: 10px; }
.doc-totals .grand .lbl { font-weight: 800; font-size: 15px; color: var(--text); }
.doc-totals .grand .val { font-weight: 800; font-size: 18px; color: var(--primary); }

.doc-notes { background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 24px; font-size: 12.5px; line-height: 1.7; }
.doc-notes .label { font-weight: 700; margin-bottom: 6px; color: var(--text); }
.doc-body-text { font-size: 13px; line-height: 1.85; white-space: pre-wrap; color: #1e293b; }
.doc-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; font-size: 11px; color: var(--text-light); }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 60px; }
.doc-sign .sign-box { text-align: center; }
.doc-sign .sign-line { border-top: 1.5px solid var(--text); padding-top: 8px; font-size: 12px; font-weight: 600; }

/* Giriş sayfası */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%); }
.login-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; padding: 40px 38px; }
.login-card .brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 30px; }
.login-card .brand .logo { width: 56px; height: 56px; border-radius: 15px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 24px; color: #fff; margin-bottom: 16px; box-shadow: 0 8px 20px rgba(79,70,229,.4); }
.login-card .brand h1 { font-family: var(--font-head); font-size: 22px; font-weight: 800; }
.login-card .brand p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.login-card .field { margin-bottom: 16px; }
.login-note { margin-top: 20px; text-align: center; font-size: 12px; color: var(--text-light); }

/* Onay kutusu etiketi (modal formlar) */
.field label.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.field label.chk input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* Müşteri detay — bilgi satırları */
.info-rows { display: flex; flex-direction: column; }
.info-row { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-muted); font-weight: 500; }
.info-row .v { color: var(--text); font-weight: 500; word-break: break-word; }
.empty.sm { padding: 26px 20px; text-align: center; color: var(--text-muted); font-size: 13.5px; }
.empty.sm a { color: var(--primary); font-weight: 600; }
@media (max-width: 640px) { .info-row { grid-template-columns: 1fr; gap: 2px; } }

/* Segment sekmeleri (durum filtresi) */
.seg-tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.seg { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.seg:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.seg.active { background: var(--primary); color: #fff; }
.seg-count { font-size: 11px; font-weight: 700; background: rgba(0,0,0,.08); padding: 1px 7px; border-radius: 10px; }
.seg.active .seg-count { background: rgba(255,255,255,.25); color: #fff; }

/* Teklif formu yardımcıları */
.quick-add-row { margin-bottom: 16px; }
.quick-add-row .select { max-width: 100%; }
.btn-add { margin-top: 14px; border: 1px dashed var(--border-strong); width: 100%; justify-content: center; color: var(--primary); }
.btn-add:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.field-hint a { color: var(--primary); font-weight: 600; }

/* Belge araç çubuğu (teklif/sözleşme görüntüleme) */
.doc-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.doc-toolbar .inline-status { margin: 0; }
.doc-toolbar .inline-status .select { min-width: 150px; }

/* Sözleşme formu */
.template-bar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.template-bar .select { flex: 1; min-width: 180px; }
.textarea.mono { font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; font-size: 12.5px; line-height: 1.6; }

/* Sözleşme meta şeridi */
.doc-meta-strip { display: flex; flex-wrap: wrap; gap: 28px; padding: 14px 18px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 24px; }
.doc-meta-strip > div { display: flex; flex-direction: column; gap: 2px; }
.doc-meta-strip .k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-light); }
.doc-meta-strip .v { font-size: 13px; font-weight: 600; color: var(--text); }

/* Tahsil edildi (ok) aksiyon butonu */
table.data .actions button.ok:hover { background: var(--green-bg); color: var(--green); }

/* Raporlar — yıl seçici ve kategori barları */
.rep-year { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cat-bars { display: flex; flex-direction: column; gap: 16px; padding: 6px 2px; }
.cat-bar { position: relative; }
.cat-bar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.cat-track { height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.cat-fill { height: 100%; background: linear-gradient(90deg, var(--primary) 0%, #6366f1 100%); border-radius: 6px; min-width: 3px; }
.cat-pct { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-align: right; }

/* Belge logosu (teklif/sözleşme başlığı) */
.doc-header .doc-logo { max-height: 68px; max-width: 240px; width: auto; height: auto; margin-bottom: 12px; display: block; object-fit: contain; }

/* Ayarlar — logo önizleme */
.logo-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.logo-preview img { max-height: 56px; max-width: 200px; width: auto; height: auto; object-fit: contain; background: #fff; padding: 6px; border-radius: 6px; border: 1px solid var(--border); }
.logo-preview .chk { font-size: 13px; color: var(--text-muted); }

@media print {
  .doc-header .doc-logo { max-height: 60px; }
}

/* Kenar çubuğu logo görseli (beyaz çip içinde, her renk logo görünür) */
.sidebar-brand .logo.logo-img { background: #fff; padding: 5px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.sidebar-brand .logo.logo-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
