:root {
    --bg: #0f1412;
    --bg-2: #17201c;
    --panel: #1c2722;
    --line: #2d3c35;
    --text: #e8f0eb;
    --muted: #8fa399;
    --accent: #3dd68c;
    --accent-2: #f0b429;
    --danger: #f07178;
    --info: #5eb0ef;
    --ok: #3dd68c;
    --radius: 14px;
    --shadow: 0 18px 40px rgba(0, 0, 0, .35);
    --font: "DM Sans", system-ui, sans-serif;
    --display: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(61, 214, 140, .12), transparent 50%),
        radial-gradient(900px 500px at 100% 0%, rgba(240, 180, 41, .08), transparent 45%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
    background: linear-gradient(180deg, #15201b, #101714);
    border-right: 1px solid var(--line);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #1f8f5f);
    color: #062016; display: grid; place-items: center;
    font-weight: 700; font-size: 1.2rem;
}
.brand strong { display: block; }
.brand small { color: var(--muted); }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sidebar nav a {
    color: var(--text); padding: 10px 12px; border-radius: 10px;
    text-decoration: none; border: 1px solid transparent;
}
.sidebar nav a:hover { background: rgba(61,214,140,.08); border-color: var(--line); }
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; }
.user-chip { padding: 10px 12px; background: var(--panel); border-radius: 10px; border: 1px solid var(--line); }
.user-chip strong { display: block; font-size: .95rem; }
.user-chip span { color: var(--muted); font-size: .8rem; }

.content { padding: 28px; }
.page-head h1 {
    margin: 0 0 22px;
    font-family: var(--display);
    font-weight: 400;
    font-size: 2.2rem;
}

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat, .card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.stat span { color: var(--muted); font-size: .85rem; }
.stat strong { display: block; margin-top: 8px; font-size: 1.6rem; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: .92rem; }
th { color: var(--muted); font-weight: 500; }

.badge {
    display: inline-flex; align-items: center; padding: 4px 10px;
    border-radius: 999px; font-size: .78rem; font-weight: 600;
}
.badge-warn { background: rgba(240,180,41,.15); color: #f0b429; }
.badge-info { background: rgba(94,176,239,.15); color: #5eb0ef; }
.badge-ok { background: rgba(61,214,140,.15); color: #3dd68c; }
.badge-danger { background: rgba(240,113,120,.15); color: #f07178; }
.badge-muted { background: rgba(143,163,153,.15); color: var(--muted); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: 10px; padding: 10px 14px; cursor: pointer;
    font: inherit; font-weight: 600; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #062016; }
.btn-primary:hover { filter: brightness(1.05); text-decoration: none; }
.btn-secondary { background: #2a3a32; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(240,113,120,.18); color: #f07178; border: 1px solid rgba(240,113,120,.35); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-sm { padding: 7px 10px; font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.form { display: grid; gap: 14px; max-width: 520px; }
.form-row { display: grid; gap: 6px; }
.form-row label { color: var(--muted); font-size: .85rem; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; background: var(--bg-2); color: var(--text);
    border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.form-inline .form-row { flex: 1; min-width: 160px; }

.alert {
    padding: 12px 14px; border-radius: 10px; margin-bottom: 16px;
    border: 1px solid var(--line);
}
.alert-success { background: rgba(61,214,140,.12); color: #9ff0c4; }
.alert-error { background: rgba(240,113,120,.12); color: #ffb4b8; }
.alert-info { background: rgba(94,176,239,.12); color: #b7ddff; }

.login-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
    width: min(420px, 100%);
    background: rgba(28,39,34,.92);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}
.login-card h1 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 2.4rem;
    margin: 0 0 8px;
}
.login-card p { color: var(--muted); margin: 0 0 24px; }
.hint {
    margin-top: 18px; padding: 12px; border-radius: 10px;
    background: rgba(255,255,255,.03); border: 1px dashed var(--line);
    color: var(--muted); font-size: .85rem;
}

.map-box {
    height: 420px; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--line); background: #101714;
}
.scan-box {
    background: var(--bg-2); border: 1px dashed var(--line);
    border-radius: var(--radius); padding: 20px; text-align: center;
}
.scan-box video, .scan-box canvas { width: 100%; max-width: 420px; border-radius: 12px; background: #000; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
    .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .content { padding: 18px; }
    .grid-4, .grid-2 { grid-template-columns: 1fr; }
}

/* Saha mobil kabuk */
.saha-shell {
    display: block;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f4f7f5 0%, #e8eee9 100%);
    color: #1a2420;
    position: relative;
}
.panel-saha {
    background: #dfe8e2;
}
.saha-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 8px;
    gap: 10px;
}
.saha-top strong { display: block; font-size: .95rem; }
.saha-top small { color: #6b7c74; }
.saha-content {
    padding: 8px 14px 96px !important;
}
.saha-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.saha-head h1 {
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #24302b;
}
.icon-btn {
    border: 1px solid #c9d6cf;
    background: #fff;
    border-radius: 8px;
    width: 36px; height: 36px;
    cursor: pointer;
}
.saha-bottom {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: min(480px, 100%);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #fff;
    border-top: 1px solid #d5e0da;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 50;
}
.saha-bottom a {
    text-align: center;
    color: #7a8b83;
    font-size: .72rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 2px;
}
.saha-bottom a.active { color: #1f8f5f; }
.tx-card {
    background: #fff;
    border: 1px solid #d7e2dc;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(20,40,30,.06);
}
.tx-card .row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}
.amount-pill {
    background: #e7f8ef;
    color: #147a4b;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
}
.empty-state {
    text-align: center;
    padding: 36px 16px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #d7e2dc;
}
.empty-state .dot {
    width: 54px; height: 54px; margin: 0 auto 12px;
    border-radius: 50%;
    background: #ff5ea0;
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: 1.3rem;
}
.modal-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: none; align-items: center; justify-content: center;
    z-index: 80; padding: 16px;
}
.modal-bg.open { display: flex; }
.modal {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    color: #1a2420;
}
.modal h3 { margin: 0 0 12px; }
.modal .kv { margin: 8px 0; font-size: .92rem; }
.modal .kv span { color: #6b7c74; display: inline-block; min-width: 100px; }

/* Müşteri yatırım sayfası */
.customer-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 20% 0%, rgba(61,214,140,.18), transparent 50%),
        var(--bg);
}
.customer-card {
    width: min(460px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow);
}
.customer-card h1 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 2.2rem;
    margin: 0 0 6px;
}

/* Saha — referans UI */
.saha-top-btns { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 10px; border-radius: 8px; font-size: .72rem; font-weight: 700;
  text-decoration: none; color: #fff; border: none;
}
.pill-purple { background: #7b5cff; color:#fff; }
.pill-green { background: #3dba6f; color:#fff; }
.pill-pink { background: #ff4f8b; color:#fff; }
.btn-purple {
  background: #6f42c1; color: #fff; border: none;
  border-radius: 10px; padding: 12px 14px; font-weight: 700; width: 100%;
}
.btn-purple:hover { filter: brightness(1.05); text-decoration: none; color:#fff; }
.ref-card {
  background: #fff; border: 1px solid #dde5e0; border-radius: 12px;
  padding: 14px; margin-bottom: 14px;
}
.ref-card-top { display:flex; gap:10px; align-items:flex-start; }
.ref-qr-ico {
  width: 36px; height: 36px; border-radius: 8px; background:#f3f0ff;
  display:grid; place-items:center; color:#6f42c1; font-weight:700; flex-shrink:0;
}
.ref-amount {
  margin-left:auto; background:#e8f8ef; color:#1a7a45;
  font-weight:700; padding:6px 10px; border-radius:8px; white-space:nowrap;
}
.ref-atm { color:#1a7a45; font-weight:600; margin-top:8px; font-size:.9rem; }
.ref-status { color:#666; margin-top:6px; font-size:.9rem; }
.ref-status.ok { color:#1a7a45; font-weight:700; }
.ref-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.ref-actions-3 { grid-template-columns:1fr 1fr; }
.modal.ref-modal { max-width: 420px; }
.modal .strip {
  padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-size: .92rem; font-weight: 600;
}
.strip-green { background:#dff7e8; color:#146c3c; }
.strip-pink { background:#ffe0ea; color:#b01048; }
.strip-purple { background:#efe8ff; color:#4b2fa0; }
.ask-btns { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-top:12px; }
.qr-modal-frame {
  width: min(280px, 100%); aspect-ratio: 1; margin: 12px auto; background:#111;
  border-radius: 12px; overflow:hidden; position:relative;
}
.qr-modal-frame #readerLive { width:100% !important; }
.spin-center {
  width: 42px; height: 42px; margin: 16px auto;
  border: 3px solid #ddd; border-top-color:#6f42c1; border-radius:50%;
  animation: spin 1s linear infinite;
}
.link-kapat {
  display:block; text-align:center; margin-top:14px; color:#333; font-weight:700;
  background:none; border:none; width:100%; padding:10px; cursor:pointer;
}
