/* Planet Sipariş — mobil öncelikli arayüz */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --border: #e1e6ed;
  --text: #16202c;
  --muted: #5f6d7d;
  --accent: #0b5cad;
  --accent-2: #3d8be0;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0fb;
  --ok: #1d8a4b;     --ok-soft: #e3f4ea;
  --warn: #b06400;   --warn-soft: #fdf1dc;
  --danger: #c62f2f; --danger-soft: #fce8e8;
  --c1: #0b5cad; --c2: #e08a1e; --c3: #1d8a4b; --c4: #8a4fd1; --c5: #d0456b; --c6: #2aa5b5;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .05);
  --sidebar-w: 236px;
  --bottom-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a; --surface: #171e27; --surface-2: #1d2631; --border: #2a3542; --text: #e6ebf1; --muted: #93a1b2;
    --accent: #4b9bf0; --accent-2: #7ab6f5; --accent-ink: #06121f; --accent-soft: #15283d;
    --ok: #4cc27f; --ok-soft: #13301f; --warn: #f0a640; --warn-soft: #33260f; --danger: #f06666; --danger-soft: #3a1717;
    --c1: #4b9bf0; --c2: #f0a640; --c3: #4cc27f; --c4: #a982ea; --c5: #ee7495; --c6: #4fc3d1;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h3 { font-size: 16px; font-weight: 650; }
h4 { font-size: 14px; font-weight: 650; }
p { margin: .4em 0; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
small, .muted { color: var(--muted); }
.block { display: block; }
.mt { margin-top: 16px; }
.pre { white-space: pre-wrap; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Kabuk ---------- */
#app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 18px; padding: 6px 10px 18px; }
.brand:hover { text-decoration: none; }
.brand .ic { width: 32px; height: 32px; color: var(--accent); }
.brand small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.brand.big { justify-content: center; font-size: 22px; padding-bottom: 24px; }
.brand.big .ic { width: 42px; height: 42px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 550; }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 12px 6px; }
.sidebar-user { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); color: var(--text); font-weight: 600; }
.sidebar-user small { display: block; font-weight: 400; }
.sidebar-user:hover { text-decoration: none; background: var(--surface-2); border-radius: 10px; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.back-btn { display: none; }
.view { padding: 20px 24px 40px; max-width: 1400px; margin: 0 auto; }
.bottom-nav { display: none; }
.show-mobile, .show-mobile-inline { display: none !important; }

/* ---------- Bileşenler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor;
  border-color: var(--muted) transparent var(--muted) transparent; animation: spin .7s linear infinite;
}
.btn.primary.loading::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.light { color: #fff; }
.icon-btn.light:hover { background: rgba(255, 255, 255, .15); }
.link, .link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.link-btn { display: flex; align-items: center; gap: 10px; font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card, .card + .kpi-grid, .kpi-grid + .card, .kpi-grid + .grid-2, .card + .grid-2 { margin-top: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { width: 18px; height: 18px; color: var(--muted); }
.card-head a, .card-head small { font-size: 13px; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.span-2 { grid-column: 1 / -1; }
.narrow { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; }
.narrow .card + .card { margin-top: 0; }
.hint { font-size: 13px; color: var(--muted); margin: -4px 0 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid var(--border);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.abc-A { background: var(--ok-soft); color: var(--ok); }
.pill.abc-B { background: var(--warn-soft); color: var(--warn); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -2px; padding: 2px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip .ic { width: 15px; height: 15px; }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar.wrap { flex-wrap: wrap; justify-content: space-between; }
.toolbar .chips { margin: 0; }
.select-sm, select, input, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; min-height: 42px; width: 100%; outline: none;
}
.select-sm { width: auto; min-height: 40px; font-size: 14px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 64px; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.form { display: grid; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.form-error { color: var(--danger); font-size: 14px; margin: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi-grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; color: var(--text); min-width: 0; border-top: 3px solid var(--border);
}
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-value.sm { font-size: 18px; }
.kpi small { font-size: 12.5px; }
.kpi.warn { border-top-color: var(--warn); }
.kpi.danger { border-top-color: var(--danger); }
.kpi.danger .kpi-value { color: var(--danger); }
.kpi.ok { border-top-color: var(--ok); }
.money-line { display: block; font-size: 18px; }

/* Grafik */
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }

/* Çubuk liste */
.bar-list { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 6px; border-radius: 8px; color: var(--text); }
.bar-row:hover { background: var(--surface-2); text-decoration: none; }
.bar-text { min-width: 0; }
.bar-text strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }
.bar-text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; align-self: center; }
.bar-track { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 99px; }

/* Listeler */
.list { display: grid; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 6px; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item > div { min-width: 0; }
.list-item strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list.compact .list-item { padding: 9px 4px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 6px; }

.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.entity-card {
  display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; color: var(--text); box-shadow: var(--shadow); min-width: 0;
}
a.entity-card:hover { border-color: var(--accent); text-decoration: none; }
.entity-card.inactive { opacity: .6; }
.entity-main strong { display: block; font-size: 15.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.entity-main small { display: block; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entity-stats { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.entity-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.entity-foot { font-size: 12.5px; color: var(--muted); }
.product-card { grid-template-columns: 64px 1fr; }
.product-card .thumb {
  grid-row: span 3; width: 64px; height: 64px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center;
  overflow: hidden; color: var(--muted); border: 1px solid var(--border);
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.clip { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 12px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.clip .ic { width: 14px; height: 14px; }

.list-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px; min-height: 42px;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .ic { color: var(--muted); width: 18px; height: 18px; }
.search-box input { border: 0; box-shadow: none !important; padding: 8px 0; background: transparent; min-height: 40px; }
.search-input.big { font-size: 17px; padding: 14px 16px; margin-bottom: 8px; }
.filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; align-items: end; }
.filters .form-actions { grid-column: 1 / -1; }
.filters.inline { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.filters.inline .form-actions { grid-column: auto; justify-content: flex-start; }
.active-filter { font-size: 14px; margin: -4px 0 10px; display: flex; gap: 8px; align-items: center; }
.summary-line { font-size: 13.5px; color: var(--muted); margin: 4px 2px 10px; }
.summary-line strong { color: var(--text); }
.load-more { text-align: center; margin: 16px 0; }

/* Tablolar */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
.data-table th {
  text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tr[data-href] { cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .row-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.data-table.small { font-size: 13px; }
.data-table.small td { padding: 6px 10px; white-space: nowrap; }
.orders-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border-collapse: separate; border-spacing: 0; }
.card .orders-table { box-shadow: none; }
.cell-title a { color: var(--text); font-weight: 650; }
.cell-product strong { font-weight: 700; }
.cell-product span { color: var(--muted); }
.actions-cell { text-align: right; white-space: nowrap; }
.heat { display: inline-block; min-width: 44px; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), transparent); }
.report-table td { white-space: nowrap; }

/* Detay */
.detail-head { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; align-items: start; }
.detail-title { min-width: 0; }
.title-link, .title-text { font-size: 21px; font-weight: 750; color: var(--text); display: block; line-height: 1.25; word-break: break-word; }
.subtitle { margin-top: 4px; font-size: 14.5px; word-break: break-word; }
.detail-status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.action-row { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.progress-wrap { grid-column: 1 / -1; display: grid; gap: 6px; }
.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; background: var(--ok); border-radius: 99px; }
.progress-fill.danger { background: var(--danger); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; }
.field span, .text-block span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.field strong { font-weight: 600; word-break: break-word; }
.text-block { margin-top: 14px; }
.text-block p { white-space: pre-wrap; margin: 2px 0 0; }
.meta-line { font-size: 12.5px; color: var(--muted); margin-top: 16px; }

/* Teknik resimler */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.att-grid.compact { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 8px; }
.att { margin: 0; min-width: 0; }
.att-thumb {
  display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface-2); cursor: zoom-in; padding: 0;
}
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-icon { display: grid; place-items: center; gap: 4px; color: var(--muted); }
.att-icon .ic { width: 34px; height: 34px; }
.att-icon.pdf { color: var(--danger); }
.att-icon b { font-size: 12px; }
.att figcaption { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.att-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.att-empty { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 12px; background: var(--surface-2); border-radius: 10px; font-size: 14px; }
.uploader { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.uploader-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.uploader-btns label.btn { flex-direction: row; color: var(--text); font-size: 14px; }

.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(8, 12, 18, .96); display: flex; flex-direction: column; color: #fff; }
.viewer-bar { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
.viewer-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.viewer-title small { color: rgba(255, 255, 255, .6); margin-left: 6px; }
.viewer-stage { flex: 1; display: grid; place-items: center; overflow: auto; padding: 8px; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pinch-zoom; }
.viewer-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 6px; }
.viewer-dl { text-align: center; display: grid; gap: 10px; justify-items: center; }
.viewer-dl .ic { width: 64px; height: 64px; }
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 10px;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 36px; cursor: pointer;
}
.viewer-nav.prev { left: 8px; }
.viewer-nav.next { right: 8px; }

/* Sipariş formu */
.order-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 80px; }
.order-form .card { display: grid; gap: 12px; align-content: start; margin: 0; }
.order-form .card > h3 { margin: 0; }
.order-form .card:last-of-type { grid-column: 1 / -1; }
.sticky-actions {
  position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 25; display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
}
.sticky-actions .btn { min-width: 120px; }
.totals { font-weight: 650; margin: 0; color: var(--accent); }
.hint-box { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; font-size: 13.5px; }
.hint-box.new { color: var(--muted); }
.hint-row.good { color: var(--ok); }
.hint-row .ic { width: 15px; height: 15px; vertical-align: -2px; }

/* Zaman çizelgesi */
.visit-form { display: grid; gap: 10px; margin-bottom: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tl-head { display: flex; align-items: center; gap: 8px; }
.tl-head .icon-btn { margin-left: auto; }
.timeline p { margin: 4px 0 0; white-space: pre-wrap; }
.tl-next { color: var(--warn); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.tl-next .ic { width: 15px; height: 15px; }

/* Raporlar */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.report-card { display: flex; gap: 14px; color: var(--text); margin: 0 !important; }
.report-card:hover { border-color: var(--accent); text-decoration: none; }
.report-card .ic { width: 28px; height: 28px; color: var(--accent); margin-top: 2px; }
.report-card p { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.report-desc { color: var(--muted); margin: 0 0 12px; }

/* İçe aktarma */
.steps { margin: 0 0 14px; padding-left: 20px; color: var(--muted); display: grid; gap: 4px; }
.steps b { color: var(--text); }
.import-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.import-pick label.btn { flex-direction: row; color: var(--accent-ink); font-size: 14px; }
.mapping { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.mapping summary, .errors summary { cursor: pointer; font-weight: 600; }
.mapping-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.mapping-grid label span { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.errors { margin-bottom: 12px; }
.errors ul, .result-card ul { max-height: 240px; overflow: auto; font-size: 13px; }
.links-card { display: grid; gap: 14px; }
.links-card a { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.account-head { display: flex; gap: 12px; align-items: center; }
.account-head .ic { width: 40px; height: 40px; color: var(--accent); }
.account-head strong, .account-head small { display: block; }
.confirm-msg { font-size: 15px; margin: 0 0 16px; }

/* Boş / iskelet */
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty p { margin: 0; font-weight: 600; }
.empty.error p { color: var(--danger); margin-bottom: 12px; }
.skeleton-list { display: grid; gap: 10px; }
.skeleton { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border: 1px solid var(--border); }
@keyframes sk { to { background-position: -200% 0; } }

/* Modal & toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(10, 16, 24, .5); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 20px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 8px 20px 20px; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; z-index: 120; left: 50%; transform: translateX(-50%); bottom: 24px; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--text); color: var(--surface); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); transition: opacity .4s, transform .4s; }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* Giriş */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--accent-soft), var(--bg) 60%); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px 24px; display: grid; gap: 14px; box-shadow: 0 20px 50px rgba(16, 24, 40, .1); }
.login-card .btn { min-height: 48px; font-size: 16px; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}

/* ---------- Telefon ---------- */
@media (max-width: 899px) {
  body { font-size: 15px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
  .topbar { height: 54px; padding: 0 8px; padding-top: env(safe-area-inset-top); height: calc(54px + env(safe-area-inset-top)); }
  .topbar h1 { font-size: 17px; }
  .back-btn { display: inline-grid; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: inline-grid !important; }
  .show-mobile-inline { display: inline !important; }
  .view { padding: 12px 12px 24px; }
  .card { padding: 14px; border-radius: 12px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 22px; }
  .kpi-value.sm { font-size: 15px; }
  .money-line { font-size: 15px; }
  .chart-box { height: 210px; }
  .chart-box.tall { height: 240px; }
  .row-3 { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .card-list { grid-template-columns: 1fr; gap: 10px; }
  .detail-head { grid-template-columns: 1fr; }
  .detail-status { justify-content: flex-start; }
  .title-link, .title-text { font-size: 19px; }
  .action-row .btn { flex: 1 1 auto; }
  .icon-only-mobile span { display: none; }
  .icon-only-mobile { width: 42px; padding: 0; }
  .toolbar.wrap .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .toolbar.wrap .select-sm { width: 100%; }
  .order-form { grid-template-columns: 1fr; gap: 12px; }
  .sticky-actions { left: 0; bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding: 10px 12px; }
  .sticky-actions .btn { flex: 1; }
  .att-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  #toasts { bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom)); }

  /* Alt menü + ortada yeni sipariş butonu */
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .bottom-nav .nav-link { flex-direction: column; gap: 2px; padding: 6px 0; font-size: 11px; border-radius: 0; background: none; }
  .bottom-nav .nav-link.active { color: var(--accent); background: none; }
  .bottom-nav .ic { width: 22px; height: 22px; }
  .fab {
    justify-self: center; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-10px);
  }
  .fab .ic { width: 26px; height: 26px; }
  .fab:hover { text-decoration: none; }

  /* Tablolar telefonda kart görünümüne döner */
  .orders-table, .top-products { border: 0; box-shadow: none; background: transparent; }
  .orders-table thead, .top-products thead { display: none; }
  .orders-table, .orders-table tbody, .orders-table tr, .orders-table td,
  .top-products, .top-products tbody, .top-products tr, .top-products td { display: block; width: 100%; }
  .orders-table tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
  }
  .card .orders-table tr { box-shadow: none; }
  .orders-table tr.row-late { border-left: 4px solid var(--danger); }
  .orders-table .row-late td:first-child { box-shadow: none; }
  .orders-table td { padding: 0; border: 0; width: auto; }
  .orders-table td[data-label="Firma"] { flex: 1 1 60%; min-width: 0; font-size: 15.5px; order: 1; }
  .orders-table td[data-label="Durum"] { flex: none; margin-left: auto; order: 2; }
  .orders-table td[data-label="Ürün"] { flex: 1 1 100%; font-size: 14px; order: 3; }
  .orders-table td[data-label="Miktar"], .orders-table td[data-label="Kalan"], .orders-table td[data-label="Termin"], .orders-table td[data-label="Tarih"] {
    flex: none; font-size: 13px; color: var(--muted); text-align: left; order: 4;
  }
  .orders-table td[data-label="Tarih"] { order: 5; }
  .orders-table td[data-label="Tarih"] small { display: inline; margin-left: 6px; }
  .orders-table td[data-label="Miktar"]::before, .orders-table td[data-label="Kalan"]::before, .orders-table td[data-label="Termin"]::before {
    content: attr(data-label) ": ";
  }
  .orders-table td.num strong { color: var(--text); }

  .top-products tr { border-bottom: 1px solid var(--border); padding: 10px 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
  .top-products td { padding: 0; border: 0; text-align: left !important; font-size: 13px; color: var(--muted); }
  .top-products td[data-label="Ürün"] { grid-column: 1 / -1; font-size: 14.5px; color: var(--text); }
  .top-products td[data-label]:not([data-label="Ürün"])::before { content: attr(data-label) ": "; }
  .top-products td.actions-cell { grid-column: 1 / -1; }
  .top-products td.actions-cell .btn { width: 100%; margin-top: 6px; }
}

@media (max-width: 380px) {
  .row-2 { grid-template-columns: 1fr; }
  .kpi-value { font-size: 20px; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .action-row, .sticky-actions, .uploader { display: none !important; }
  .main { margin: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
