/* Darcan Kitap Kirtasiye — arka ofis muhasebe arayuzu
   Tasarim ilkesi: NETLIK. Sade palet, okunakli tablolar, acik durum renkleri. */

:root {
  --ink:        #1b2430;   /* ana metin */
  --ink-soft:   #5a6675;   /* ikincil metin */
  --line:       #e3e8ef;   /* cizgiler */
  --bg:         #f5f7fa;   /* sayfa zemini */
  --surface:    #ffffff;   /* kart zemini */
  --brand:      #1f3a5f;   /* lacivert (kurumsal) */
  --brand-2:    #2c5a8c;
  --accent:     #c9772e;   /* sicak vurgu (turuncu) */

  --green:      #1f9d57;  --green-bg:  #e6f6ee;
  --yellow:     #b8860b;  --yellow-bg: #fdf3da;
  --red:        #cf3a3a;  --red-bg:    #fbe9e9;
  --gray:       #6b7280;  --gray-bg:   #eef0f3;
  --blue:       #2563c9;  --blue-bg:   #e7eefb;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Yerlesim ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: var(--brand); color: #dbe4ef;
  flex-shrink: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  padding: 18px 18px 14px; font-weight: 700; font-size: 17px;
  color: #fff; letter-spacing: .2px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand small { display: block; font-weight: 400; font-size: 11px; color: #9fb4cc; margin-top: 2px; }
.nav { padding: 8px 0; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; color: #c4d2e3; font-size: 14px; border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255,255,255,.10); color: #fff; border-left-color: var(--accent); font-weight: 600; }
.nav .nav-sec { padding: 14px 18px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #7d93ad; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 0 22px; height: 56px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 20;
}
.topbar .menu-btn { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink); }
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-soft); }
.topbar .user b { color: var(--ink); }
.content { padding: 22px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- Baslik ---------- */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; color: var(--ink); }
.page-subtitle { color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Kartlar ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }

/* ---------- Istatistik kutulari ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-left: 4px solid var(--brand); }
.stat.red    { border-left-color: var(--red); }
.stat.green  { border-left-color: var(--green); }
.stat.yellow { border-left-color: var(--yellow); }
.stat.blue   { border-left-color: var(--blue); }
.stat .label { font-size: 12.5px; color: var(--ink-soft); }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--ink-soft); }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th, table.table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.table thead th { background: #fafbfc; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-soft); font-weight: 600; }
table.table tbody tr:hover { background: #fafbfc; }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t-strong { font-weight: 600; color: var(--ink); }
.muted { color: var(--ink-soft); }
.small { font-size: 12.5px; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money.pos { color: var(--red); }     /* borc/bakiye */
.money.neg { color: var(--green); }   /* alacak/avans */

/* ---------- Durum etiketleri ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.green  { color: var(--green);  background: var(--green-bg); }
.pill.yellow { color: var(--yellow); background: var(--yellow-bg); }
.pill.red    { color: var(--red);    background: var(--red-bg); }
.pill.gray   { color: var(--gray);   background: var(--gray-bg); }
.pill.blue   { color: var(--blue);   background: var(--blue-bg); }
.tag { display:inline-block; padding: 1px 7px; border-radius: 6px; background: var(--gray-bg); color: var(--ink-soft); font-size: 11px; font-weight: 600; }

/* ---------- Butonlar ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: .12s; text-decoration: none; }
.btn:hover { background: #f3f5f8; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.95); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand-2); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Formlar ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: var(--font); color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(44,90,140,.12); }
textarea { resize: vertical; min-height: 72px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Flash ---------- */
.flashes { margin-bottom: 16px; display: grid; gap: 8px; }
.flash { padding: 11px 14px; border-radius: 8px; font-size: 14px; border: 1px solid; }
.flash.success { background: var(--green-bg); border-color: #bfe6d0; color: #14633a; }
.flash.error   { background: var(--red-bg);   border-color: #f3c4c4; color: #9b2222; }
.flash.warning { background: var(--yellow-bg); border-color: #ecd9a3; color: #8a6508; }
.flash.info    { background: var(--blue-bg);  border-color: #c5d8f7; color: #1c4a99; }

/* ---------- Filtre bari ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 150px; }
.filters .field label { font-size: 12px; }

/* ---------- Cesitli ---------- */
.row-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 500; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty .big { font-size: 36px; margin-bottom: 8px; opacity: .5; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.line-table input { padding: 6px 8px; font-size: 13px; }

/* ---------- Mobil ---------- */
.backdrop { display: none; }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -240px; z-index: 50; transition: left .2s; box-shadow: 4px 0 16px rgba(0,0,0,.2); }
  .sidebar.open { left: 0; }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
  .topbar .menu-btn { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
}

/* Destek modu (impersonation) bandi */
.impersonate-bar {
  background: #b8860b; color: #fff; padding: 8px 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; gap: 12px;
}
.impersonate-bar .btn { background: #fff; color: #b8860b; }
