/* =========================================================================
   Teklif — Finsave-inspired UI
   Beyaz zemin, siyah CTA, terracotta vurgu, Plus Jakarta Sans
   ========================================================================= */

:root {
  --bg: #FFFFFF;
  --bg-alt: #FAFAF8;
  --bg-soft: #F4F2EE;
  --bg-soft-2: #ECE9E2;
  --line: #ECE9E2;
  --line-soft: #F4F2EE;
  --line-strong: #D9D5CB;

  --ink: #0A0A0A;
  --ink-2: #404040;
  --ink-3: #737373;
  --ink-4: #A3A3A3;
  --ink-5: #D4D4D4;

  --tint: #C2410C;            /* Brand */
  --tint-2: #9F3411;
  --tint-soft: #FEF1E8;
  --tint-soft-2: #FCD9C2;

  --teal: #0F766E;            /* For card visualizations only */
  --teal-2: #0D5F58;
  --teal-soft: #ECFDF5;

  --green: #16A34A;
  --green-soft: #DCFCE7;
  --red: #DC2626;
  --red-soft: #FEE2E2;
  --yellow: #F59E0B;
  --yellow-soft: #FEF3C7;
  --blue: #2563EB;
  --blue-soft: #DBEAFE;

  --black: #0A0A0A;

  --font: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --font-mono: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-pill: 999px;

  --nav-h: 56px;
  --tab-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --sidebar-w: 260px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================================================
   Reset
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 1, "ss02" 1, "kern" 1;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tint); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.ic { display: inline-block; vertical-align: middle; flex-shrink: 0; stroke-width: 2; }

/* =========================================================================
   App Shell
   ========================================================================= */
body.app { min-height: 100vh; min-height: 100dvh; }
@media (max-width: 819px) {
  body.app {
    padding-top: calc(var(--nav-h) + var(--safe-top));
    padding-bottom: calc(var(--tab-h) + var(--safe-bottom));
  }
}
@media (min-width: 820px) {
  body.app { padding-left: var(--sidebar-w); }
  .appbar, .tabbar { display: none !important; }
}

/* =========================================================================
   App Bar (mobile)
   ========================================================================= */
.appbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding-top: var(--safe-top);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.appbar.scrolled { border-bottom-color: var(--line); }
.appbar-inner {
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0 12px;
}
.appbar-title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-soft);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms var(--ease), transform 100ms;
}
.bar-btn:active { transform: scale(0.94); background: var(--bg-soft-2); }

.bar-side-right { justify-self: end; }

/* =========================================================================
   Tabbar (mobile bottom nav, 4 tabs)
   ========================================================================= */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
  border: none;
  background: transparent;
  transition: color 150ms;
  position: relative;
}
.tab .ic { color: currentColor; transition: transform 150ms var(--ease-out); }
.tab.active { color: var(--ink); }
.tab.active .ic { color: var(--tint); }
.tab:active { opacity: 0.7; }

/* =========================================================================
   Sidebar (desktop) / Drawer (mobile)
   ========================================================================= */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 16px;
  z-index: 30;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 22px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--ink);
}
.sidebar-brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}
.sidebar-active-co {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 4px 16px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: 14px;
  cursor: pointer;
  transition: background 150ms;
  color: var(--ink);
}
.sidebar-active-co:hover { background: var(--bg-soft-2); }
.sidebar-active-co .glyph {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-active-co .glyph img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-active-co .meta { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar-active-co .lbl { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-active-co .nm {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 2px 4px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 150ms;
}
.sidebar-link:hover { background: var(--bg-soft); color: var(--ink); }
.sidebar-link.active {
  background: var(--ink);
  color: white;
}
.sidebar-link .ic { width: 18px; height: 18px; color: currentColor; }
.sidebar-foot {
  margin-top: auto;
  padding: 14px 12px 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
}
.sidebar-foot .avatar {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--tint);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-foot .info { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar-foot .nm { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .em { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .logout {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--bg-soft);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.sidebar-foot .logout:hover { background: var(--red-soft); color: var(--red); }

@media (max-width: 819px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(86vw, 320px);
    z-index: 70;
    padding-top: calc(18px + var(--safe-top));
    padding-bottom: calc(16px + var(--safe-bottom));
    transition: transform 280ms var(--ease-out);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  }
}
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
@media (min-width: 820px) { .drawer-backdrop { display: none !important; } }

/* =========================================================================
   Content
   ========================================================================= */
.content { width: 100%; }
@media (max-width: 819px) {
  .content { padding: 0 0 24px; }
}
@media (min-width: 820px) {
  .content { padding: 32px 40px 56px; max-width: 1100px; margin: 0 auto; }
}
.section { padding: 0 16px; }
@media (min-width: 820px) { .section { padding: 0; } }

/* =========================================================================
   Hero (dashboard greeting + balance + actions)
   ========================================================================= */
.hero { padding: 16px 16px 8px; }
@media (min-width: 820px) { .hero { padding: 0 0 8px; } }

.greeting {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.greeting .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--tint);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.greeting .text { line-height: 1.2; }
.greeting .text .hi {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.greeting .text .sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 2px;
}

.balance-block { margin-bottom: 22px; }
.balance-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.balance-amount {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.balance-amount .currency {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: -0.5px;
}

.dual-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  border: none;
  background: var(--ink);
  color: white;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: opacity 100ms, transform 80ms;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font);
}
.btn:active { opacity: 0.85; transform: scale(0.98); }
.btn .ic { stroke-width: 2.2; }
.btn-secondary {
  background: var(--bg-soft);
  color: var(--ink);
}
.btn-secondary:active { background: var(--bg-soft-2); }
.btn-tinted {
  background: var(--tint-soft);
  color: var(--tint);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-outline:active { background: var(--bg-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger-filled { background: var(--red); color: white; }
.btn-block { width: 100%; display: flex; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; gap: 6px; }
.btn-md { height: 44px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.btn-lg { height: 54px; font-size: 16px; border-radius: 16px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.btn-icon-sm { width: 32px; height: 32px; padding: 0; border-radius: 9px; }

/* Pill icon button (e.g. "+ New Card") */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms;
}
.pill-btn:hover { background: var(--bg-soft-2); }
.pill-btn .ic { width: 14px; height: 14px; }

/* =========================================================================
   Section header (with action link)
   ========================================================================= */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 12px;
  gap: 12px;
}
.sec-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.sec-head .sec-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.sec-head .sec-action:hover { color: var(--ink); }

/* =========================================================================
   List rows (transaction-style)
   ========================================================================= */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
  position: relative;
  flex-wrap: nowrap;
  min-width: 0;
}
.list-row[data-href] { cursor: pointer; }
.list-row:last-child { border-bottom: none; }
.list-row:active { background: var(--bg-soft); margin: 0 -8px; padding: 14px 8px; border-radius: 10px; }
.list-row .glyph {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.list-row .glyph.tint { background: var(--tint); color: white; }
.list-row .glyph.green { background: var(--green-soft); color: var(--green); }
.list-row .glyph.red { background: var(--red-soft); color: var(--red); }
.list-row .glyph.blue { background: var(--blue-soft); color: var(--blue); }
.list-row .glyph.yellow { background: var(--yellow-soft); color: var(--yellow); }
.list-row .glyph img { width: 100%; height: 100%; object-fit: contain; }
.list-row .info { flex: 1; min-width: 0; }
.list-row .nm {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row .meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row .trail { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.list-row .amount {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.list-row .amount.neg { color: var(--red); }
.list-row .amount.pos { color: var(--green); }
.list-row .chev { color: var(--ink-4); margin-left: 4px; flex-shrink: 0; }
.list-row mark {
  background: var(--yellow-soft);
  color: var(--ink);
  padding: 0 2px;
  border-radius: 3px;
}

/* Row actions (desktop hover-shown) */
.list-row .row-actions {
  display: none;
  gap: 4px;
}
@media (min-width: 820px) {
  .list-row:hover .row-actions { display: flex; }
  .list-row:hover .chev { display: none; }
}
.row-action {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-soft);
  border-radius: 8px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.row-action:hover { background: var(--bg-soft-2); color: var(--ink); }
.row-action.danger:hover { background: var(--red-soft); color: var(--red); }

/* =========================================================================
   Stats card (financial statistics block)
   ========================================================================= */
.stats-card {
  background: var(--bg-soft);
  border-radius: 18px;
  padding: 18px;
}
.stats-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.stats-amount {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
}
.stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: white;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.stats-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: white;
  margin: 8px 0 14px;
}
.stats-bar .seg { height: 100%; }
.stats-bar .seg.ok { background: var(--green); }
.stats-bar .seg.tint { background: var(--tint); }
.stats-bar .seg.warn { background: var(--yellow); }
.stats-bar .seg.muted { background: var(--ink-5); }

.stats-legend { display: flex; flex-wrap: wrap; gap: 16px; }
.stats-legend .item { display: flex; align-items: center; gap: 8px; }
.stats-legend .dot { width: 10px; height: 10px; border-radius: 50%; }
.stats-legend .dot.ok { background: var(--green); }
.stats-legend .dot.tint { background: var(--tint); }
.stats-legend .dot.warn { background: var(--yellow); }
.stats-legend .dot.muted { background: var(--ink-5); }
.stats-legend .lbl { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.stats-legend .val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Stat tiles 4-up */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 820px) { .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
.stat-tile {
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 14px;
}
.stat-tile .lbl { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.stat-tile .val { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat-tile .sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-tile.tint { background: var(--ink); color: white; }
.stat-tile.tint .lbl { color: rgba(255,255,255,0.7); }
.stat-tile.tint .sub { color: rgba(255,255,255,0.6); }

/* =========================================================================
   Quick actions grid (4 icons)
   ========================================================================= */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.quick-action {
  background: var(--bg-soft);
  border: none;
  border-radius: 16px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms, transform 100ms;
  font-family: var(--font);
}
.quick-action:active { transform: scale(0.96); }
.quick-action .glyph {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: white;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.quick-action .lbl { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; }

/* =========================================================================
   Card visualizations (companies)
   ========================================================================= */
.card-viz {
  width: 100%;
  aspect-ratio: 1.586;
  border-radius: 18px;
  background: var(--ink);
  color: white;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.card-viz.tint { background: linear-gradient(135deg, var(--tint), var(--tint-2)); }
.card-viz.dark { background: linear-gradient(135deg, #1a1a1a, #2a2a2a); }
.card-viz.green { background: linear-gradient(135deg, var(--teal), var(--teal-2)); }
.card-viz::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
}
.card-viz .head { display: flex; justify-content: space-between; align-items: flex-start; }
.card-viz .name { font-size: 13px; font-weight: 700; opacity: 0.9; }
.card-viz .brand { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.card-viz .num { font-size: 14px; font-family: var(--font-mono); letter-spacing: 1px; opacity: 0.85; }
.card-viz .foot { display: flex; justify-content: space-between; align-items: flex-end; }
.card-viz .holder { font-size: 11px; font-weight: 500; opacity: 0.7; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.card-viz .holder-name { font-size: 13px; font-weight: 700; }

/* Companies grid */
.company-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) {
  .company-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .company-grid { grid-template-columns: repeat(3, 1fr); }
}
.company-item { display: flex; flex-direction: column; gap: 10px; }
.company-item .actions { display: flex; gap: 6px; }
.company-item .actions .btn { flex: 1; }
.company-item.active .card-viz { box-shadow: 0 0 0 3px var(--tint); }

/* =========================================================================
   Forms
   ========================================================================= */
.field {
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: -0.1px;
}
.field-hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
}
.input, .select, .textarea {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.1px;
  color: var(--ink);
  transition: border-color 120ms, background 120ms;
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  background: white;
  border-color: var(--ink);
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.5;
}
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
  cursor: pointer;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 480px) { .field-row.three { grid-template-columns: 1fr 1fr; } }

/* Form group card (white card containing fields) */
.form-card {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.form-card .field-label { color: var(--ink-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.form-card .input, .form-card .textarea, .form-card .select {
  background: white;
  border: 1px solid transparent;
}

/* =========================================================================
   Search field
   ========================================================================= */
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 0 14px;
  height: 46px;
  margin-bottom: 12px;
}
.search-field .ic { color: var(--ink-3); }
.search-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  height: 100%;
  font-family: var(--font);
}
.search-field input::placeholder { color: var(--ink-3); }

/* =========================================================================
   Filter chips (horizontal scroll)
   ========================================================================= */
.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 150ms;
  font-family: var(--font);
  white-space: nowrap;
}
.chip:hover { background: var(--bg-soft); }
.chip.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.chip .count { margin-left: 4px; opacity: 0.65; font-weight: 500; }

/* =========================================================================
   Badge / status pill
   ========================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1px;
  background: var(--bg-soft);
  color: var(--ink-2);
  text-transform: uppercase;
  font-family: var(--font);
}
.badge-draft { background: var(--bg-soft); color: var(--ink-3); }
.badge-sent { background: var(--blue-soft); color: var(--blue); }
.badge-accepted { background: var(--green-soft); color: var(--green); }
.badge-rejected { background: var(--red-soft); color: var(--red); }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-success .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* =========================================================================
   Alerts (top banner)
   ========================================================================= */
.alert {
  margin: 12px 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
@media (min-width: 820px) { .alert { margin: 12px 0; } }
.alert-success { background: var(--green-soft); color: #14532D; }
.alert-error { background: var(--red-soft); color: #7F1D1D; }
.alert-info { background: var(--blue-soft); color: #1E3A8A; }
.alert .ic { flex-shrink: 0; margin-top: 2px; }

/* =========================================================================
   Empty state
   ========================================================================= */
.empty-state {
  padding: 56px 24px;
  text-align: center;
}
.empty-state .glyph {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--bg-soft);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.empty-state h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0 0 6px;
}
.empty-state p { color: var(--ink-3); margin: 0 0 20px; font-size: 14px; }

/* =========================================================================
   Customer / Quote picker tappable card
   ========================================================================= */
.picker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 150ms;
  border: 1px solid transparent;
  font-family: var(--font);
}
.picker:active, .picker:hover { background: var(--bg-soft-2); }
.picker .glyph {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: white;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
}
.picker.has-value .glyph { background: var(--tint); color: white; }
.picker .info { flex: 1; min-width: 0; }
.picker .nm {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.picker .placeholder { font-size: 15px; color: var(--ink-3); font-weight: 500; }
.picker .meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker .chev { color: var(--ink-4); flex-shrink: 0; }

/* =========================================================================
   Form Header (logo + TEKLİF FORMU)
   ========================================================================= */
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 18px;
  gap: 12px;
}
.form-header .left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.form-header .logo-box {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--bg-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}
.form-header .logo-box img { width: 100%; height: 100%; object-fit: contain; }
.form-header .logo-box .logo-svg-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 0;
}
.form-header .logo-box .logo-svg-inline svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}
.form-header .co-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.form-header .co-sub {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.form-header .right { text-align: right; flex-shrink: 0; }
.form-header .doc-label {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  line-height: 1;
}
.form-header .doc-num {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-3);
  margin-top: 4px;
  font-weight: 600;
}
@media (min-width: 820px) {
  .form-header { padding: 22px 24px; }
  .form-header .doc-label { font-size: 19px; }
  .form-header .logo-box { width: 60px; height: 60px; font-size: 24px; }
  .form-header .co-name { font-size: 16px; }
}

/* =========================================================================
   Items (quote line items) — beyaz kart, etiketli grid + siyah tutar hücresi
   ========================================================================= */
.items-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-row {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  transition: border-color 150ms, box-shadow 150ms;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.item-row:focus-within {
  border-color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.item-row-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.item-num {
  width: 24px;
  flex-shrink: 0;
  padding-top: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-align: center;
}
.item-desc {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
  outline: none;
  resize: none;
  font-family: var(--font);
  line-height: 1.4;
  padding: 4px 0;
  overflow: hidden;
  min-width: 0;
}
.item-desc::placeholder { color: var(--ink-4); font-weight: 600; }
.item-rm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 150ms;
}
.item-rm:hover { background: var(--red); color: white; }

.item-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.9fr 1.4fr;
  gap: 6px;
  padding-left: 34px;
}
@media (max-width: 600px) {
  .item-grid { grid-template-columns: 1fr 1fr; padding-left: 0; }
}
.item-cell {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  transition: background 150ms;
  min-width: 0;
}
.item-cell:focus-within { background: var(--bg-soft-2); }
.item-cell label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.item-cell input {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}
.item-cell.total-cell {
  background: var(--ink);
  color: white;
}
.item-cell.total-cell label { color: rgba(255,255,255,0.55); }
.item-cell.total-cell .total-val {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-add {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: white;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  font-family: var(--font);
  transition: all 150ms;
}
.item-add:hover { border-color: var(--ink); color: var(--ink); background: var(--bg-soft); }

/* =========================================================================
   Totals — beyaz kart sıralı satırlar + siyah Genel Toplam hero
   ========================================================================= */
.totals-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  gap: 12px;
}
.total-line .lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink-2);
}
.total-line .val {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 15px;
  white-space: nowrap;
}
.total-line.grand {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  padding: 20px 22px;
  margin-top: 4px;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.total-line.grand .lbl {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.total-line.grand .val {
  color: white;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  text-align: right;
  align-self: flex-end;
  line-height: 1;
}
@media (min-width: 480px) {
  .total-line.grand {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .total-line.grand .lbl { font-size: 13px; }
  .total-line.grand .val { font-size: 30px; align-self: auto; }
}
.vat-input {
  width: 56px !important;
  border: 1px solid var(--line) !important;
  background: var(--bg-soft) !important;
  border-radius: 8px !important;
  padding: 5px 10px !important;
  text-align: center;
  font-size: 13px !important;
  font-weight: 700;
  height: auto !important;
  outline: none;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: all 120ms;
  -webkit-appearance: none;
}
.vat-input:focus {
  border-color: var(--ink) !important;
  background: white !important;
  box-shadow: 0 0 0 2px var(--ink);
}

/* =========================================================================
   Modal — bottom sheet on mobile, centered on desktop
   ========================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; animation: fadeIn 200ms; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: white;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
  animation: slideUp 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal::before {
  content: '';
  width: 40px; height: 5px;
  border-radius: 999px;
  background: var(--ink-5);
  margin: 10px auto 0;
  flex-shrink: 0;
}

.modal-head {
  padding: 8px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 8px;
}
.modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.modal-head .pill-btn { color: var(--tint); background: var(--tint-soft); }

.modal-search-field {
  margin: 0 16px 8px;
  background: var(--bg-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 44px;
  flex-shrink: 0;
}
.modal-search-field .ic { color: var(--ink-3); }
.modal-search-field input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font);
  height: 100%;
}

.modal-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px;
}
.modal-list .item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: opacity 100ms;
}
.modal-list .item:last-child { border-bottom: none; }
.modal-list .item:active { opacity: 0.7; }
.modal-list .item .nm { font-size: 15px; font-weight: 700; }
.modal-list .item .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.modal-list .empty { padding: 32px 16px; text-align: center; color: var(--ink-3); font-size: 14px; }

.inline-form {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  flex-shrink: 0;
  background: var(--bg-alt);
}
.inline-form h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-3);
}
.inline-form .field { margin-bottom: 8px; }
.inline-form .input { background: white; }

.modal-foot {
  padding: 12px 16px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.modal-foot .btn { flex: 1; }

@media (min-width: 820px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal {
    border-radius: 20px;
    max-height: 84vh;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.18);
    animation: zoomIn 200ms;
  }
  .modal::before { display: none; }
  @keyframes zoomIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
}

/* =========================================================================
   Auth (login / register)
   ========================================================================= */
body.auth { background: var(--bg); padding: 0; min-height: 100vh; min-height: 100dvh; }
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: max(env(safe-area-inset-top), 32px) 24px max(env(safe-area-inset-bottom), 32px);
  max-width: 420px;
  margin: 0 auto;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 32px;
}
.auth-brand .mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.auth-form h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0 0 6px;
  line-height: 1.15;
}
.auth-form > p { color: var(--ink-3); font-size: 14px; margin: 0 0 24px; }
.alt-link {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--ink-3);
}
.alt-link a { color: var(--tint); font-weight: 700; }

/* =========================================================================
   Quote preview / print
   ========================================================================= */
body.preview-page-body {
  background: var(--bg-soft);
  padding: 0;
  font-family: var(--font);
  min-height: 100vh;
  min-height: 100dvh;
}
.preview-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: max(env(safe-area-inset-top), 10px) 12px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.preview-toolbar .spacer { flex: 1; text-align: center; }
.preview-toolbar .spacer .num { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.preview-canvas { padding: 16px; display: flex; justify-content: center; }
.preview-page {
  background: white;
  width: 100%;
  max-width: 820px;
  border-radius: 14px;
  padding: 24px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 100px);
}
@media (min-width: 820px) {
  .preview-page { width: 210mm; min-height: 297mm; padding: 18mm 16mm; font-size: 11pt; }
}
.preview-page > .page-bottom { margin-top: auto; }
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.logo-area img { max-height: 50px; max-width: 160px; object-fit: contain; }
.logo-area .logo-svg { display: inline-block; max-width: 160px; max-height: 50px; line-height: 0; }
.logo-area .logo-svg svg { max-width: 100%; max-height: 50px; width: auto; height: auto; display: block; }
.logo-area .text-logo { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.doc-title { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -0.4px; line-height: 1; text-transform: uppercase; }
.doc-meta { text-align: right; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.doc-meta .num { font-family: var(--font-mono); font-weight: 700; color: var(--ink); font-size: 13px; }

/* Müşteri + Tarihler */
.info-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  margin-bottom: 22px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 480px) {
  .info-row { grid-template-columns: 1fr; gap: 16px; }
}
.info-row .info-block h4 {
  margin: 0 0 6px;
  font-size: 9pt;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-3);
  font-weight: 700;
}
.info-row .info-block .name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--ink);
}
.info-row .info-block .info {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.55;
}
.info-row .info-block.right {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  text-align: right;
}
.info-row .info-block.right .info-pair { min-width: 110px; }
.info-row .info-block.right .value {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
@media (max-width: 480px) {
  .info-row .info-block.right { gap: 12px; flex-wrap: wrap; text-align: left; }
  .info-row .info-block.right .info-pair { min-width: 0; flex: 1; }
}

.items-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 12px; }
.items-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-3); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.items-table td { padding: 10px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.items-table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.items-table .item-no { width: 28px; color: var(--ink-3); font-family: var(--font-mono); font-size: 10px; }

/* Toplamlar — sağa hizalı, dar kolon */
.totals-summary {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 22px;
}
.totals-summary .nums {
  width: 280px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.totals-summary .nums .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  gap: 16px;
}
.totals-summary .nums .row label { color: var(--ink-2); font-family: var(--font); font-weight: 500; }
.totals-summary .nums .row span { font-variant-numeric: tabular-nums; }
.totals-summary .nums .row.total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  font-weight: 800;
}
.totals-summary .nums .row.total label { color: var(--ink); font-weight: 800; }
@media (max-width: 600px) {
  .totals-summary { justify-content: stretch; }
  .totals-summary .nums { width: 100%; }
}

/* Notlar/Şartlar bloğu (footer'in hemen üstünde) */
.notes-block { margin-bottom: 18px; padding-top: 8px; }
.notes-block .note-item { margin-bottom: 14px; }
.notes-block .note-item:last-child { margin-bottom: 0; }
.notes-block h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 5px;
  color: var(--ink-3);
  font-weight: 700;
}
.notes-block p { margin: 0; font-size: 11px; color: var(--ink); line-height: 1.55; white-space: pre-wrap; }

.signed-by { padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; margin-bottom: 18px; }
.signed-by .label { color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.4px; font-size: 10px; margin-bottom: 4px; font-weight: 700; }
.signed-by .name { font-weight: 700; }
.signed-by .title { color: var(--ink-3); }
.doc-foot { padding-top: 14px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-3); text-align: center; }
.doc-foot .info-bits { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.doc-foot .info-bits span { display: inline-flex; align-items: center; gap: 4px; }
.doc-foot .socials { margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.doc-foot .social-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--ink-2);
  font-weight: 600;
}
.doc-foot .social-pill .ic { color: var(--ink-2); }

@media print {
  body { background: white !important; }
  body.app .appbar, body.app .tabbar, body.app .sidebar, .drawer-backdrop, .preview-toolbar, .alert { display: none !important; }
  body.app { padding: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .preview-canvas { padding: 0 !important; }
  .preview-page { box-shadow: none !important; border-radius: 0 !important; padding: 14mm !important; max-width: none !important; }
  @page { size: A4; margin: 0; }
}

/* =========================================================================
   Detail page layout (customer-detail, etc.)
   ========================================================================= */
.detail-hero {
  text-align: center;
  padding: 24px 16px 8px;
}
.detail-hero .glyph {
  width: 72px; height: 72px;
  border-radius: 22px;
  background: var(--tint);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 30px;
  margin-bottom: 14px;
}
.detail-hero h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
}
.detail-hero p { color: var(--ink-3); margin: 0; font-size: 14px; }
.detail-hero .actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.detail-hero .actions .pill-btn { background: var(--bg-soft); padding: 10px 16px; }

/* =========================================================================
   Helpers
   ========================================================================= */
.muted { color: var(--ink-3); }
.center { text-align: center; }
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; gap: 8px; }
.flex-1 { flex: 1; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }

.large-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 16px 16px 4px;
  line-height: 1.15;
}
.large-title-sub {
  margin: 0 16px 16px;
  color: var(--ink-3);
  font-size: 14px;
}
@media (min-width: 820px) {
  .large-title { margin: 0 0 4px; }
  .large-title-sub { margin: 0 0 24px; }
}
