:root {
  --page: #f6f6f4;
  --card: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e7e6e1;
  --line-2: #f0efec;
  --accent: #b8975a;
  --pos: #006300;
  --neg: #c53030;
  --neg-bg: #fdecec;
  --pos-bg: #eaf5ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 4px 16px rgba(11, 11, 11, .03);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.neg { color: var(--neg); }
.pos { color: var(--pos); }

/* marka */
.brand { font-weight: 600; letter-spacing: .32em; font-size: 13px; }
/* altın çizgi logonun boyu kadar: blok logoya göre daralır */
.brand { align-self: flex-start; justify-self: start; }
.brand::after { content: ""; display: block; width: 100%; height: 2px; background: var(--accent); margin-top: 12px; }
.brand-lg { font-size: 18px; }
/* cutcaviar.com logosu: amblem + yazı (sitedeki beyaz logo, beyaz zemin için koyu renge çevrildi) */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { height: 28px; width: auto; display: block; }
.logo-word { height: 13px; width: auto; display: block; }
.brand-lg .logo { gap: 14px; }
.brand-lg .logo-mark { height: 44px; }
.brand-lg .logo-word { height: 19px; }

/* giriş */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.login-card p { margin: -4px 0 6px; }

/* iskelet */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.nav { display: grid; gap: 2px; }
.nav a { text-decoration: none; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.active { background: var(--ink); color: #fff; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.who { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 28px 32px 60px; min-width: 0; max-width: 1400px; }

/* üst çubuk */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.note { color: var(--muted); font-size: 12.5px; margin: -12px 0 18px; }
.bar h1 { font-size: 22px; font-weight: 600; margin: 0 auto 0 0; letter-spacing: -.01em; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--ink); color: #fff; }
select, input[type=text], input[type=number], input[type=password], input:not([type]), textarea {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; outline: none; width: 100%;
}
select { width: auto; padding-right: 28px; cursor: pointer; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11, 11, 11, .06); }
label { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #2a2a28; }
.btn-danger { color: var(--neg); }
.btn-block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.form-error { color: var(--neg); font-size: 13px; min-height: 1em; }

/* kartlar */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.card h3 .muted { font-weight: 400; }
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.g-3-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 600; margin-top: 6px; letter-spacing: -.01em; white-space: nowrap; }
.kpi .s { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }

/* lejant */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -4px 0 12px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* tablo */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
thead th { font-weight: 500; color: var(--muted); font-size: 12px; background: var(--card); }
tr.strong td { font-weight: 600; }
tr.sep td { border-top: 1px solid var(--line); }
td.cell-neg { color: var(--neg); background: var(--neg-bg); }
td.empty { color: #c9c8c2; }
td.cell-pos { color: #0b7a33; }
/* satır üzeri: renkli zeminin üstüne ince gölge, zemini ezmeden */
tbody tr:hover td { background-image: linear-gradient(rgba(11, 11, 11, .035), rgba(11, 11, 11, .035)); }

/* aylık tablo grupları */
.mtable tr.grp-cost td { background-color: #fdf6f1; }
.mtable tr.grp-sales td { background-color: #f3f7fd; }
.mtable tr.grp-profit td { background-color: #f1f8f2; }
.mtable tr.grp-kg td { background-color: #f6f6f3; }
.mtable tr.grp-cost td:first-child { box-shadow: inset 3px 0 0 #eb6834; }
.mtable tr.grp-sales td:first-child { box-shadow: inset 3px 0 0 #2a78d6; }
.mtable tr.grp-profit td:first-child { box-shadow: inset 3px 0 0 #1f9d55; }
.mtable tr.grp-kg td:first-child { box-shadow: inset 3px 0 0 #898781; }
.mtable td.cell-neg { background-color: var(--neg-bg); }
.mtable .tot { background-image: linear-gradient(rgba(11, 11, 11, .04), rgba(11, 11, 11, .04)); font-weight: 600; }
.mtable tbody tr:hover td.tot { background-image: linear-gradient(rgba(11, 11, 11, .075), rgba(11, 11, 11, .075)); }
.mtable .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; vertical-align: 0; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
.unit-tag { color: var(--muted); font-size: 11px; font-weight: 400; }

/* veri girişi */
.months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.month { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px; cursor: pointer; display: grid; gap: 4px; }
.month:hover { border-color: var(--ink-2); }
.month .m { font-weight: 600; }
.month .st { font-size: 12px; color: var(--muted); }
.month.filled .st::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--pos); margin-right: 6px; vertical-align: 1px; }
.month.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sub { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 12px; }
.sub:first-child { margin-top: 0; }
.unit { position: relative; }
.unit input { padding-right: 36px; text-align: right; }
.unit::after { content: attr(data-u); position: absolute; right: 11px; bottom: 9px; color: var(--muted); font-size: 12.5px; pointer-events: none; }
.calc { display: grid; gap: 0; }
.calc .row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.calc .row:last-child { border-bottom: 0; }
.calc .row.big { font-size: 17px; font-weight: 600; padding-top: 14px; }
.actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }
.actions .spacer { flex: 1; }
.log { display: grid; gap: 0; font-size: 13px; }
.log div { padding: 8px 0; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; }
.log div:last-child { border-bottom: 0; }
.log time { color: var(--muted); white-space: nowrap; }

/* ayarlar */
.list-items { display: grid; }
.list-items .item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list-items .item:last-child { border-bottom: 0; }
.list-items .item .grow { flex: 1; }
.inline-form { display: flex; gap: 8px; margin-top: 14px; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); }
.notice { background: #fbf6ea; border: 1px solid #efe1bd; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 12px; }
.notice code { font-size: 14px; background: #fff; padding: 1px 6px; border-radius: 6px; user-select: all; }

/* tooltip & toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); z-index: 50; }
.toast.err { background: var(--neg); }

/* ---- sipariş / numune listeleri ---- */
.card.flush { padding: 0; overflow: hidden; }
.card.flush .table-wrap { margin: 0; }
table.list th { white-space: nowrap; }
table.list th.l, table.list td.l { text-align: left; }
table.list tbody tr[data-id], table.list tbody tr[data-i] { cursor: pointer; }
table.list tbody tr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
table.list td.strong-cell { font-weight: 600; text-align: left; white-space: normal; min-width: 120px; max-width: 200px; }
table.list td:nth-child(2), table.list td:nth-child(3), table.list th:nth-child(2), table.list th:nth-child(3) { text-align: left; }
table.list td.chips { white-space: normal; min-width: 220px; }
table.list tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: #fafaf8; text-align: right; }
table.list tfoot td:first-child { text-align: left; }
.chip { display: inline-block; font-size: 11.5px; padding: 2px 7px 2px 6px; margin: 1px 3px 1px 0; border-radius: 6px; background: var(--line-2); color: var(--ink-2); border-left: 3px solid var(--c, var(--muted)); white-space: nowrap; }
.sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.sort.on { color: var(--ink); }
.search { width: 240px !important; }
.mpick { display: inline-flex; gap: 4px; align-items: center; }
.btn.icon { padding: 7px 11px; font-size: 16px; line-height: 1; }
.small { font-size: 12.5px; }
.mt { margin-top: 14px; }
.g-kpi-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
.fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.modal .fields { align-items: end; }
.modal .seg button { padding: 7px 12px; }
.modal input[type=date] { padding: 7px 10px; }
.link.small { font-size: 11.5px; margin-left: 6px; }
.notes { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 4px; max-height: 260px; overflow: auto; }

/* ---- modal ---- */
.noscroll { overflow: hidden; }
.modal-back { position: fixed; inset: 0; background: rgba(11, 11, 11, .28); display: grid; place-items: start center; padding: 40px 16px; overflow-y: auto; z-index: 40; }
.modal { background: var(--card); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .18); width: 100%; max-width: 560px; }
.modal.wide { max-width: 980px; }
.m-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.m-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.m-x { font-size: 24px; line-height: 1; text-decoration: none; color: var(--muted); }
.m-body { padding: 20px 22px; }
.m-foot { display: flex; gap: 10px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #fafaf8; border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.m-foot .spacer { flex: 1; }
.modal .seg { display: flex; width: fit-content; }
.modal label .seg { margin-top: 0; }

/* ürün satırları */
.phead, .prow { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) 80px minmax(0, 1fr) minmax(0, 1fr) 28px; gap: 8px; align-items: center; }
.phead.noprice, .prow.noprice { grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) 80px 28px; max-width: 560px; }
.phead { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.prow { margin-bottom: 8px; }
.prow select { width: 100%; }
.prow .p-qty { text-align: right; }
.p-line { text-align: right; color: var(--ink-2); font-size: 13px; }
.p-del { font-size: 20px; text-decoration: none; color: var(--muted); }
.p-del:hover { color: var(--neg); }
.calc-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; margin-top: 16px; }
.calc-strip > div { background: #fafaf8; padding: 12px 14px; display: grid; gap: 2px; }
.calc-strip span { font-size: 12px; color: var(--muted); }
.calc-strip b { font-size: 16px; font-variant-numeric: tabular-nums; }
.calc-strip small { font-size: 12px; color: var(--ink-2); }
.calc-inline { display: block; padding: 8px 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* fiyat listeleri */
.pl-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pl-tab { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 14px; cursor: pointer; display: grid; gap: 2px; }
.pl-tab span { font-size: 12px; color: var(--muted); }
.pl-tab em { font-style: normal; color: var(--pos); font-weight: 600; }
.pl-tab.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pl-grid td input { width: 84px; text-align: right; padding: 6px 8px; }

@media (max-width: 1440px) {
  table { font-size: 12px; }
  th, td { padding: 8px 6px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .main { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 1200px) {
  .g-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .g-2, .g-3-1, .entry-layout { grid-template-columns: 1fr; }
  .fields-4 { grid-template-columns: 1fr 1fr; }
  .months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; }
  .nav { min-width: 0; max-width: 100%; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px 16px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand::after { display: none; }
  .side .logo-mark { height: 22px; }
  .side .logo-word { height: 11px; }
  .nav { display: flex; gap: 2px; order: 3; width: 100%; overflow-x: auto; }
  .nav a { padding: 7px 10px; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; }
  .who { display: none; }
  .main { padding: 18px 16px 48px; }
  .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 18px; }
  .months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fields, .fields-3, .fields-4 { grid-template-columns: 1fr 1fr; }
  .search { width: 100% !important; }
  .phead { display: none; }
  .prow { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; }
  .prow.noprice { grid-template-columns: 1fr 1fr; }
  .calc-strip { grid-template-columns: 1fr 1fr; }
  .modal-back { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .table-wrap { margin: 0 -20px -20px; }
}
.pl-grid th, .pl-grid td { text-align: right !important; }
.pl-grid th:first-child, .pl-grid td:first-child { text-align: left !important; }
.p-sizewrap { display: flex; gap: 6px; align-items: center; min-width: 0; }
.p-sizewrap select { flex: 1; min-width: 0; }
