/* Demo Yapı Market admin panel: the site's tones, a dark navy side menu. */
:root {
  --navy: #020a5e;
  --navy-deep: #01063f;
  --navy-soft: #e8eaf4;
  --red: #a80a0c;
  --red-dark: #8a0809;
  --ink: #0e1338;
  --muted: #596072;
  --line: #e3e6ee;
  --gray: #f1f3f6;
  --white: #fff;
  --ok: #0f7a43;
  --warn: #a35a00;
  --radius: 8px;
  --font: 'Archivo Variable', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--gray); color: var(--ink); font: 400 15px/1.5 var(--font); }
h1, h2 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
.ic { width: 1.15em; height: 1.15em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid #4d6bff; outline-offset: 2px; }
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

/* Side menu */
.side { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; padding: 18px 12px; background: var(--navy-deep); color: rgb(255 255 255 / 0.78); }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--white); font-weight: 750; text-decoration: none; }
.side__brand span:last-child { display: grid; line-height: 1.2; }
.side__brand small { color: rgb(255 255 255 / 0.6); font-weight: 450; font-size: 12px; }
.logo__mark { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 999px; background: var(--navy); color: var(--white); font-weight: 800; font-size: 14px; box-shadow: inset 0 -4px 0 var(--red), 0 0 0 1px rgb(255 255 255 / 0.15); }
.side nav { display: grid; gap: 2px; }
.side nav p { margin: 16px 10px 6px; color: rgb(255 255 255 / 0.45); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); text-decoration: none; font-weight: 550; }
.side nav a:hover { background: rgb(255 255 255 / 0.07); color: var(--white); }
.side nav a.is-on { background: var(--navy); color: var(--white); box-shadow: inset 3px 0 0 var(--red); }
.sbadge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: var(--white); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.sbadge[hidden] { display: none; }
.side__user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgb(255 255 255 / 0.1); color: var(--white); font-weight: 600; }
.side__user span:last-child { display: grid; line-height: 1.2; }
.side__user small { color: rgb(255 255 255 / 0.55); font-weight: 450; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: rgb(255 255 255 / 0.12); font-size: 13px; }

/* Main area */
.main { min-width: 0; }
.pbar { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 28px; background: var(--white); border-bottom: 1px solid var(--line); }
.pbar__title { font-weight: 700; color: var(--navy); }
.pbar__site { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; text-decoration: none; }
.pbar__site:hover { border-color: var(--navy); }
.menubtn { display: none; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); cursor: pointer; }
.view { display: grid; gap: 20px; align-content: start; padding: 28px; }
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.phead h1 { color: var(--navy); font-size: 28px; }
.phead p { margin-top: 4px; color: var(--muted); }
.phead__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 1.5px solid transparent; border-radius: 999px; font-weight: 650; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn--red { background: var(--red); color: var(--white); }
.btn--red:hover { background: var(--red-dark); }
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--navy-deep); }
.btn--light { border-color: var(--line); background: var(--white); color: var(--ink); }
.btn--light:hover { border-color: var(--navy); }
.iconbtn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--gray); color: var(--red); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Cards and figures */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { display: flex; gap: 14px; padding: 18px; border-radius: 12px; background: var(--white); text-decoration: none; border: 1px solid var(--line); }
.stat:hover { border-color: var(--navy); }
.stat__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--navy-soft); color: var(--navy); font-size: 20px; }
.stat > span:last-child { display: grid; }
.stat small { color: var(--muted); font-weight: 550; }
.stat strong { color: var(--navy); font-size: 24px; line-height: 1.2; }
.stat em { color: var(--red); font-style: normal; font-size: 12px; font-weight: 650; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cols--3 { grid-template-columns: repeat(3, 1fr); }
.box { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.box__head h2 { color: var(--navy); font-size: 17px; }
.box__head a { color: var(--navy); font-weight: 650; font-size: 14px; text-decoration: none; }
.tipbox { border: 1px dashed #ffb44c; background: #fff8ec; color: #6b4300; }
.tipbox h2 { display: flex; align-items: center; gap: 8px; color: #6b4300; font-size: 16px; }
.tipbox a { color: var(--navy); font-weight: 700; }
.list { display: grid; margin: 0; padding: 0; list-style: none; }
.list li + li { border-top: 1px solid var(--line); }
.list a { display: flex; align-items: center; gap: 14px; padding: 10px 4px; text-decoration: none; }
.list a:hover { background: var(--gray); }
.list a > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.list small { color: var(--muted); }
.time { width: 56px; flex: none; color: var(--navy); font-weight: 700; font-size: 14px; }
.empty { padding: 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.muted { color: var(--muted); font-size: 14px; }
.muted a { color: var(--navy); font-weight: 650; }
.note { padding: 12px 14px; border-radius: var(--radius); background: var(--gray); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--gray); color: var(--muted); font-size: 12px; font-weight: 650; }
.new { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--red); color: var(--white); font-size: 11px; font-weight: 700; vertical-align: middle; }
.badge { display: inline-block; flex: none; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--gray); color: var(--muted); }
.badge--bekliyor, .badge--yeni, .badge--hazirlaniyor { background: #fff2dc; color: var(--warn); }
.badge--onaylandi, .badge--gonderildi { background: var(--navy-soft); color: var(--navy); }
.badge--tamamlandi, .badge--kabul { background: #e3f4ea; color: var(--ok); }
.badge--iptal, .badge--ret { background: #fde7e7; color: var(--red); }
.stars { color: #e0a100; letter-spacing: 2px; }

/* Tabs, search */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-weight: 600; font-size: 14px; text-decoration: none; }
.tabs a span { color: var(--muted); font-weight: 500; }
.tabs a.is-on { border-color: var(--navy); background: var(--navy); color: var(--white); }
.tabs a.is-on span { color: rgb(255 255 255 / 0.7); }
.psearch { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); color: var(--muted); }
.psearch input { flex: 1; border: 0; outline: 0; padding: 10px 0; background: transparent; color: var(--ink); }

/* Tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 12px 16px; background: var(--gray); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.table td small { display: block; color: var(--muted); font-size: 13px; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: #fafbfd; }
.table td a { text-decoration: none; }
.mono { font-family: ui-monospace, 'Cascadia Code', monospace; color: var(--navy); font-weight: 600; }
.table--items td:first-child { display: flex; align-items: center; gap: 12px; }
.table--items input { width: 100%; min-width: 80px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius); }
.table--items input:focus { border-color: var(--navy); outline: 0; }
.thumb { width: 44px; height: 44px; flex: none; overflow: hidden; border-radius: 6px; background: linear-gradient(135deg, #dfe3ef, #b7bfdb); display: inline-block; vertical-align: middle; margin-right: 10px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
img.is-missing { visibility: hidden; }
.totals { display: grid; justify-self: end; gap: 6px; min-width: 280px; }
.totals div { display: flex; justify-content: space-between; gap: 24px; }
.totals span { color: var(--muted); }
.totals__grand { padding-top: 8px; border-top: 2px solid var(--navy); font-size: 18px; }
.totals__grand span, .totals__grand strong { color: var(--navy); }
.dl { display: grid; margin: 0; }
.dl div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; text-align: right; }
.dl a { color: var(--navy); }

/* Forms */
.field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--white); font-weight: 400; }
.field :disabled { background: var(--gray); color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: relative; width: 40px; height: 22px; flex: none; border-radius: 999px; background: #c9cedb; transition: background 0.15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: var(--white); transition: transform 0.15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid #4d6bff; outline-offset: 2px; }
.pimg { aspect-ratio: 1; max-width: 280px; overflow: hidden; border-radius: 10px; background: linear-gradient(135deg, #dfe3ef, #b7bfdb); }
.pimg img { width: 100%; height: 100%; object-fit: cover; }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.catalog { grid-template-columns: auto 1fr; align-items: center; }
.catalog .actions { grid-column: 1 / -1; }
.catalog__cover { display: grid; place-items: center; width: 56px; height: 72px; border-radius: 6px; background: var(--navy); color: var(--white); font-size: 24px; box-shadow: inset 0 -6px 0 var(--red); }

/* Calendar */
.calendar { display: grid; grid-template-columns: 64px repeat(6, minmax(130px, 1fr)); overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.calendar > div { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); min-height: 64px; }
.calendar__corner, .calendar__time { border-left: 0 !important; }
.calendar__day { display: grid; place-content: center; text-align: center; padding: 8px; background: var(--gray); color: var(--muted); font-size: 13px; min-height: 0 !important; }
.calendar__day strong { color: var(--navy); font-size: 15px; }
.calendar__day.is-today { background: var(--navy); color: rgb(255 255 255 / 0.8); }
.calendar__day.is-today strong { color: var(--white); }
.calendar__corner { background: var(--gray); }
.calendar__time { padding: 8px; color: var(--muted); font-weight: 650; font-size: 13px; }
.calendar__cell { padding: 4px; }
.event { display: grid; height: 100%; padding: 6px 8px; border-radius: 6px; border-left: 3px solid var(--navy); background: var(--navy-soft); text-decoration: none; font-size: 12px; line-height: 1.3; }
.event strong { color: var(--navy); font-size: 13px; }
.event span { color: var(--muted); }
.event--bekliyor { border-color: var(--warn); background: #fff2dc; }
.event--tamamlandi { border-color: var(--ok); background: #e3f4ea; }

/* Proforma document */
.doc { display: grid; gap: 24px; max-width: 860px; padding: 40px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); box-shadow: 0 10px 30px rgb(14 19 56 / 0.08); }
.doc__head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 3px solid var(--navy); }
.doc__brand { display: flex; gap: 12px; }
.doc__brand strong { color: var(--navy); font-size: 18px; }
.doc__brand small { display: block; color: var(--muted); font-size: 12px; }
.doc__title h2 { color: var(--red); font-size: 20px; letter-spacing: 0.04em; text-align: right; }
.doc__title dl { margin: 8px 0 0; font-size: 13px; }
.doc__title dl div { display: flex; justify-content: flex-end; gap: 12px; }
.doc__title dt { color: var(--muted); }
.doc__title dd { margin: 0; font-weight: 650; }
.doc__to { display: grid; }
.doc__to small { color: var(--muted); }
.doc__to strong { font-size: 17px; }
.doc__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc__table th { padding: 10px; background: var(--navy); color: var(--white); text-align: left; font-size: 12px; }
.doc__table td { padding: 10px; border-bottom: 1px solid var(--line); }
.doc__table td:nth-child(n + 3), .doc__table th:nth-child(n + 3) { text-align: right; }
.doc__foot { color: var(--muted); font-size: 12px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--white); font-weight: 550; box-shadow: 0 12px 30px rgb(0 0 0 / 0.25); opacity: 0; transform: translate(-50%, 16px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast--info { background: #3d2a00; }
.toast--warn { background: var(--red); }

/* Narrow screens */
@media (max-width: 1100px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .cols--3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 270px; transform: translateX(-100%); transition: transform 0.2s; }
  .side-open .side { transform: none; box-shadow: 0 0 0 100vmax rgb(1 6 63 / 0.45); }
  .menubtn { display: grid; }
  .view { padding: 20px 16px; }
  .pbar { padding: 0 16px; }
  .cols, .grid2 { grid-template-columns: 1fr; }
  .doc { padding: 20px; }
  .doc__head { flex-direction: column; }
  .doc__title h2, .doc__title dl div { text-align: left; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .pbar__title { display: none; }
  .phead h1 { font-size: 24px; }
  .totals { min-width: 0; width: 100%; }
}

@media print {
  .side, .pbar, .phead, .demo-strip, .toast { display: none !important; }
  .shell { display: block; }
  body { background: var(--white); }
  .view { padding: 0; }
  .doc { box-shadow: none; border: 0; }
}
