:root {
    --bg: #f5f6fa; --bg-glow: rgba(99, 102, 241, .10);
    --surface: #ffffff; --surface-2: #f8f9fc; --line: #e6e8f0; --line-strong: #d3d7e3;
    --text: #151827; --text-2: #4a5068; --muted: #858aa3;
    --accent: #5b5bd6; --accent-2: #7c6cf2; --accent-soft: #eeeefc; --on-accent: #ffffff;
    --ok: #16a34a; --ok-soft: #e8f7ee; --warn: #b7791f; --warn-soft: #fdf5e6;
    --err: #dc2626; --err-soft: #fdecec;
    --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 8px 24px rgba(20, 24, 40, .06);
    --shadow-lg: 0 2px 4px rgba(20, 24, 40, .04), 0 18px 48px rgba(20, 24, 40, .10);
    --r: 14px;
  }
  :root[data-theme="dark"] {
    --bg: #0e1016; --bg-glow: rgba(124, 108, 242, .14);
    --surface: #161922; --surface-2: #1c202b; --line: #262b38; --line-strong: #343a4a;
    --text: #eceef4; --text-2: #b4b9cb; --muted: #7d8399;
    --accent: #8b87ff; --accent-2: #a594ff; --accent-soft: #232347; --on-accent: #0e1016;
    --ok: #4ade80; --ok-soft: #13291d; --warn: #f2c063; --warn-soft: #2d2513;
    --err: #f87171; --err-soft: #2e1717;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 48px rgba(0, 0, 0, .4);
  }
  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
    background-image: radial-gradient(1200px 500px at 85% -10%, var(--bg-glow), transparent 60%),
                      radial-gradient(900px 400px at -10% 10%, var(--bg-glow), transparent 60%);
    background-attachment: fixed;
    font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none;
          stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  button { font: inherit; color: inherit; }
  .num { font-variant-numeric: tabular-nums; }

  /* ---------- Üst bar ---------- */
  .topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(12px);
            background: color-mix(in srgb, var(--bg) 75%, transparent); border-bottom: 1px solid var(--line); }
  .topbar-in { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
  .logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
          background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 14px rgba(91, 91, 214, .35); }
  .brand b { display: block; font-size: 15px; line-height: 1.2; }
  .brand span { font-size: 12px; color: var(--muted); }
  .spacer { flex: 1; }
  .icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
              background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
  .icon-btn:hover { border-color: var(--line-strong); color: var(--text); }

  main { max-width: 1080px; margin: 0 auto; padding: 28px 16px 80px; }

  /* ---------- Adımlar ---------- */
  .stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; }
  .step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
          background: var(--surface); border: 1px solid var(--line); color: var(--muted); min-width: 0;
          transition: all .2s; }
  .step .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
               font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
  .step .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .step .t small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
  .step.active { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .step.active .dot { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .step.done { color: var(--text-2); cursor: pointer; }
  .step.done:hover { border-color: var(--line-strong); }
  .step.done .dot { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
  @media (max-width: 640px) { .step .t small { display: none; } .step { padding: 8px 10px; } }

  /* ---------- Panel ---------- */
  .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
           padding: 28px; animation: rise .35s ease; }
  .panel[hidden] { display: none; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .panel-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
  .panel-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
  .panel-head p { margin: 4px 0 0; color: var(--text-2); }
  .panel-foot { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding-top: 20px;
                border-top: 1px solid var(--line); flex-wrap: wrap; }
  @media (max-width: 640px) { .panel { padding: 20px 16px; border-radius: 14px; } }

  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
         border-radius: 11px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer;
         text-decoration: none; transition: transform .05s, box-shadow .2s, background .2s, opacity .2s; white-space: nowrap; }
  .btn:active { transform: translateY(1px); }
  .btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
                 box-shadow: 0 6px 18px rgba(91, 91, 214, .30); }
  :root[data-theme="dark"] .btn-primary { color: #0e1016; }
  .btn-primary:hover { box-shadow: 0 8px 24px rgba(91, 91, 214, .42); }
  .btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
  .btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
  .btn-ghost:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
  .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
          animation: sp .7s linear infinite; }
  @keyframes sp { to { transform: rotate(360deg); } }

  .badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
           font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
  .badge.ok { background: var(--ok-soft); color: var(--ok); }
  .badge.warn { background: var(--warn-soft); color: var(--warn); }
  .badge svg.i { width: 14px; height: 14px; }

  /* ---------- 1: Yükleme ---------- */
  .drops { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 720px) { .drops { grid-template-columns: 1fr; } }
  .drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
          text-align: center; gap: 10px; min-height: 220px; padding: 24px; border-radius: var(--r);
          border: 2px dashed var(--line-strong); background: var(--surface-2); cursor: pointer;
          transition: border-color .2s, background .2s, transform .2s; }
  .drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
  .drop.over { transform: scale(1.01); }
  .drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
  .drop .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
               background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
  .drop .ico svg.i { width: 26px; height: 26px; }
  .drop h3 { margin: 4px 0 0; font-size: 16px; }
  .drop p { margin: 0; font-size: 13px; color: var(--muted); }
  .drop .tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
  .drop.filled { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
  .drop.filled .ico { color: var(--ok); }
  .drop .fname { font-weight: 600; font-size: 14px; word-break: break-all; color: var(--text); }
  .drop .change { font-size: 12px; color: var(--accent); font-weight: 600; }
  .tips { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: 13px; }
  .tips span { display: inline-flex; align-items: center; gap: 6px; }
  .tips svg.i { width: 15px; height: 15px; color: var(--ok); }

  /* ---------- 2: Eşleme ---------- */
  .progress-pill { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
  .bar { width: 120px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
  .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2));
           border-radius: 99px; transition: width .3s; }
  .map-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
  @media (max-width: 860px) { .map-grid { grid-template-columns: 1fr; } }
  .group { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; background: var(--surface-2); }
  .group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .group-head .gi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
                    background: var(--surface); color: var(--accent); border: 1px solid var(--line); }
  .group-head b { display: block; font-size: 14px; }
  .group-head small { color: var(--muted); font-size: 12px; display: block; max-width: 240px;
                      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .fields.one { grid-template-columns: 1fr; }
  @media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
  .fcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
           transition: border-color .2s, box-shadow .2s; }
  .fcard.wide { grid-column: 1 / -1; }
  .fcard.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
  .fcard.missing { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
  .fcard label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
  .fcard .st { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
  .fcard.ok .st { background: var(--ok-soft); color: var(--ok); }
  .fcard.missing .st { background: var(--warn-soft); color: var(--warn); }
  .fcard .st svg.i { width: 12px; height: 12px; stroke-width: 3; }
  .fcard .help { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
  select { width: 100%; height: 40px; padding: 0 36px 0 12px; border-radius: 10px; border: 1px solid var(--line-strong);
           background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23858aa3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center;
           color: var(--text); font: inherit; font-size: 14px; appearance: none; cursor: pointer; }
  select:focus, .search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
          border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; font-size: 13px;
          font-weight: 500; color: var(--text-2); transition: all .15s; user-select: none; }
  .chip:hover { border-color: var(--accent); color: var(--text); }
  .chip svg.i { width: 14px; height: 14px; display: none; stroke-width: 3; }
  .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  :root:not([data-theme="dark"]) .chip[aria-pressed="true"] { color: #fff; }
  .chip[aria-pressed="true"] svg.i { display: block; }
  .hint-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft);
              color: var(--text-2); font-size: 13px; margin-top: 14px; }
  .hint-box svg.i { color: var(--accent); margin-top: 1px; }

  /* ---------- 3: Sonuç ---------- */
  .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  @media (max-width: 860px) { .kpis { grid-template-columns: 1fr 1fr; } }
  .kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface-2); }
  .kpi .k-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
  .kpi .k-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
                background: var(--surface); border: 1px solid var(--line); color: var(--accent); }
  .kpi .k-ico svg.i { width: 15px; height: 15px; }
  .kpi.good .k-ico { color: var(--ok); } .kpi.bad .k-ico { color: var(--warn); }
  .kpi b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; }
  .kpi .sub { font-size: 12px; color: var(--muted); }
  .rate { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
  .rate-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
  .rate-top b { color: var(--text); }
  .rate .bar { width: 100%; height: 10px; }
  .rate .bar i { background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, var(--accent))); }
  .totals { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--text-2); }
  .totals b { color: var(--text); }

  .callout { margin-top: 14px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
             background: var(--warn-soft); overflow: hidden; }
  .callout summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
                     cursor: pointer; font-size: 14px; font-weight: 600; color: var(--warn); }
  .callout summary::-webkit-details-marker { display: none; }
  .callout summary .chev { margin-left: auto; transition: transform .2s; }
  .callout[open] summary .chev { transform: rotate(180deg); }
  .callout .body { padding: 0 16px 14px; }
  .callout .codes { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; }
  .callout code { font: 500 12px/1 ui-monospace, Consolas, monospace; padding: 5px 8px; border-radius: 6px;
                  background: var(--surface); border: 1px solid var(--line); color: var(--text); }
  .linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 13px;
             cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; }

  .section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
                   margin: 28px 0 12px; display: flex; align-items: center; gap: 12px; }
  .dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  @media (max-width: 860px) { .dl-grid { grid-template-columns: 1fr; } }
  .dl { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line);
        background: var(--surface); text-decoration: none; color: inherit; transition: border-color .2s, box-shadow .2s, transform .2s; }
  .dl:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
  .dl .xl { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none;
            background: #e7f6ec; color: #16803c; font-weight: 700; font-size: 11px; }
  :root[data-theme="dark"] .dl .xl { background: #14301f; color: #4ade80; }
  .dl b { display: block; font-size: 14px; }
  .dl small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
  .dl .go { margin-left: auto; color: var(--muted); }
  .dl:hover .go { color: var(--accent); }

  .table-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
  .search { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
  .search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
  .search input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid var(--line-strong);
                  background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
  .count { font-size: 13px; color: var(--muted); }
  .tablewrap { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: 460px; }
  table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
  th, td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
  th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-weight: 600; font-size: 12px;
       color: var(--text-2); cursor: pointer; user-select: none; }
  th:hover { color: var(--text); }
  th .arr { opacity: .4; margin-left: 4px; }
  th.sorted .arr { opacity: 1; color: var(--accent); }
  td.n, th.n { text-align: right; }
  tbody tr:hover td { background: var(--surface-2); }
  tbody tr:last-child td { border-bottom: 0; }
  td.empty { text-align: center; color: var(--muted); padding: 32px; }

  /* ---------- Bildirim ---------- */
  .toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
           display: flex; align-items: flex-start; gap: 10px; max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px;
           border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
           font-size: 14px; z-index: 50; transition: all .25s; }
  .toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
  .toast.err svg.i { color: var(--err); } .toast.ok svg.i { color: var(--ok); }
  .overlay { position: absolute; inset: 0; border-radius: inherit; display: none; place-items: center; z-index: 5;
             background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(2px); }
  .overlay.show { display: grid; }
  .overlay div { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--accent); }
  .overlay .spin { width: 22px; height: 22px; border-width: 3px; }

  /* ---------- Aylık kullanım ---------- */
  .usage { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 10px;
           border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--text-2); }
  .usage b { color: var(--text); font-weight: 600; }
  .usage .bar { width: 64px; height: 5px; }
  .usage .bar i { background: var(--accent); }
  .usage.low { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
  .usage.low .bar i { background: var(--warn); }
  .usage.out { border-color: color-mix(in srgb, var(--err) 50%, var(--line)); color: var(--err); }
  .usage.out .bar i { background: var(--err); }
  @media (max-width: 640px) { .usage .bar, .usage .lbl { display: none; } .brand span { display: none; } }
  .limit-banner { display: none; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r);
                  margin-bottom: 18px; background: var(--err-soft); color: var(--err); font-size: 14px;
                  border: 1px solid color-mix(in srgb, var(--err) 30%, var(--line)); }
  .limit-banner.show { display: flex; }
  .limit-banner b { display: block; }
  .limit-banner span { color: var(--text-2); }
  .drops.locked { opacity: .45; pointer-events: none; filter: grayscale(.4); }
  form.inline { margin: 0; }

  /* ---------- Giriş sayfası ---------- */
  .login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
  .login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
                border-radius: 20px; box-shadow: var(--shadow-lg); padding: 36px 32px 28px; animation: rise .35s ease; }
  .login-card .logo { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 20px; }
  .login-card .logo svg.i { width: 24px; height: 24px; }
  .login-card h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.01em; }
  .login-card p.lead { margin: 0 0 24px; color: var(--text-2); }
  .login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
  .pw { position: relative; }
  .pw input { width: 100%; height: 46px; padding: 0 46px 0 14px; border-radius: 12px; border: 1px solid var(--line-strong);
              background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; }
  .pw input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
               border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
  .pw button:hover { color: var(--text); background: var(--surface); }
  .login-card .btn { width: 100%; height: 46px; margin-top: 16px; font-size: 15px; }
  .login-err { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; margin-bottom: 16px;
               background: var(--err-soft); color: var(--err); font-size: 13.5px; }
  .login-err svg.i { width: 16px; height: 16px; margin-top: 2px; }
  .login-foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--muted); }
  .login-theme { position: fixed; top: 16px; right: 16px; }
