/* ============================================================
   Lapitek Yönetim Paneli — "Kaptan Köşkü" tasarım dili
   Derin mürekkep + teal; pirinç yalnızca ince vurgularda.
   Sayılar IBM Plex Mono ile enstrüman göstergesi gibi okunur.
   ============================================================ */
:root {
  /* Palet */
  --ink: #0b1f28;        /* derin deniz — metin & koyu yüzeyler */
  --ink-2: #10303d;      /* sidebar üst tonu */
  --teal: #0e7c86;       /* marka birincil */
  --crest: #16c0c9;      /* köpük — ikincil vurgu */
  --brass: #c9a227;      /* pirinç — yalnız ince vurgular */
  --mist: #eef2f1;       /* sayfa zemini (serin sis) */
  --card: #ffffff;
  --text: #12262e;
  --muted: #64797f;
  --line: #dde6e4;
  --ok: #14807a;
  --warn: #d98a1f;
  --bad: #bf3f3c;
  --info: #2f7fb2;
  --violet: #6f5aa8;

  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 31, 40, 0.05), 0 8px 24px rgba(11, 31, 40, 0.06);

  --f-disp: "Barlow Semi Condensed", sans-serif;
  --f-body: "IBM Plex Sans", sans-serif;
  --f-mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-color: #b9c8c5 transparent; }
body {
  font-family: var(--f-body);
  background: var(--mist);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); font-size: 13px; margin: 6px 0; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

svg.ico { width: 18px; height: 18px; flex: none; }

:focus-visible {
  outline: 2px solid var(--crest);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Giriş ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1.3px) 0 0/16px 16px,
    linear-gradient(165deg, #071820 0%, var(--ink-2) 70%, #0d4a54 130%);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 42px 36px 34px;
  width: 372px;
  max-width: 100%;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--brass);
}
.login-logo svg { width: 30px; height: 30px; }
.login-brand {
  font-family: var(--f-disp);
  font-weight: 700; font-size: 26px; letter-spacing: 0.14em;
  color: var(--ink);
}
.login-sub { color: var(--muted); font-size: 13px; margin: 4px 0 24px; }
.login-card input {
  width: 100%; padding: 13px 14px; margin-bottom: 12px;
  border: 1px solid var(--line); background: #f7faf9;
  border-radius: var(--r-md); font-size: 14px; outline: none;
  transition: border-color 0.15s;
}
.login-card input:focus { border-color: var(--teal); }

/* ---------- Yerleşim ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  background:
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.3px) 0 0/16px 16px,
    linear-gradient(180deg, #071820, var(--ink-2));
  color: #fff;
  padding: 20px 12px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}
.brand-ico {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201, 162, 39, 0.14);
  color: var(--brass);
}
.brand-ico svg { width: 20px; height: 20px; }
.brand-txt b {
  font-family: var(--f-disp);
  font-size: 17px; font-weight: 700; letter-spacing: 0.14em;
  display: block; line-height: 1.1;
}
.brand-txt small {
  font-size: 10.5px; color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.08em; text-transform: uppercase;
}

.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  padding: 11px 12px 11px 16px;
  border-radius: var(--r-sm);
  font-weight: 500; font-size: 13.5px; letter-spacing: 0.01em;
  transition: color 0.15s, background 0.15s;
}
.sidebar nav a svg.ico { opacity: 0.75; }
.sidebar nav a::before {
  /* pusula çentiği — aktif sekmede pirinç */
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 3px; height: 0; transform: translateY(-50%);
  background: var(--brass); border-radius: 2px;
  transition: height 0.18s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar nav a.active {
  background: rgba(22, 192, 201, 0.12);
  color: #fff;
}
.sidebar nav a.active::before { height: 18px; }
.sidebar nav a.active svg.ico { opacity: 1; color: var(--crest); }

.logout-btn {
  display: flex; align-items: center; gap: 10px; justify-content: center;
}

.content { flex: 1; padding: 30px 34px 44px; max-width: 1320px; min-width: 0; }

/* ---------- Sayfa başlığı ---------- */
.page-head { margin-bottom: 22px; }
.page-head .eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal);
  margin-bottom: 4px;
}
.page-head .eyebrow svg.ico { width: 14px; height: 14px; }
.page-head h2 {
  font-family: var(--f-disp);
  font-size: 27px; font-weight: 700; letter-spacing: 0.01em;
  color: var(--ink);
}
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------- Kartlar & ızgara ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- KPI: enstrüman göstergesi ---------- */
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 16px 18px 14px;
}
.kpi .kpi-top {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.kpi .kpi-top svg.ico { width: 15px; height: 15px; color: var(--teal); }
.kpi .kpi-num {
  font-family: var(--f-mono);
  font-weight: 600; font-size: 28px; line-height: 1.15;
  color: var(--ink);
  margin: 10px 0 2px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi .kpi-num small {
  font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px;
}
.kpi .kpi-ruler {
  height: 7px; margin: 8px 0 8px;
  background:
    linear-gradient(90deg, var(--brass) 0 2px, transparent 2px) 0 0/100% 100% no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 9px);
}
.kpi .kpi-ctx { font-size: 12px; color: var(--muted); }

/* ---------- Butonlar ---------- */
.btn {
  border: none; cursor: pointer;
  border-radius: var(--r-sm);
  padding: 10px 16px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  transition: filter 0.15s, background 0.15s;
}
.btn svg.ico { width: 15px; height: 15px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { filter: brightness(0.95); }
.btn.primary { background: var(--teal); color: #fff; }
.btn.green { background: var(--ok); color: #fff; }
.btn.red { background: var(--bad); color: #fff; }
.btn.orange { background: var(--warn); color: #fff; }
.btn.light { background: #e7eeec; color: var(--text); }
.btn.light:hover { background: #dce6e3; filter: none; }
.btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }

/* ---------- Tablolar ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-family: var(--f-disp);
  color: var(--muted);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 12px 10px;
  border-bottom: 1px solid #ecf1f0;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f6faf9; }
tr.clickable { cursor: pointer; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 13px; }
td .num, td.num { white-space: nowrap; }

/* Dar ekranda tablo kart içinde yatay kaydırılır, sayfa taşmaz */
.card:has(> table) { overflow-x: auto; }

/* ---------- Rozetler: işaret bayrağı ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap;
  background: #fff;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.gray { color: #5f7076; border-color: #cfdad7; }
.badge.blue { color: var(--info); border-color: #bcd8e8; }
.badge.green { color: var(--ok); border-color: #b6dbd6; }
.badge.red { color: var(--bad); border-color: #e7c2c1; }
.badge.orange { color: var(--warn); border-color: #ecd3ac; }
.badge.purple { color: var(--violet); border-color: #d4cbe8; }
.badge.brass { color: #8a6d12; border-color: #dcc670; background: #fdf8e7; }

/* ---------- Form alanları ---------- */
input.field, textarea.field, select.field {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px; outline: none;
  background: #fbfdfc;
  transition: border-color 0.15s;
}
input.field:focus, textarea.field:focus, select.field:focus { border-color: var(--teal); }
label.lbl {
  display: block;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 6px;
}

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input.field { max-width: 300px; }
.spacer { flex: 1; }

.thumb {
  width: 44px; height: 44px; border-radius: 8px;
  object-fit: cover; background: #e6edeb;
  border: 1px solid var(--line);
  display: block;
}
.thumb.empty {
  display: flex; align-items: center; justify-content: center;
  color: #9fb2ae;
}
.chart-box { height: 240px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(7, 24, 32, 0.55);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff; border-radius: 18px; padding: 26px;
  width: 480px; max-width: 100%;
  max-height: 88vh; overflow: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.modal h3 {
  font-family: var(--f-disp);
  font-size: 20px; font-weight: 700; letter-spacing: 0.01em;
  margin-bottom: 4px;
}
.modal .actions { display: flex; gap: 10px; margin-top: 22px; }
.modal .actions .btn { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-weight: 500; font-size: 13.5px;
  z-index: 100;
  border-left: 3px solid var(--crest);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  display: flex; align-items: center; gap: 9px;
}
.toast.err { border-left-color: var(--bad); }
.toast svg.ico { width: 16px; height: 16px; color: var(--crest); }
.toast.err svg.ico { color: #f0908e; }

/* ---------- Ufak parçalar ---------- */
.kv {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed #e4ebe9;
  font-size: 13.5px;
}
.kv:last-child { border-bottom: none; }
.kv b { font-weight: 600; text-align: right; }
.section-title {
  font-family: var(--f-disp);
  font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 8px;
  margin: 2px 0 12px;
}
.section-title svg.ico { width: 16px; height: 16px; color: var(--teal); }
.empty {
  color: var(--muted); text-align: center; padding: 28px 0; font-size: 13px;
}

.offer-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: none;
}
.offer-card.chosen { border-color: #dcc670; background: #fffdf4; }

/* ---------- Duyarlılık & erişilebilirlik ---------- */
@media (max-width: 1050px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .content { padding: 22px 18px 40px; }
}
@media (max-width: 780px) {
  .sidebar { width: 64px; padding: 16px 8px; }
  .brand { justify-content: center; padding: 4px 0 16px; }
  .brand-txt { display: none; }
  .sidebar nav a { justify-content: center; padding: 12px 0; }
  .sidebar nav a::before { display: none; }
  .sidebar nav a span.nav-label { display: none; }
  .logout-btn span.nav-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Teslimat ve ödeme (siparişler) ---------- */
.dely { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.dely .ico { width: 14px; height: 14px; }
.maplink {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 6px; font-size: 12px; font-weight: 600;
  color: var(--teal); text-decoration: none;
}
.maplink:hover { text-decoration: underline; }
.maplink .ico { width: 13px; height: 13px; }
