/* Seyhanlar B2B tedarikçi portalı. Görsel dil seyhanlar.com ile aynı aileden: kırmızı (#dd042b), koyu metin,
   açık gri zemin, sarı vurgu, Poppins, yuvarlatılmış kartlar ve hap biçimli butonlar.
   Düzen: solda sabit menü (kullanıcı isteği), sağda üst şerit + içerik; telefonda menü üstte yatay kaydırılır. */
:root {
    --brand: #dd042b;
    --brand-dark: #b30323;
    --brand-soft: #fde6ea;
    --sun: #ffcc29;
    --sun-soft: #fff4d1;
    --ink: #111111;
    --bg: #f4f4f4;
    --surface: #ffffff;
    --line: #e6e6e6;
    --muted: #6b6b6b;
    --good: #1f8a4c;
    --good-bg: #e3f4ea;
    --warn: #a15c00;
    --warn-bg: #fff1d6;
    --bad: #b30323;
    --bad-bg: #fde6ea;
    --info: #2f5fa8;
    --info-bg: #e3ecf8;
    --radius: 16px;
    --radius-sm: 10px;
    --font: "Poppins", Arial, sans-serif;
    color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.muted { color: var(--muted); }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* İskelet: sol menü + içerik */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--ink); }
.side-brand img { height: 28px; display: block; }
.side-brand strong { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; line-height: 1.15; }
.side-brand small { font-weight: 500; font-size: 11px; color: var(--muted); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side .grp { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 4px; }
.side .item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.side .item i { font-size: 18px; color: var(--muted); }
.side a.item:hover { background: var(--bg); color: var(--brand); }
.side a.item:hover i { color: var(--brand); }
.side a.item:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.side .item.on { background: var(--brand); color: #fff; }
.side .item.on i { color: #fff; }
.side .item.soon { color: #9a9a9a; cursor: default; font-size: 13px; }
.side .item.soon i { color: #b5b5b5; }
.side .tag { margin-left: auto; font-size: 10px; font-weight: 600; background: var(--sun); color: var(--ink); border-radius: 99px; padding: 0 7px; }
.side-foot { margin-top: auto; display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--muted); padding: 12px; border-radius: var(--radius-sm); background: var(--bg); }
.side-foot i { font-size: 18px; color: var(--brand); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); position: sticky; top: 0; z-index: 10; }
.topbar .company select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 12px 5px 5px; border-radius: 99px; background: var(--brand); color: #fff; font-weight: 500; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--brand-dark); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 6px; display: flex; flex-direction: column; }
.user-menu .menu .head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.user-menu .menu .head small { color: var(--muted); }
.user-menu .menu a, .user-menu .menu button { all: unset; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--bg); }
.user-menu .menu form { margin: 0; }

.content { padding-block: 22px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); flex: 1; }
.wrap { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page-head h1 { font-size: 24px; font-weight: 600; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 80ch; }
.site-footer { color: var(--muted); font-size: 12px; padding-block: 14px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.site-footer div { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }

/* Filtre çubuğu */
.filters { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filters label { font-size: 12px; color: var(--muted); font-weight: 500; }
.filters select, .filters input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid transparent; border-radius: 10px; padding: 8px 10px; max-width: 100%; }
.filters select:focus, .filters input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.filters .f.cat select { max-width: 320px; }
.filters .actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.filters .check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.btn { font: inherit; font-weight: 600; border: 0; border-radius: 99px; padding: 9px 18px; cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn:focus-visible, .btn-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-link { all: unset; color: var(--brand); cursor: pointer; font-weight: 600; }

/* Bileşenler */
.hero { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 22px 26px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -90px; width: 240px; height: 240px; border-radius: 50%; background: var(--sun); }
.hero > * { position: relative; z-index: 1; max-width: 70ch; }
.hero h1 { font-size: 24px; font-weight: 600; }
.hero p { margin: 0; color: #ffe3e8; }
.hero strong { color: #fff; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 18px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.panel h2 { font-size: 16px; font-weight: 600; }
.panel .hint { font-size: 12px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
a.kpi:hover { box-shadow: 0 0 0 2px var(--brand-soft); }
.up { color: var(--good) !important; }
.down { color: var(--bad) !important; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.grid2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.chart { min-height: 280px; }
.alerts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.alerts li { display: grid; grid-template-columns: 6px 1fr; gap: 10px; }
.alerts .bar { border-radius: 3px; }
.alerts a { color: var(--ink); text-decoration: none; font-weight: 600; }
.alerts a:hover { color: var(--brand); }
.alerts span { display: block; color: var(--muted); font-size: 13px; }
.notice { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-radius: var(--radius-sm); }
.notice.ok { background: var(--good-bg); color: var(--good); }
.notice.err { background: var(--bad-bg); color: var(--bad); }
.notice.info { background: var(--sun-soft); color: var(--warn); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill.out, .pill.critical, .pill.negative { background: var(--bad-bg); color: var(--bad); }
.pill.low { background: var(--warn-bg); color: var(--warn); }
.pill.normal { background: var(--good-bg); color: var(--good); }
.pill.excess { background: var(--info-bg); color: var(--info); }
.pill.no_sales { background: var(--bg); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: 13px; }
.chips a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips a b { font-variant-numeric: tabular-nums; margin-left: 4px; }

/* Tablolar */
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-tools input { font: inherit; background: var(--bg); border: 1px solid transparent; border-radius: 99px; padding: 7px 14px; min-width: 0; width: 260px; max-width: 100%; }
.table-tools input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.table-tools .count { font-size: 12px; color: var(--muted); }
.tbl { overflow: auto; max-height: 70vh; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; background: var(--surface); z-index: 1; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--brand); }
th.asc::after { content: " ▲"; }
th.desc::after { content: " ▼"; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.nowrap, th.nowrap { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafafa; }
th.num, td.num { text-align: right; white-space: nowrap; }
td small { display: block; color: var(--muted); font-size: 12px; }
tfoot td { font-weight: 600; border-top: 2px solid var(--line); background: var(--surface); position: sticky; bottom: 0; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 2; min-width: 240px; }
.matrix td.zero { color: #c4c4c4; }
.empty { text-align: center; color: var(--muted); padding: 24px; }

/* Formlar (giriş, parola) */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; font-size: 13px; }
.field input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; width: 100%; }
.field input:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error, .field-validation-error { font-size: 12px; color: var(--bad); }
.pw { position: relative; }
.pw input { padding-right: 72px; }
.pw button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-stack .btn { justify-content: center; padding: 12px 22px; }

/* Giriş ve parola belirleme ekranı */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.auth-side { background: var(--brand); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; right: -170px; top: -170px; width: 380px; height: 380px; border-radius: 50%; background: var(--sun); }
.auth-side::after { content: ""; position: absolute; left: -70px; top: 38%; width: 170px; height: 170px; border-radius: 50%; border: 26px solid rgba(255,255,255,.12); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side .logo { background: #fff; border-radius: 12px; padding: 8px 14px; align-self: flex-start; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.auth-side .logo img { height: 30px; display: block; }
.auth-side h2 { font-size: 34px; line-height: 1.15; font-weight: 700; max-width: 16ch; }
.auth-side p { color: #ffe3e8; max-width: 44ch; margin: 12px 0 0; }
.auth-side ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.auth-side li { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.12); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.auth-side li i { font-size: 18px; }
.auth-side .brands { font-size: 12px; color: #ffe3e8; }
.auth-side .brands strong { color: #fff; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.auth-card .eyebrow { font-size: 12px; font-weight: 600; color: var(--brand); letter-spacing: .06em; text-transform: uppercase; }
.auth-card h1 { font-size: 26px; font-weight: 600; }
.auth-card .lead { color: var(--muted); margin: -8px 0 0; }

@media (max-width: 1100px) {
    .grid2, .grid2.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-side { padding: 24px 16px 28px; }
    .auth-side ul, .auth-side .brands { display: none; }
    .auth-side h2 { font-size: 24px; }
}
@media (max-width: 820px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .side { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); gap: 8px; }
    .side nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
    .side nav::-webkit-scrollbar { display: none; }
    .side .grp, .side-foot, .side .item.soon { display: none; }
    .side .item { white-space: nowrap; flex: none; }
    .topbar { position: static; }
    .user-menu .who { display: none; }
    .filters .actions { margin-left: 0; }
    .hero::after { width: 110px; height: 110px; right: -45px; top: -45px; }
    .hero h1, .page-head h1 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
