@font-face {
  font-family: "DM Sans";
  src: url("/static/fonts/DMSans-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e6ebf1;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #475569;
  --dim: #64748b;
  --brand: #0f766e;
  --brand-hover: #115e59;
  --brand-soft: #d6f3ef;
  --brand-ring: rgba(15, 118, 110, 0.22);
  --accent: #10b981;
  --danger: #dc2626;
  --r: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.07);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { background: var(--bg); overflow: hidden; }
[hidden] { display: none !important; }

/* Shell — tam ekran, scroll yok */
.shell { display: flex; height: 100vh; }

/* Sidebar */
.sidebar {
  width: 250px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 16px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.brand-fam {
  font-size: 10px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); padding: 1px 7px; border-radius: 999px;
  display: inline-block; margin-top: 2px;
}
.nav-title {
  font-size: 11px; font-weight: 700; color: var(--dim);
  letter-spacing: 0.6px; padding: 8px 8px 6px;
}
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  border: none; background: transparent; cursor: pointer;
  padding: 10px 10px; border-radius: var(--r);
  font: inherit; font-weight: 550; color: var(--muted); text-align: left;
  transition: background 0.14s, color 0.14s;
}
.nav-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav-item .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border-strong); flex-shrink: 0;
}
.nav-item.active .dot { background: var(--brand); }
.side-foot { font-size: 11px; color: var(--dim); padding: 12px 8px 2px; border-top: 1px solid var(--border); }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 26px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.head h1 { font-size: 19px; font-weight: 650; letter-spacing: -0.3px; }
.muted { color: var(--muted); font-size: 13px; margin-top: 3px; }
.badge {
  font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); padding: 4px 9px; border-radius: 999px;
}

/* Content — kalan alanı doldurur, taşarsa iç scroll */
.content { flex: 1; padding: 22px 26px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); padding: 20px;
}

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r);
  padding: 30px 20px; text-align: center; cursor: pointer; outline: none;
  background: var(--surface-alt); transition: border-color 0.16s, background 0.16s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand); background: #fff; }
.dropzone.drag, .dropzone.has-file { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.dz-icon {
  width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 12px;
  display: grid; place-items: center; color: var(--brand);
  background: var(--brand-soft); border: 1px solid rgba(15,118,110,0.14);
}
.dz-title { font-size: 14px; font-weight: 600; }
.dz-hint { margin-top: 3px; font-size: 12.5px; color: var(--dim); }
.link { color: var(--brand); font-weight: 600; }

/* Buttons */
.btn {
  height: 42px; border: none; border-radius: var(--r); padding: 0 18px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s, opacity 0.15s; text-decoration: none;
}
.btn.primary { background: var(--brand); color: #fff; width: 100%; margin-top: 16px; }
.btn.primary.sm { width: auto; height: 36px; margin: 0; }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.spinner {
  display: none; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.65s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading { pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.status { text-align: center; margin-top: 12px; min-height: 16px; font-size: 13px; color: var(--muted); }
.status.error { color: var(--danger); font-weight: 550; }
.status.busy { color: var(--brand); }

/* Result */
.result { display: flex; flex-direction: column; min-height: 0; flex: 1; animation: rise 0.28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.check { width: 34px; height: 34px; border-radius: 50%; background: #d1fae5; color: #065f46; display: grid; place-items: center; flex-shrink: 0; }
.result-head h2 { font-size: 15px; font-weight: 650; }
.result-head > div:nth-child(2) { flex: 1; }

/* Preview table — iç scroll */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r); flex: 1; min-height: 0; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { text-align: left; padding: 7px 10px; white-space: nowrap; border-bottom: 1px solid var(--border); }
th { position: sticky; top: 0; background: var(--brand); color: #fff; font-weight: 600; }
tr:nth-child(even) td { background: var(--surface-alt); }

/* Footer */
.foot {
  padding: 12px 26px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--dim); background: var(--surface);
  display: flex; align-items: center; gap: 8px;
}
.fdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,0.18); }

/* ============================================================
   Tablet / mobil — sidebar üste yatay marka çubuğuna dönüşür,
   sayfa kaydırılabilir olur (masaüstündeki no-scroll sadece geniş ekranda).
   ============================================================ */
@media (max-width: 820px) {
  body { overflow: auto; }
  .shell { flex-direction: column; height: auto; min-height: 100vh; }

  .sidebar {
    width: 100%; flex-direction: column;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    position: sticky; top: 0; z-index: 20;
  }
  .nav-title, .side-foot { display: none; }
  .nav {
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    gap: 8px; margin-top: 12px; padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-item {
    flex-shrink: 0; padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--surface-alt);
    white-space: nowrap;
  }
  .nav-item.active { border-color: var(--brand); background: var(--brand-soft); }

  .main { min-height: 0; }
  .head { padding: 16px 18px; }
  .head h1 { font-size: 17px; }
  .content { padding: 16px 18px; overflow: visible; }

  /* sonuç mobilde sabit yükseklik değil; tablo kendi içinde scroll */
  .result { flex: none; }
  .table-wrap { max-height: 55vh; }
  .btn.primary { height: 46px; } /* dokunma hedefi */
  .dropzone { padding: 26px 16px; }
}

@media (max-width: 480px) {
  :root { font-size: 13.5px; }
  .head { flex-direction: column; gap: 8px; align-items: flex-start; }
  .brand-logo { width: 30px; height: 30px; }
  .result-head { flex-wrap: wrap; }
  .result-head .btn.primary.sm { width: 100%; margin-top: 4px; }
  th, td { padding: 6px 8px; }
}
