/* ============================================================
 * style.css
 * Kağıt Gramaj ve Maliyet Hesaplama - Kurumsal Dashboard Teması
 * ============================================================ */

:root {
  --brand-900: #0b2545;
  --brand-800: #13315c;
  --brand-700: #1b4079;
  --brand-600: #2563a8;
  --brand-500: #3b82c4;
  --accent: #f59e0b;
  --accent-dark: #b45309;
  --success: #15803d;
  --danger: #b91c1c;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f1f5f9;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Üst Bar ---------- */

.app-header {
  background: linear-gradient(120deg, var(--brand-900) 0%, var(--brand-700) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.app-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .5px;
}

.app-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}

.app-subtitle {
  margin: 2px 0 0;
  font-size: .82rem;
  color: rgba(255, 255, 255, .72);
}

.ref-badge {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 10px;
  padding: .45rem .9rem;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.ref-badge-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: rgba(255, 255, 255, .68);
}

.ref-badge-value {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Sekmeler ---------- */

.app-tabs {
  border-bottom: 2px solid var(--line);
  gap: .25rem;
}

.app-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .95rem;
  padding: .7rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: color .15s, border-color .15s, background .15s;
}

.app-tabs .nav-link:hover {
  color: var(--brand-700);
  background: rgba(37, 99, 168, .05);
}

.app-tabs .nav-link.active {
  color: var(--brand-700);
  background: transparent;
  border-bottom-color: var(--brand-600);
}

.tab-index {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-soft);
  font-size: .72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.app-tabs .nav-link.active .tab-index {
  background: var(--brand-600);
  color: #fff;
}

.badge-count {
  background: var(--brand-700);
  color: #fff;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .5rem;
  min-width: 22px;
  text-align: center;
}

/* ---------- Kartlar ---------- */

.app-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.app-card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.15rem;
}

.app-card-header h2 {
  font-weight: 700;
  color: var(--brand-900);
  letter-spacing: .2px;
}

.header-hint {
  font-size: .75rem;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .15rem .6rem;
}

/* ---------- Form ---------- */

.form-label {
  font-weight: 600;
  font-size: .85rem;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}

.req { color: var(--danger); }

.form-control,
.form-select {
  border-color: #cbd5e1;
  font-size: .98rem;
  padding: .55rem .75rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 .18rem rgba(59, 130, 196, .18);
}

.input-group-text {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--ink-soft);
  font-size: .85rem;
  font-weight: 600;
  min-width: 62px;
  justify-content: center;
}

.unit-select {
  max-width: 96px;
  flex: 0 0 96px;
  background-color: #f1f5f9;
  font-weight: 600;
  font-size: .85rem;
}

.invalid-feedback {
  font-size: .8rem;
  font-weight: 500;
  min-height: 1px;
}

.info-note {
  font-size: .85rem;
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
  border-radius: 10px;
  padding: .7rem .9rem;
}

/* ---------- Referans hazır butonları ---------- */

.ref-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}

.preset-label {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
  margin-right: .15rem;
}

.btn-preset {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.btn-preset:hover {
  border-color: var(--brand-500);
  color: var(--brand-700);
}

.btn-preset.active {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}

/* ---------- Butonlar ---------- */

.btn-calculate {
  background: linear-gradient(120deg, var(--brand-700), var(--brand-600));
  border: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: .75rem 1rem;
  box-shadow: 0 3px 10px rgba(27, 64, 121, .28);
}

.btn-calculate:hover,
.btn-calculate:focus {
  background: linear-gradient(120deg, var(--brand-900), var(--brand-700));
  color: #fff;
}

.btn-save {
  background: var(--success);
  border: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1.1px;
  padding: .7rem 1.6rem;
  box-shadow: 0 3px 10px rgba(21, 128, 61, .25);
}

.btn-save:hover,
.btn-save:focus {
  background: #166534;
  color: #fff;
}

/* ---------- Boş durum ---------- */

.empty-state {
  background: var(--surface);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.empty-state-flat {
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 2.5rem 1.5rem;
}

.empty-state h3 {
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: .35rem;
}

.empty-state p { font-size: .88rem; }

.empty-icon {
  font-size: 2.4rem;
  margin-bottom: .6rem;
  opacity: .75;
}

/* ---------- Sonuç Hero Şeridi ---------- */

.result-hero {
  background: linear-gradient(120deg, var(--brand-900), var(--brand-700));
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-md);
  border-left: 6px solid var(--accent);
}

.result-hero.status-above { border-left-color: #f97316; }
.result-hero.status-below { border-left-color: #38bdf8; }
.result-hero.status-equal { border-left-color: #22c55e; }

.hero-label {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255, 255, 255, .7);
  margin-bottom: .15rem;
}

.hero-value {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-value small {
  font-size: .95rem;
  font-weight: 500;
  margin-left: .4rem;
  color: rgba(255, 255, 255, .75);
}

.hero-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: .5rem 1.4rem;
}

.hero-item span {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: rgba(255, 255, 255, .62);
}

.hero-item strong {
  font-size: .98rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hero-status strong { color: var(--accent); }

/* ---------- Sonuç Kartları ---------- */

.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .85rem .95rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s;
}

.result-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.result-label {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  font-weight: 700;
}

.result-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-900);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.result-value small {
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: .3rem;
}

.result-hint {
  font-size: .74rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: .25rem;
}

.result-card-primary {
  background: linear-gradient(160deg, #eff6ff, #ffffff);
  border-color: #bfdbfe;
}

.result-card-primary .result-value { color: var(--brand-700); }

.result-card-accent {
  background: linear-gradient(160deg, #fffbeb, #ffffff);
  border-color: #fde68a;
}

.result-card-accent .result-value { color: var(--accent-dark); }

/* ---------- Maliyet Paneli ---------- */

.cost-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cost-panel-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  padding: .7rem 1.15rem;
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--brand-900);
}

.estimate-note {
  font-size: .85rem;
  border-radius: 10px;
  background: #fffbeb;
  border-color: #fde68a;
  color: #78350f;
}

/* ---------- Kaydet Çubuğu ---------- */

.action-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  box-shadow: var(--shadow-sm);
}

.action-desc {
  flex: 1 1 260px;
  min-width: 0;
}

.action-buttons {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ---------- Özet Kutuları ---------- */

.summary-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: .15rem;
  height: 100%;
}

.summary-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  font-weight: 700;
}

.summary-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand-900);
  font-variant-numeric: tabular-nums;
}

.summary-tile-accent {
  background: linear-gradient(160deg, var(--brand-900), var(--brand-700));
  border-color: var(--brand-900);
}

.summary-tile-accent .summary-label { color: rgba(255, 255, 255, .68); }
.summary-tile-accent .summary-value { color: #fff; }

/* ---------- Geçmiş Tablosu ---------- */

.search-input {
  min-width: 210px;
}

.history-table {
  font-size: .88rem;
}

.history-table thead th {
  background: #f8fafc;
  color: var(--ink-soft);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
  padding: .7rem .75rem;
}

.history-table tbody td {
  padding: .6rem .75rem;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.desc-cell {
  font-variant-numeric: normal;
  max-width: 260px;
  font-weight: 600;
  color: var(--ink);
}

.badge-est {
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-size: .66rem;
  font-weight: 700;
  padding: .05rem .35rem;
  text-transform: uppercase;
  letter-spacing: .3px;
  vertical-align: middle;
}

/* ---------- Durum renkleri ---------- */

.status-above-text { color: var(--accent-dark); font-weight: 600; }
.status-below-text { color: var(--brand-600); font-weight: 600; }
.status-equal-text { color: var(--success); font-weight: 600; }

/* ---------- Detay Modal ---------- */

.detail-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-900);
}

.detail-sub {
  font-size: .8rem;
  color: var(--muted);
}

.detail-table th {
  width: 45%;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: .86rem;
}

.detail-table td {
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
}

/* ---------- Alt Bar ---------- */

.app-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
  .hero-value { font-size: 2rem; }
  .hero-side { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
}

@media (max-width: 575.98px) {
  body { font-size: 14px; }
  .app-title { font-size: 1.02rem; }
  .app-tabs .nav-link { padding: .6rem .7rem; font-size: .85rem; }
  .result-hero { padding: 1rem; }
  .hero-value { font-size: 1.75rem; }
  .hero-side { grid-template-columns: 1fr 1fr; gap: .4rem .8rem; }
  .result-value { font-size: 1.2rem; }
  .summary-value { font-size: 1.1rem; }
  .action-buttons { width: 100%; }
  .action-buttons .btn { flex: 1 1 auto; }
  .unit-select { max-width: 82px; flex: 0 0 82px; }
}

/* ============================================================
 * YAZDIRMA
 * ============================================================ */

.print-only { display: none; }

@media print {
  @page {
    size: A4 portrait;
    margin: 16mm 14mm;
  }

  body {
    background: #fff !important;
    font-size: 11pt;
    color: #000;
  }

  .no-print,
  .app-header,
  .app-footer,
  .modal,
  .modal-backdrop,
  .toast-container {
    display: none !important;
  }

  .print-only { display: block !important; }

  .print-header {
    border-bottom: 3px double #000;
    padding-bottom: 8px;
    margin-bottom: 18px;
  }

  .print-header h1 {
    font-size: 15pt;
    font-weight: 700;
    letter-spacing: .5px;
    margin: 0 0 4px;
    text-align: center;
  }

  .print-meta {
    text-align: center;
    font-size: 9pt;
    color: #333;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #444;
    padding: 6px 9px;
    font-size: 10.5pt;
    text-align: left;
  }

  .print-table th {
    width: 42%;
    background: #f0f0f0 !important;
    font-weight: 600;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-table td {
    font-variant-numeric: tabular-nums;
  }

  .print-footer {
    margin-top: 42px;
    display: flex;
    justify-content: space-between;
    gap: 40px;
  }

  .print-sign {
    flex: 1;
    text-align: center;
    font-size: 9.5pt;
  }

  .sign-line {
    border-top: 1px solid #000;
    margin-top: 42px;
  }
}

/* ============================================================
 * Placeholder — girilmiş veriyle karışmasın
 * ============================================================ */

.form-control::placeholder {
  color: #a3b1c2;
  font-style: italic;
  opacity: 1;
}

/* ---------- Kiloyu hesapla yardımcısı ---------- */

.btn-quickcalc {
  margin-top: .4rem;
  background: #eff6ff;
  border: 1px dashed #93c5fd;
  color: var(--brand-700);
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 8px;
  width: 100%;
}

.btn-quickcalc:hover {
  background: #dbeafe;
  border-style: solid;
  color: var(--brand-900);
}

/* ============================================================
 * Baskı Bilgileri (fiyat listesi seçimi)
 * ============================================================ */

.print-config {
  /* Dikey flex konteynerde flex-basis yüksekliği etkiler; auto kalmalı */
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fcfdff;
}

.print-config-header {
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
  padding: .55rem .9rem;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--brand-900);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: baseline;
  justify-content: space-between;
}

.print-config-hint {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .2px;
  text-transform: none;
  color: var(--muted);
}

.print-config-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  padding: .85rem .9rem;
}

.surface-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .6rem .7rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.surface-group-front { border-left: 4px solid var(--brand-600); }
.surface-group-back { border-left: 4px solid var(--accent); }

.surface-title {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.print-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.print-opt .form-label {
  margin: 0;
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink);
}

.print-opt-select {
  max-width: 92px;
  font-weight: 700;
  font-size: .8rem;
  text-align: center;
}

.print-opt-select option[value="1"] { color: var(--success); }

/* ---------- Baskı fiyat sonucu ---------- */

.print-price {
  border-top: 1px solid var(--line);
  padding: .7rem .9rem;
  background: #f8fafc;
  font-size: .84rem;
}

.pp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.pp-item span {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  font-weight: 700;
}

.pp-item strong {
  font-size: 1rem;
  color: var(--brand-900);
  font-variant-numeric: tabular-nums;
}

.pp-total strong { color: var(--success); font-size: 1.15rem; }

.pp-desc {
  margin-top: .35rem;
  font-size: .76rem;
  color: var(--muted);
}

.pp-empty { color: var(--muted); font-style: italic; }

.pp-missing { color: var(--accent-dark); font-weight: 600; }

/* ---------- Kaydet çubuğu düzeni ---------- */

.action-bar {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: .9rem;
}

.action-save {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

/* ============================================================
 * Fiyat Listesi Tablosu
 * ============================================================ */

.price-note {
  display: block;
  font-size: .74rem;
  color: var(--muted);
  margin-top: 2px;
}

.price-table {
  font-size: .86rem;
}

.price-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--ink-soft);
  vertical-align: middle;
  padding: .55rem .6rem;
}

.price-table thead .surface-front {
  background: #e0edfb;
  color: var(--brand-900);
}

.price-table thead .surface-back {
  background: #fef3c7;
  color: #78350f;
}

.price-table thead .th-black {
  background: #1f2937;
  color: #fff;
}

.price-table thead .th-base {
  background: #fde047;
  color: #422006;
}

.price-table tbody td {
  padding: .5rem .6rem;
  border-bottom: 1px solid var(--line);
}

/* Bootstrap'ın .table > * > * kuralını geçmek için tbody ile nitelendirildi */
.price-table tbody .cell-var {
  --bs-table-bg: #86d472;
  background-color: #86d472;
  font-weight: 800;
  color: #14310a;
}

.price-table tbody .cell-yok {
  color: var(--muted);
  font-weight: 600;
}

.price-usd {
  font-weight: 800;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-row-active {
  outline: 2px solid var(--brand-600);
}

.price-foot {
  padding: .7rem 1.15rem;
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------- Geçmiş tablosu: baskı rozeti ---------- */

.print-chip {
  display: inline-block;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  padding: .1rem .5rem;
  white-space: nowrap;
}

.print-chip-missing {
  background: #fff7ed;
  border-color: #fed7aa;
  color: var(--accent-dark);
}

/* ---------- Özet: baskı bedeli ---------- */

.summary-tile-print {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(120deg, #ecfdf5, #ffffff);
  border-color: #a7f3d0;
}

.summary-tile-print .summary-value { color: var(--success); }

/* ---------- Responsive ek ---------- */

@media (max-width: 575.98px) {
  .print-config-body { grid-template-columns: 1fr; }
  .pp-row { gap: .75rem 1rem; }
  .action-save .action-buttons { width: 100%; }
}

/* ---------- Yazdırma: fiyat listesi ---------- */

@media print {
  .print-table-grid th,
  .print-table-grid td {
    width: auto !important;
    text-align: center;
    font-size: 9.5pt;
    padding: 4px 6px;
  }

  .print-table-grid thead th {
    background: #e5e5e5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------- Geçmiş tablosu: baskı bedeli ---------- */

.money-usd {
  font-weight: 700;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

/* ---------- Toplam tutar kutusu ve tablo toplam satırı ---------- */

.total-left {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.total-formula {
  font-size: .78rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.summary-tile-print .summary-value {
  font-size: 1.6rem;
}

.history-table tfoot .total-row th,
.history-table tfoot .total-row td {
  background: #f1f5f9;
  border-top: 2px solid var(--brand-700);
  font-weight: 800;
  color: var(--brand-900);
  font-variant-numeric: tabular-nums;
  padding: .65rem .75rem;
}

.history-table tfoot .total-row th {
  letter-spacing: .6px;
  font-size: .78rem;
}

.history-table tfoot #footPrint { color: var(--success); }

/* ---------- Üretilen m² sütunu ---------- */

.area-cell {
  font-weight: 700;
  color: var(--brand-700);
}

/* ============================================================
 * GİRİŞ EKRANI
 * ============================================================ */

body.login-mode {
  background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 55%, var(--brand-600) 100%);
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-screen.d-none { display: none !important; }

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem 1.9rem 1.5rem;
  box-shadow: 0 18px 45px rgba(11, 37, 69, .35);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding-bottom: 1.2rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.login-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .5px;
}

.login-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--brand-900);
  margin: 0;
  line-height: 1.3;
}

.login-subtitle {
  margin: 3px 0 0;
  font-size: .76rem;
  color: var(--muted);
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: 8px;
  padding: .6rem .8rem;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.login-foot {
  margin-top: 1.3rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .3px;
}

/* ---------- Başlıktaki kullanıcı kutusu ---------- */

.user-box {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  padding: .35rem .4rem .35rem .75rem;
}

.user-mail {
  font-size: .78rem;
  color: rgba(255, 255, 255, .85);
  font-weight: 500;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 7px;
}

.btn-logout:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

@media (max-width: 575.98px) {
  .login-card { padding: 1.5rem 1.25rem 1.2rem; }
  .login-title { font-size: .95rem; }
  .user-mail { max-width: 130px; font-size: .72rem; }
}

@media print {
  .login-screen,
  .user-box { display: none !important; }
}

/* ---------- Kayıtlar nerede saklanıyor rozeti ---------- */

.storage-badge {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .3px;
  padding: .3rem .65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: default;
}

.storage-badge-server {
  background: rgba(34, 197, 94, .18);
  border-color: rgba(134, 239, 172, .55);
  color: #bbf7d0;
}

.storage-badge-local {
  background: rgba(245, 158, 11, .2);
  border-color: rgba(253, 230, 138, .5);
  color: #fde68a;
}

@media (max-width: 767.98px) {
  .storage-badge { font-size: .64rem; padding: .22rem .5rem; }
}

@media print {
  .storage-badge { display: none !important; }
}
