:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --ink: #1b2433;
  --muted: #6b7686;
  --line: #e3e7ee;
  --brand: #1b2433;
  --accent: #f5a623;
  --accent-ink: #1b2433;
  --danger: #c62828;
  --ok: #2e7d32;
  --radius: 10px;
  --side: 232px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.boot { text-align: center; margin-top: 30vh; color: var(--muted); }
h1 { font-size: 1.35rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 18px; }

/* ---- Giris ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--brand); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 14px; padding: 28px 24px; }
.login-card .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 700; font-size: 1.15rem; }
.login-card .logo img { width: 40px; height: 40px; border-radius: 9px; }

/* ---- Form ---- */
label { display: block; font-size: .85rem; font-weight: 600; margin: 14px 0 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: inherit; background: #fff;
  border: 1px solid #cfd6e1; border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
.field-err { color: var(--danger); font-size: .8rem; margin-top: 4px; }
.form-err { color: var(--danger); margin: 12px 0 0; font-size: .9rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px;
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.block { width: 100%; margin-top: 20px; padding: 11px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.small { padding: 5px 10px; font-size: .85rem; }

/* ---- Kabuk ---- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #cfd6e4; padding: 16px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; padding: 4px 8px 16px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav a {
  display: block; padding: 10px 12px; margin-bottom: 2px; border-radius: 8px;
  color: inherit; text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, .08); }
.nav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav a .tag { float: right; font-size: .68rem; opacity: .7; margin-top: 3px; }
.side .who { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .85rem; }
.side .who strong { color: #fff; display: block; }
.side .who button { margin-top: 8px; width: 100%; background: transparent; color: #cfd6e4; border: 1px solid rgba(255, 255, 255, .25); padding: 7px; border-radius: 8px; cursor: pointer; font: inherit; }
.main { padding: 22px 26px 40px; min-width: 0; }
.topbar { display: none; }

/* ---- Kartlar, tablo ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card .k { color: var(--muted); font-size: .82rem; }
.card .v { font-size: 1.6rem; font-weight: 700; margin-top: 4px; }
.card .v.soon { font-size: 1rem; color: var(--muted); font-weight: 500; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 320px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfd; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.pos { color: var(--danger); font-weight: 600; }
td.zero { color: var(--muted); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: var(--muted); font-size: .88rem; }
.pager .btns { display: flex; gap: 8px; }

/* ---- Modal ve bildirim ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 20, 30, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 12px; padding: 20px 22px; }
.modal .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none;
  transition: .25s; z-index: 80; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

/* ---- Mobil ---- */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 20, 30, .45); z-index: 30; display: none; }
  .scrim.show { display: block; }
  .topbar { display: flex; align-items: center; gap: 12px; background: var(--brand); color: #fff; padding: 10px 14px; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: transparent; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 2px 6px; }
  .main { padding: 16px 14px 40px; }
  .modal .row2 { grid-template-columns: 1fr; }
}
