/* Kemer Sipariş Takip — modern, sade, responsive */
:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --success: #059669;
  --warn: #d97706;
  --done-bg: #ecfdf5;
  --done-border: #a7f3d0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
  --sidebar-w: 260px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent),
    radial-gradient(900px 400px at 100% 0%, rgba(15, 118, 110, .08), transparent),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: #0b1f1c;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transition: transform .2s ease;
}
.sidebar-brand {
  display: flex; gap: 12px; align-items: center;
  padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  box-shadow: 0 0 0 3px rgba(13,148,136,.25);
  flex-shrink: 0;
}
.sidebar-brand strong { display: block; font-size: 14px; color: #fff; }
.sidebar-brand small { color: #94a3b8; font-size: 12px; }
.sidebar-nav { padding: 12px; flex: 1; overflow: auto; }
.sidebar-nav a {
  display: block; color: #cbd5e1; padding: 10px 12px; border-radius: 8px;
  margin-bottom: 2px; text-decoration: none; font-weight: 500; font-size: 14px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: color-mix(in srgb, var(--primary) 35%, transparent); color: #fff; }
.nav-section {
  margin: 14px 12px 6px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: #64748b; font-weight: 600;
}
.sidebar-foot {
  padding: 14px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.user-chip span { display: block; font-size: 13px; color: #fff; font-weight: 600; }
.user-chip small { color: #94a3b8; font-size: 11px; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.page-heading { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
.menu-btn {
  display: none; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; width: 40px; height: 40px; font-size: 18px; cursor: pointer;
}
.content { padding: 20px; max-width: 1400px; width: 100%; margin: 0 auto; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-title { margin: 0 0 14px; font-size: 15px; font-weight: 700; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value.teal { color: var(--primary-dark); }
.stat .value.ok { color: var(--success); }
.stat .value.warn { color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 9px; padding: 10px 16px; font: inherit; font-weight: 600;
  font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: transform .05s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: #cbd5e1; border: 1px solid rgba(255,255,255,.15); }
.btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.btn-block { width: 100%; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.form-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px;
}
.order-no-box {
  margin-bottom: 0; padding: 12px; border-radius: 10px; border: 1px solid var(--border);
  background: #f8fafc;
}
.order-no-box.our { border-color: #99f6e4; background: #f0fdfa; }
.order-no-box.cust { border-color: #fde68a; background: #fffbeb; }
.order-no-box > label:first-child { margin-bottom: 4px; }
@media (max-width: 860px) {
  .form-pair { grid-template-columns: 1fr; }
}
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 12px; font: inherit; font-size: 14px; background: #fff; color: var(--text);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.textarea { min-height: 90px; resize: vertical; }
.check-list { display: grid; gap: 8px; }
.check-list label { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.data th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #f8fafc; }
table.data tr.row-done td { background: var(--done-bg); }
table.data tr.row-done:hover td { background: #d1fae5; }
table.data tr.termin-overdue td { background: #fef2f2; }
table.data tr.termin-overdue:hover td { background: #fee2e2; }
table.data tr.termin-soon td { background: #fffbeb; }
table.data tr.termin-soon:hover td { background: #fef3c7; }
table.data tr.termin-overdue .termin-cell { color: #b91c1c; }
table.data tr.termin-soon .termin-cell { color: #b45309; }
table.data .mono { font-family: var(--mono); font-size: 13px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; font-weight: 600; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #f1f5f9; }
.thumb-lg { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.js-zoom { cursor: zoom-in; transition: transform .15s ease, box-shadow .15s ease; }
.js-zoom:hover { transform: scale(1.04); box-shadow: 0 4px 14px rgba(15,23,42,.15); }

/* Resim büyütme (lightbox) */
.img-lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.img-lightbox[hidden] { display: none !important; }
.img-lightbox img {
  max-width: min(96vw, 1100px); max-height: 90vh;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45);
  object-fit: contain; cursor: default; background: #fff;
}
.img-lightbox-close {
  position: absolute; top: 14px; right: 16px;
  width: 44px; height: 44px; border: none; border-radius: 999px;
  background: rgba(255,255,255,.15); color: #fff; font-size: 28px;
  line-height: 1; cursor: pointer;
}
.img-lightbox-close:hover { background: rgba(255,255,255,.28); }

.badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.badge-active { background: #e0f2fe; color: #0369a1; }
.badge-done { background: #d1fae5; color: #047857; }
.badge-cancel { background: #fee2e2; color: #b91c1c; }
.badge-invoice { background: #fef3c7; color: #b45309; }

.alert {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters .input, .filters .select { width: auto; min-width: 140px; flex: 1; }

.qty-grid { display: grid; gap: 10px; }
.qty-row {
  display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center;
  padding: 10px 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
}
.qty-row .name { font-weight: 600; font-size: 14px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.meta-item { min-width: 140px; }
.meta-item .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.meta-item .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* Auth */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    linear-gradient(160deg, #0b1f1c 0%, #134e4a 45%, #0f766e 100%);
}
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 16px;
  padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card .sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-logo {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
}

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font-weight: 600; font-size: 13px; color: var(--muted); text-decoration: none;
}
.tab.active, .tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35;
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
/* Beden satırları */
.size-rows { display: grid; gap: 10px; }
.size-row {
  display: grid; grid-template-columns: 1fr 120px 40px; gap: 8px; align-items: center;
}
.size-input-wrap { position: relative; display: flex; align-items: center; gap: 6px; }
.size-input-wrap .input { flex: 1; }
.unit-tag {
  flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--primary-dark);
  background: color-mix(in srgb, var(--primary) 12%, #fff); padding: 8px 10px; border-radius: 8px;
}
.total-box {
  margin-top: 14px; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-radius: 12px; background: #0b1f1c; color: #fff;
}
.total-box strong { font-size: 24px; font-variant-numeric: tabular-nums; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn, .chip-radio {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text);
}
.chip-radio { display: inline-flex; align-items: center; gap: 6px; }
.chip-btn.active, .chip-btn:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.chip-radio:has(input:checked) {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.ship-row { grid-template-columns: 1fr 110px; }

/* Sevkiyat mail paneli */
.mail-panel { border-width: 2px; }
.mail-panel-wait { border-color: #f59e0b; background: linear-gradient(180deg, #fffbeb, #fff); }
.mail-panel-ok { border-color: #34d399; background: linear-gradient(180deg, #ecfdf5, #fff); }
.mail-panel-head { margin-bottom: 12px; }
.mail-preview {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px; font-size: 14px;
}
.mail-form .btn { margin-right: 6px; margin-top: 4px; }

/* Mobil sabit alt menü */
.bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #0b1f1c; border-top: 1px solid rgba(255,255,255,.08);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around; align-items: stretch;
}
.bottom-nav a {
  flex: 1; text-align: center; color: #94a3b8; text-decoration: none;
  font-size: 11px; font-weight: 600; padding: 6px 2px; border-radius: 10px;
}
.bottom-nav a.active, .bottom-nav a:hover { color: #fff; background: rgba(13,148,136,.25); text-decoration: none; }
.bn-ico { display: block; font-size: 18px; line-height: 1.2; margin-bottom: 2px; }
.bn-txt { display: block; }

@media (max-width: 860px) {
  .sidebar { transform: translateX(-105%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar-overlay.show { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .qty-row { grid-template-columns: 1fr; }
  .ship-row { grid-template-columns: 1fr 100px; }
  .size-row { grid-template-columns: 1fr 100px 36px; }
  .content { padding: 14px 14px 88px; }
  .topbar { padding: 12px 14px; }
  .bottom-nav { display: flex; }
  .topbar-actions .btn { padding: 7px 10px; font-size: 12px; }
}
@media print {
  .sidebar, .topbar, .filters, .actions, .btn, .menu-btn { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
