/* ATÖLYE PWA — dokunmatik operasyon merkezi.
   Tasarım: masaüstü lacivert/teal kimliği; tablet için büyük dokunma hedefleri,
   yüksek kontrast, hızlı listeler. Boldluk tek yerde: kalıcı kasa/durum başlığı. */
:root {
  --navy: #0f172a; --navy-2: #111c33; --navy-hover: #1e293b;
  --accent: #0ea5a4; --accent-2: #0f766e; --indigo: #4f46e5;
  --gold: #f59e0b; --danger: #dc2626; --ok: #16a34a;
  --bg: #eef2f7; --card: #ffffff; --border: #dbe4ef;
  --text: #0f172a; --muted: #64748b;
  --r: 16px; --tap: 60px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; font-family: var(--font); color: var(--text);
  background: var(--bg); font-size: 18px; overscroll-behavior: none; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
button { cursor: pointer; border: none; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ---- App shell ---- */
#app { display: flex; flex-direction: column; height: 100%; }
.topbar { display: flex; align-items: center; gap: 18px; background: var(--card);
  border-bottom: 1px solid var(--border); padding: 12px 22px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { width: 46px; height: 46px; border-radius: 12px; background: var(--indigo);
  color: #fff; font-weight: 800; font-size: 26px; display: grid; place-items: center; }
.brand b { font-size: 22px; letter-spacing: .5px; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; }
.topbar .spacer { flex: 1; }
.cashpill { display: flex; flex-direction: column; align-items: flex-end;
  background: #ecfdf5; color: #065f46; padding: 8px 18px; border-radius: 12px; }
.cashpill.neg { background: #fef2f2; color: #991b1b; }
.cashpill span { font-size: 11px; font-weight: 700; letter-spacing: 1px; opacity: .8; }
.cashpill b { font-size: 22px; }
.userchip { background: #ecfdf5; color: #047857; padding: 10px 16px; border-radius: 12px;
  font-weight: 700; display: flex; align-items: center; gap: 10px; }
.userchip.locked { background: #e2e8f0; color: #475569; }
.netdot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); }
.netdot.off { background: var(--danger); }
.iconbtn { background: #f1f5f9; color: #334155; border-radius: 12px; padding: 12px 16px;
  font-weight: 700; min-height: 48px; }
.iconbtn:active { background: #e2e8f0; }

/* ---- Layout ---- */
.body { display: flex; flex: 1; min-height: 0; }
.rail { width: 260px; background: var(--navy); color: #cbd5e1; padding: 14px 12px;
  overflow-y: auto; flex-shrink: 0; }
.railgroup { color: #64748b; font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
  padding: 16px 14px 6px; }
.railbtn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: transparent; color: #cbd5e1; border-radius: 12px; padding: 15px 16px;
  min-height: var(--tap); font-weight: 600; font-size: 17px; }
.railbtn:active { background: var(--navy-hover); }
.railbtn.active { background: var(--accent); color: #fff; }
.railbtn.locked::after { content: "•"; color: var(--gold); margin-left: auto; font-size: 22px; }
.content { flex: 1; overflow-y: auto; padding: 22px 26px 120px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 30px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .spacer { flex: 1; }

/* ---- Cards / KPIs ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.kpi b { display: block; font-size: 40px; line-height: 1.1; margin-top: 6px; }
.kpi.alert b { color: var(--danger); }
.kpi.accent b { color: var(--accent-2); }

/* ---- Toolbar / search ---- */
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search { flex: 1; min-width: 240px; }
.search input { width: 100%; height: 56px; border: 2px solid var(--border); border-radius: 14px;
  padding: 0 18px; background: #fff; }
.search input:focus { outline: none; border-color: var(--accent); }
.btn { min-height: 56px; padding: 0 22px; border-radius: 14px; font-weight: 700; font-size: 17px;
  display: inline-flex; align-items: center; gap: 8px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-2); }
.btn.ghost { background: #f1f5f9; color: #334155; }
.btn.danger { background: #fef2f2; color: var(--danger); }
.btn.gold { background: #fffbeb; color: #92400e; }
.btn:disabled { opacity: .5; }

/* ---- Table ---- */
.tablewrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; background: #f8fafc; color: var(--muted); font-size: 13px;
  letter-spacing: .5px; padding: 14px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; }
td { padding: 16px 18px; border-bottom: 1px solid #eef2f7; font-size: 17px; }
tr:last-child td { border-bottom: none; }
tr:active td { background: #f1f5f9; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.thumb { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: #f1f5f9;
  border: 1px solid var(--border); }
.rowbtns { display: flex; gap: 8px; }
.rowbtns .btn { min-height: 44px; padding: 0 14px; font-size: 15px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 48px; margin-bottom: 8px; }

/* ---- Modal ---- */
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid;
  place-items: center; z-index: 60; padding: 24px; }
.modal { background: #fff; border-radius: 22px; width: min(640px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden; }
.modal h2 { margin: 0; padding: 22px 26px; font-size: 24px; border-bottom: 1px solid var(--border); }
.modal .form { padding: 22px 26px; overflow-y: auto; display: grid; gap: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 8px; color: #334155; }
.field input, .field select, .field textarea { width: 100%; min-height: 56px;
  border: 2px solid var(--border); border-radius: 14px; padding: 14px 16px; background: #fff; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none;
  border-color: var(--accent); }
.modal .foot { display: flex; gap: 12px; padding: 20px 26px; border-top: 1px solid var(--border); }
.modal .foot .btn { flex: 1; justify-content: center; }
.formerr { background: #fef2f2; color: #991b1b; padding: 12px 16px; border-radius: 12px;
  font-weight: 600; }

/* ---- Login / setup ---- */
.gate { position: fixed; inset: 0; background: var(--navy); display: grid; place-items: center;
  z-index: 80; }
.gate .box { background: #fff; border-radius: 24px; padding: 34px; width: min(460px, 94vw); }
.gate h2 { margin: 0 0 6px; font-size: 26px; }
.gate p { margin: 0 0 22px; color: var(--muted); }
.pinrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px; }
.pinkey { height: 78px; border-radius: 16px; background: #f1f5f9; font-size: 30px; font-weight: 700; }
.pinkey:active { background: #e2e8f0; }
.pinkey.zero { grid-column: 2; }
.pindisplay { height: 64px; border: 2px solid var(--border); border-radius: 16px;
  display: grid; place-items: center; font-size: 34px; letter-spacing: 12px; margin-bottom: 16px; }

/* ---- Photo fullscreen ---- */
.lightbox { position: fixed; inset: 0; background: rgba(3,7,18,.94); z-index: 90;
  display: grid; place-items: center; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 12px; }

/* ---- Toast ---- */
#toasts { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { background: var(--navy); color: #fff; padding: 16px 24px; border-radius: 14px;
  font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.err { background: var(--danger); }
.toast.info { background: var(--indigo); }

/* ---- Sync banner ---- */
.syncbar { background: var(--gold); color: #442c00; padding: 12px 22px; font-weight: 700;
  display: flex; align-items: center; gap: 12px; }
.syncbar.off { background: #fee2e2; color: #7f1d1d; }

/* ---- Large tablet: 2800x1840 @ tipik DPR => geniş içerik ---- */
@media (min-width: 1400px) {
  html, body { font-size: 20px; }
  .rail { width: 300px; }
  .content { padding: 28px 40px 140px; }
  .kpi b { font-size: 46px; }
}
/* ---- Dar / telefon ---- */
@media (max-width: 900px) {
  .rail { position: fixed; left: 0; top: 78px; bottom: 0; width: 82%; max-width: 320px;
    transform: translateX(-105%); transition: transform .2s; z-index: 50; box-shadow: 4px 0 24px rgba(0,0,0,.2); }
  .rail.open { transform: none; }
  .content { padding: 18px 16px 120px; }
  .cashpill { display: none; }
  .hamburger { display: inline-flex !important; }
}
.hamburger { display: none; }
