/* Tavsiye İşletme — tokens, type and the app shell.
   Direction: warm receipt paper and Tavsiye green. A till is a bright, busy place, so the light theme leads; the
   dark one follows the device. Numbers are tabular everywhere money is shown. */

@font-face { font-family: "Onest"; src: url("../fonts/Onest-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/Onest-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/Onest-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/Onest-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f3efe6;
  --paper-deep: #e9e3d6;
  --surface: #fffdf8;
  --surface-sunk: #f7f3ea;
  --ink: #16191a;
  --ink-2: #555b5f;
  --ink-3: #8b9094;
  --line: #e2dccf;
  --line-strong: #cfc7b6;

  --brand: #1f9d63;
  --brand-strong: #157a4c;
  --brand-tint: #dff3e8;
  --brand-deep: #0b5c43;
  --brand-glow: #3dbf82;
  --on-brand: #ffffff;

  --danger: #c2372c;
  --danger-tint: #fbe7e4;
  --warn: #a75a06;
  --warn-tint: #fdf0dc;
  --info: #2c58c4;
  --info-tint: #e7eefc;
  --success: var(--brand-strong);
  --success-tint: var(--brand-tint);

  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
  --text-hero: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  --text-figure: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --gutter: clamp(16px, 2.5vw, 32px);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-1: 0 1px 0 rgba(22, 25, 26, 0.04), 0 1px 2px rgba(22, 25, 26, 0.06);
  --shadow-2: 0 2px 4px rgba(22, 25, 26, 0.05), 0 12px 32px -12px rgba(22, 25, 26, 0.22);
  --shadow-3: 0 24px 64px -20px rgba(11, 48, 34, 0.45);

  --duration-fast: 140ms;
  --duration: 260ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --rail: 232px;
  --tabbar: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0f1211;
    --paper-deep: #0a0c0b;
    --surface: #181c1a;
    --surface-sunk: #131715;
    --ink: #f1f0ea;
    --ink-2: #aeb3ae;
    --ink-3: #7c827d;
    --line: #2a302d;
    --line-strong: #3a423e;
    --brand: #3dbf82;
    --brand-strong: #5fd39c;
    --brand-tint: #133325;
    --brand-deep: #0b5c43;
    --on-brand: #06130d;
    --danger: #ff7a6b;
    --danger-tint: #3a1814;
    --warn: #f0a548;
    --warn-tint: #36240c;
    --info: #8aa8ff;
    --info-tint: #18223d;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.3);
    --shadow-2: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
    --shadow-3: 0 24px 64px -20px rgba(0, 0, 0, 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.num, .figure, td.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: var(--text-sm); }
.spacer { flex: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

.skip-link { position: absolute; left: var(--space-3); top: -48px; padding: var(--space-2) var(--space-3); background: var(--ink); color: var(--paper); border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: var(--space-3); }
.noscript { padding: var(--space-6); text-align: center; }

.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: var(--space-3); color: var(--ink-2); }
.boot-mark, .brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--brand-deep); color: #fff; font-weight: 700; font-size: 20px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

/* ---- app shell: top bar, left rail on wide screens, tab bar on phones -------------------------------------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: var(--rail) 1fr; grid-template-rows: auto 1fr; }
.topbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-business { display: grid; line-height: 1.2; min-width: 0; }
.topbar-business strong { font-size: var(--text-lg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-business span { font-size: var(--text-xs); color: var(--ink-2); letter-spacing: 0.04em; text-transform: uppercase; }
.topbar-user { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--ink-2); }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-tint); color: var(--brand-strong); font-weight: 700; font-size: var(--text-sm);
}

.rail { padding: var(--space-5) var(--space-3); border-right: 1px solid var(--line); }
.rail nav { position: sticky; top: 88px; display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-3); border-radius: 12px;
  color: var(--ink-2); text-decoration: none; font-weight: 600;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.nav-link svg { width: 20px; height: 20px; flex: none; }
.nav-link:hover { background: var(--surface-sunk); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--ink); color: var(--paper); }
.nav-link[aria-current="page"] svg { color: var(--brand-glow); }

.main { padding: var(--space-6) var(--gutter) var(--space-7); min-width: 0; max-width: 1180px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3); margin-bottom: var(--space-5); }
.page-head h1 { font-size: var(--text-xl); }
.page-head p { color: var(--ink-2); max-width: 60ch; }
.page-head .page-title { display: grid; gap: var(--space-1); }
.page-head .select { width: auto; min-width: 160px; }
.eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-strong); }

@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .rail {
    position: fixed; inset: auto 0 0 0; z-index: 30; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px);
  }
  .rail nav { position: static; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
  .nav-link { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; border-radius: 10px; text-align: center; }
  .nav-link[aria-current="page"] { background: var(--brand-tint); color: var(--brand-strong); }
  .nav-link[aria-current="page"] svg { color: var(--brand-strong); }
  .topbar-user .user-name { display: none; }
  .main { padding-top: var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
