:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --text: #e8eef7;
  --muted: #9aa8bc;
  --accent: #3d9cf5;
  --accent2: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(160deg, #0b1020, #0f1419 40%, #121a28);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.auth-body { display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: min(420px, 100%); }
.card {
  background: var(--surface);
  border: 1px solid #2a3a52;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
h1 { margin: 0 0 12px; font-size: 1.35rem; }
h2 { margin: 0 0 14px; font-size: 1.15rem; }
.muted { color: var(--muted); font-size: .92rem; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15,20,25,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #2a3a52;
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
}
.brand { font-weight: 700; color: var(--text); }
.nav-links { display: flex; gap: 14px; flex-wrap: wrap; }
.nav-links a { color: var(--text); opacity: .9; }
.nav-links a:hover { opacity: 1; text-decoration: none; color: var(--accent); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.main-wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.footer { text-align: center; padding: 24px; color: var(--muted); font-size: .85rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; color: #0b1020; background: var(--accent);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn-primary { background: var(--accent); color: #061018; }
.btn-success { background: var(--accent2); color: #041208; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #1a1204; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid #3a4d6a; }
.btn-sm { padding: 6px 10px; font-size: .88rem; border-radius: 8px; }
.btn-block { width: 100%; }

.form-grid { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #334560; background: #121a28; color: var(--text);
}
textarea { min-height: 80px; resize: vertical; }

.alert { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: .92rem; }
.alert-error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.35); }
.alert-success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.35); }

.grid-tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.table-tile {
  border-radius: 14px; padding: 14px; text-align: center; font-weight: 700;
  border: 1px solid #2f415e; background: var(--surface2); color: var(--text);
  cursor: pointer; text-decoration: none; display: block;
  transition: transform .08s ease, border-color .15s;
}
.table-tile:hover { transform: translateY(-1px); border-color: var(--accent); text-decoration: none; }
.table-tile.bos { background: #152232; border-color: #2c5577; }
.table-tile.dolu { background: #1b3a2d; border-color: #2f7d55; }
.table-tile .sub { font-size: .78rem; font-weight: 500; color: var(--muted); margin-top: 6px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) {
  .split-2 { grid-template-columns: 1.1fr .9fr; }
}

.panel { background: var(--surface); border: 1px solid #2a3a52; border-radius: var(--radius); padding: 14px; }
.panel + .panel { margin-top: 12px; }

.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cat-tab {
  padding: 8px 12px; border-radius: 999px; border: 1px solid #334560;
  background: #121a28; color: var(--text); font-size: .9rem; cursor: pointer; text-decoration: none;
}
.cat-tab.active { border-color: var(--accent); background: rgba(61,156,245,.12); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.product-card {
  border: 1px solid #334560; border-radius: 12px; padding: 10px; background: #121a28;
  text-align: left; cursor: pointer; color: inherit; font: inherit;
}
.product-card:hover { border-color: var(--accent); }
.product-card img { width: 100%; height: 88px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: #0b1020; }
.product-card .p-name { font-weight: 600; font-size: .95rem; }
.product-card .p-price { color: var(--muted); font-size: .85rem; margin-top: 4px; }

.lines { width: 100%; border-collapse: collapse; font-size: .92rem; }
.lines th, .lines td { padding: 8px 6px; border-bottom: 1px solid #2a3a52; text-align: left; vertical-align: top; }
.lines th { color: var(--muted); font-weight: 600; font-size: .8rem; }

.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.table-plain { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-plain th, .table-plain td { padding: 8px; border-bottom: 1px solid #2a3a52; text-align: left; }
.table-plain th { color: var(--muted); }

.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px; }
.stat-box { padding: 12px; border-radius: 12px; border: 1px solid #334560; background: #121a28; }
.stat-box .v { font-size: 1.25rem; font-weight: 800; }
.stat-box .k { color: var(--muted); font-size: .82rem; }

.receipt {
  max-width: 360px; margin: 0 auto; background: #fff; color: #111; padding: 16px; border-radius: 8px;
}
.receipt h2 { color: #111; }
.receipt .small { font-size: .85rem; color: #444; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #111; }
  .receipt { box-shadow: none; }
}
