/* ═══════════════════════════════════════════════════════════════════════════
   MUH-001 — ÖN MUHASEBE MODÜLÜ · "Defter" görsel dili
   ───────────────────────────────────────────────────────────────────────────
   NEDEN AYRI BİR GÖRSEL DİL: Modül platformun geri kalanından farklı bir işi
   yapıyor — ihale heyecanı değil, kayıt disiplini. Bu yüzden vurgu rengi
   platformun lacivert/amber aksiyonundan ayrışıyor: BAKIR (#B87333), firmanın
   işlediği metalin rengi. Sayılar tabular-nums ile hizalanıyor; satır
   ayraçları defter çizgisi inceliğinde. Paraşüt'ün mint yeşilinden bilinçli
   olarak uzak duruldu.

   TOKEN UYUMU: Renkler tokens.css değişkenlerine fallback ile bağlı; tema
   değişkeni yoksa sabit değere düşer, böylece dosya tek başına da çalışır.
   Yükleme sırası: special-themes.css SONRASI, fixes.css ÖNCESİ.
   ═══════════════════════════════════════════════════════════════════════════ */

.muh-shell {
  --muh-copper: #B87333;
  --muh-copper-soft: rgba(184, 115, 51, 0.10);
  --muh-copper-line: rgba(184, 115, 51, 0.28);
  --muh-ink: rgb(var(--color-neutral-900, 17 24 39));
  --muh-muted: rgb(var(--color-neutral-500, 107 114 128));
  --muh-surface: rgb(var(--color-neutral-0, 255 255 255));
  --muh-rule: rgb(var(--color-neutral-200, 229 231 235));
  --muh-pos: #15803D;
  --muh-neg: #B91C1C;
}

/* Koyu temada yüzeyler ve çizgiler yeniden tanımlanır — bakır sabit kalır,
   çünkü modülün kimliği o. */
[data-theme="dark"] .muh-shell,
.dark-theme .muh-shell {
  --muh-ink: rgb(var(--color-neutral-50, 249 250 251));
  --muh-muted: rgb(var(--color-neutral-400, 156 163 175));
  --muh-surface: rgb(var(--color-neutral-800, 31 41 55));
  --muh-rule: rgba(255, 255, 255, 0.10);
  --muh-copper-soft: rgba(184, 115, 51, 0.16);
  --muh-pos: #4ADE80;
  --muh-neg: #FCA5A5;
}

/* ── Başlık bandı ─────────────────────────────────────────────────────── */

.muh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--muh-copper);
  margin-bottom: 1rem;
}

.muh-head__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--muh-ink);
  margin: 0;
}

.muh-head__title i { color: var(--muh-copper); }

.muh-head__sub {
  font-size: 0.8rem;
  color: var(--muh-muted);
  margin: 0.15rem 0 0;
}

/* ── Alt navigasyon (pill) ────────────────────────────────────────────── */

.muh-nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.muh-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muh-muted);
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.muh-nav a:hover {
  color: var(--muh-copper);
  background: var(--muh-copper-soft);
}

.muh-nav a.active {
  color: var(--muh-copper);
  background: var(--muh-copper-soft);
  border-color: var(--muh-copper-line);
}

.muh-nav a:focus-visible {
  outline: 2px solid var(--muh-copper);
  outline-offset: 2px;
}

/* ── Kartlar ──────────────────────────────────────────────────────────── */

.muh-card {
  background: var(--muh-surface);
  border: 1px solid var(--muh-rule);
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
  height: 100%;
}

.muh-card--accent { border-top: 3px solid var(--muh-copper); }

.muh-kpi__label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muh-muted);
  margin-bottom: 0.3rem;
}

.muh-kpi__value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--muh-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.muh-kpi__hint {
  font-size: 0.74rem;
  color: var(--muh-muted);
  margin-top: 0.25rem;
}

/* ── Defter tablosu ───────────────────────────────────────────────────── */

.muh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.muh-table thead th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muh-muted);
  font-weight: 700;
  padding: 0.55rem 0.6rem;
  border-bottom: 2px solid var(--muh-copper-line);
  white-space: nowrap;
}

.muh-table tbody td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--muh-rule);
  color: var(--muh-ink);
  vertical-align: middle;
}

.muh-table tbody tr:hover td { background: var(--muh-copper-soft); }

.muh-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.muh-table tfoot td {
  padding: 0.6rem;
  border-top: 2px solid var(--muh-copper-line);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.muh-pos { color: var(--muh-pos); font-variant-numeric: tabular-nums; }
.muh-neg { color: var(--muh-neg); font-variant-numeric: tabular-nums; }
.muh-num { font-variant-numeric: tabular-nums; }

/* ── Durum rozetleri ──────────────────────────────────────────────────── */

.muh-badge {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.muh-badge--draft  { background: rgba(107, 114, 128, 0.14); color: #4B5563; }
.muh-badge--final  { background: var(--muh-copper-soft);    color: var(--muh-copper); }
.muh-badge--cancel { background: rgba(185, 28, 28, 0.12);   color: #B91C1C; }
.muh-badge--sale   { background: rgba(21, 128, 61, 0.12);   color: #15803D; }
.muh-badge--buy    { background: rgba(31, 79, 122, 0.12);   color: #1F4F7A; }

[data-theme="dark"] .muh-badge--draft { color: #D1D5DB; }

/* ── Çubuk grafik (CSS, kütüphane yok) ────────────────────────────────── */

.muh-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 130px;
  padding-top: 0.5rem;
}

.muh-bars__col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.muh-bars__stack {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 100px;
}

.muh-bars__bar {
  width: 42%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.muh-bars__bar--in  { background: var(--muh-copper); }
.muh-bars__bar--out { background: rgba(107, 114, 128, 0.45); }

.muh-bars__label {
  font-size: 0.65rem;
  color: var(--muh-muted);
  white-space: nowrap;
}

.muh-legend {
  display: flex;
  gap: 0.9rem;
  font-size: 0.74rem;
  color: var(--muh-muted);
  margin-top: 0.4rem;
}

.muh-legend span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 0.35rem;
}

.muh-legend .in::before  { background: var(--muh-copper); }
.muh-legend .out::before { background: rgba(107, 114, 128, 0.45); }

/* ── Boş durum ────────────────────────────────────────────────────────── */

.muh-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muh-muted);
}

.muh-empty i {
  font-size: 2rem;
  color: var(--muh-copper);
  opacity: 0.55;
  margin-bottom: 0.6rem;
  display: block;
}

/* ── Butonlar ─────────────────────────────────────────────────────────── */

.btn-muh {
  background: var(--muh-copper);
  border: 1px solid var(--muh-copper);
  color: #fff;
  font-weight: 600;
}

.btn-muh:hover, .btn-muh:focus {
  background: #9C601F;
  border-color: #9C601F;
  color: #fff;
}

.btn-muh-outline {
  background: transparent;
  border: 1px solid var(--muh-copper-line);
  color: var(--muh-copper);
  font-weight: 600;
}

.btn-muh-outline:hover, .btn-muh-outline:focus {
  background: var(--muh-copper-soft);
  color: var(--muh-copper);
}

/* ── Satır düzenleyici (fatura formu) ─────────────────────────────────── */

.muh-line-grid {
  display: grid;
  grid-template-columns: minmax(140px, 3fr) 90px 110px 80px 80px 90px 110px 36px;
  gap: 0.4rem;
  align-items: center;
}

.muh-line-grid input,
.muh-line-grid select {
  font-size: 0.82rem;
  padding: 0.3rem 0.45rem;
}

.muh-line-grid .muh-line-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--muh-ink);
}

.muh-line-head {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muh-muted);
  font-weight: 700;
}

@media (max-width: 991px) {
  .muh-line-grid {
    grid-template-columns: 1fr 1fr;
  }
  .muh-line-head { display: none; }
  .muh-bars { height: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .muh-nav a,
  .muh-bars__bar { transition: none; }
}
