:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #fafafa;
  --text: #17191f;
  --muted: #6b7280;
  --line: #e5e7eb;
  --red: #e30613;
  --red-dark: #b8000b;
  --ink: #242a33;
  --green: #1b8f4d;
  --amber: #b7791f;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 15% 0%, rgba(227, 6, 19, 0.12), transparent 30%), var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  background: rgba(244, 245, 247, 0.86);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(227, 6, 19, 0.26);
}
.brand-mark.small-mark { width: 38px; height: 38px; border-radius: 12px; }
.brand-title { font-weight: 800; letter-spacing: -0.03em; }
.brand-subtitle { color: var(--muted); font-size: 12px; margin-top: 2px; }
.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}
.nav-btn, .admin-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
}
.nav-btn.active, .admin-tab.active {
  background: var(--ink);
  color: white;
}
.topbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.primary-btn, .ghost-btn, .danger-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.primary-btn { background: var(--red); color: white; box-shadow: 0 12px 22px rgba(227, 6, 19, 0.22); }
.primary-btn:hover, .ghost-btn:hover, .danger-btn:hover { transform: translateY(-1px); }
.ghost-btn { background: white; color: var(--ink); border: 1px solid var(--line); }
.danger-btn { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.primary-btn.full { width: 100%; }
.small { padding: 8px 12px; font-size: 12px; }
main { padding: 28px 32px 52px; }
.hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
  padding: 32px;
  border-radius: 32px;
  background: linear-gradient(135deg, #17191f, #323946 52%, #e30613 160%);
  color: white;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.hero-copy { max-width: 900px; position: relative; z-index: 1; }
.eyebrow {
  text-transform: uppercase;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
}
.hero-card .eyebrow { color: #ffb7bd; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(32px, 5vw, 62px); line-height: 0.96; letter-spacing: -0.06em; margin-bottom: 16px; }
h2 { font-size: 22px; letter-spacing: -0.04em; margin-bottom: 0; }
h3 { font-size: 18px; letter-spacing: -0.03em; margin-bottom: 8px; }
p { color: var(--muted); line-height: 1.6; }
.hero-card p { color: rgba(255,255,255,.75); max-width: 760px; }
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  gap: 10px;
  position: relative;
  z-index: 1;
}
.hero-metrics div {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.hero-metrics span { display:block; font-size: 28px; font-weight: 900; }
.hero-metrics small { color: rgba(255,255,255,.72); }
.card {
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(229, 231, 235, 0.92);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.config-grid {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(360px, 1fr) minmax(330px, 390px);
  gap: 24px;
  align-items: start;
}
.left-panel, .center-panel, .right-panel { padding: 24px; }
.sticky-summary { position: sticky; top: 102px; }
.panel-title-row, .summary-head, .visual-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-title-row.compact { margin-top: 4px; }
.pill, .status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}
.status-dot { background: #f9fafb; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.machine-list { display: grid; gap: 12px; }
.machine-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  width: 100%;
  transition: border .15s ease, box-shadow .15s ease, transform .15s ease;
}
.machine-card:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(17, 24, 39, 0.06); }
.machine-card.active { border-color: var(--red); box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.08); }
.machine-card strong { display: block; font-size: 15px; margin-bottom: 4px; }
.machine-card small { color: var(--muted); }
.machine-card .machine-code { color: var(--red); font-weight: 900; margin-bottom: 7px; display: block; }
.option-groups { display: grid; gap: 14px; }
.option-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: white;
}
.option-group summary {
  list-style: none;
  padding: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 900;
}
.option-group summary::-webkit-details-marker { display: none; }
.option-group summary span { color: var(--muted); font-size: 12px; font-weight: 700; }
.option-list { display: grid; gap: 10px; padding: 0 14px 14px; }
.option-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.option-item.with-image {
  grid-template-columns: auto 86px 1fr auto;
}
.option-item.disabled {
  opacity: 0.46;
  background: #f9fafb;
}
.option-item input { margin-top: 3px; accent-color: var(--red); }
.option-item strong { display: block; font-size: 14px; }
.option-item small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.option-copy { min-width: 0; }
.option-media {
  width: 86px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f3f4f6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.option-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.option-price { color: var(--ink); font-weight: 900; font-size: 13px; white-space: nowrap; }
.machine-stage {
  position: relative;
  min-height: 430px;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(#f4f8ff, #eef2f7 48%, #dfe8d7 48%, #bac9a9);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.field-lines { position: absolute; inset: 48% 0 0; opacity: .38; background: repeating-linear-gradient(100deg, transparent 0 38px, rgba(95, 72, 40, .34) 39px 43px); }
.machine-visual {
  position: absolute;
  width: min(72%, 620px);
  height: 240px;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
}
.drill-bin {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 28px;
  height: 72px;
  border-radius: 20px 20px 12px 12px;
  background: linear-gradient(180deg, #ff242f, #c9000b);
  box-shadow: inset 0 10px 0 rgba(255,255,255,.18), 0 22px 28px rgba(80, 0, 0, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  letter-spacing: .08em;
}
.drill-frame {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 112px;
  height: 26px;
  border-radius: 12px;
  background: #b70710;
  box-shadow: 0 22px 0 -7px #9d0710;
}
.drill-wheel {
  position: absolute;
  bottom: 32px;
  width: 68px;
  height: 68px;
  background: #111827;
  border: 10px solid white;
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px #374151, 0 12px 18px rgba(17,24,39,.24);
}
.drill-wheel.left { left: 5%; }
.drill-wheel.right { right: 5%; }
.drill-tines {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  height: 108px;
}
.tine {
  width: 5px;
  height: var(--h, 68px);
  background: linear-gradient(#e5e7eb, #6b7280);
  transform: skewX(-13deg);
  border-radius: 999px;
  box-shadow: 8px 8px 0 -5px rgba(107,114,128,.35);
}
.drill-marker {
  position: absolute;
  right: 8%;
  top: 10px;
  width: 6px;
  height: 110px;
  background: #9d0710;
  transform: rotate(-20deg);
  transform-origin: bottom;
  border-radius: 999px;
}
.visual-badges {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.visual-badge {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(229, 231, 235, .9);
  font-weight: 800;
  font-size: 12px;
}
.spec-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.spec-card {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.spec-card small { display:block; color: var(--muted); margin-bottom: 7px; }
.spec-card strong { font-size: 18px; letter-spacing: -0.03em; }
.notice-stack { display: grid; gap: 10px; margin-top: 16px; }
.notice {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #7c2d12;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.45;
}
.notice.error { border-color: #fecdd3; background: #fff1f2; color: #9f1239; }
.price-box {
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, #17191f, #3c4452);
  color: white;
  margin-bottom: 18px;
}
.price-box small, .price-box span { display: block; color: rgba(255,255,255,.66); }
.price-box strong { display: block; font-size: 36px; letter-spacing: -0.06em; margin: 5px 0; }
.summary-list { display: grid; gap: 10px; margin: 0 0 16px; }
.summary-list div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.summary-list dt { color: var(--muted); font-size: 13px; }
.summary-list dd { margin: 0; text-align: right; font-weight: 800; font-size: 13px; }
.code-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f9fafb;
  margin-bottom: 16px;
}
.code-card small { color: var(--muted); display:block; margin-bottom: 7px; }
.code-card code { font-weight: 900; white-space: normal; line-height: 1.45; }
.lead-form { display: grid; gap: 12px; }
.lead-form label, .field label, .admin-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; color: var(--ink); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 12px 13px;
  outline: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.08); }
.admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
.admin-sidebar {
  padding: 18px;
  position: sticky;
  top: 102px;
  display: grid;
  gap: 8px;
}
.admin-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.admin-profile small { display:block; color: var(--muted); margin-top: 3px; }
.admin-tab { text-align: left; border-radius: 14px; width: 100%; }
.admin-content { display: grid; gap: 20px; }
.admin-card { padding: 24px; }
.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kpi-card { padding: 20px; border:1px solid var(--line); border-radius: 18px; background:#fff; }
.kpi-card small { color:var(--muted); display:block; margin-bottom:8px; }
.kpi-card strong { font-size:30px; letter-spacing:-.05em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; background:white; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align:left; font-size: 13px; vertical-align: top; }
th { background:#f9fafb; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; font-size:11px; }
tr:last-child td { border-bottom:0; }
.inline-actions { display:flex; gap:8px; flex-wrap:wrap; }
.admin-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.admin-form .wide { grid-column: span 2; }
.admin-form .full-row { grid-column: 1 / -1; }
.form-note {
  grid-column: span 2;
  font-size: 12px;
  color: var(--muted);
  align-self: center;
}
.admin-thumb {
  width: 92px;
  height: 68px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f3f4f6;
}
.thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 68px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #f9fafb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 8px;
}
.json-editor {
  min-height: 420px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.brief-page { padding: clamp(24px, 5vw, 56px); max-width: 1100px; margin: 0 auto; }
.brief-page h1 { color: var(--ink); max-width: 850px; }
.brief-grid { display:grid; grid-template-columns: repeat(3,1fr); gap:16px; margin-top:24px; }
.brief-box { border:1px solid var(--line); border-radius:20px; padding:22px; background:#fff; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  background: #111827;
  color:white;
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-weight: 800;
  animation: pop .2s ease;
}
@keyframes pop { from { transform: translateY(12px); opacity:0;} to { transform: translateY(0); opacity:1;} }
.badge-soft { display:inline-flex; padding:5px 9px; border-radius:999px; font-weight:800; font-size:12px; background:#f3f4f6; }
.badge-soft.green { background:#ecfdf5; color:#166534; }
.badge-soft.red { background:#fff1f2; color:#be123c; }
.badge-soft.amber { background:#fffbeb; color:#92400e; }

@media (max-width: 1200px) {
  .topbar { grid-template-columns: 1fr; justify-items: stretch; }
  .main-nav, .topbar-actions { justify-content: center; }
  .config-grid { grid-template-columns: 1fr; }
  .sticky-summary, .admin-sidebar { position: static; }
  .spec-summary, .admin-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 760px) {
  main, .topbar { padding-left: 16px; padding-right: 16px; }
  .hero-card { grid-template-columns: 1fr; padding:24px; }
  .hero-metrics { grid-template-columns: repeat(3, 1fr); }
  .main-nav, .topbar-actions { overflow-x: auto; justify-content: flex-start; }
  .spec-summary, .brief-grid, .admin-layout, .admin-form { grid-template-columns: 1fr; }
  .admin-form .wide, .admin-form .full-row, .form-note { grid-column: auto; }
  .option-item.with-image { grid-template-columns: auto 1fr; }
  .option-item.with-image .option-media { grid-column: 2; }
  .option-item.with-image .option-copy { grid-column: 2; }
  .option-item.with-image .option-price { grid-column: 2; }
  .machine-stage { min-height: 330px; }
  .machine-visual { width: 92%; transform: translateX(-50%) scale(.82); bottom: 30px; }
  .summary-list div { grid-template-columns: 1fr; }
  .summary-list dd { text-align:left; }
}

/* E-Tablo entegrasyon sürümü */
.machine-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}
.machine-card strong {
  text-transform: capitalize;
}
.option-group[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.quote-page {
  max-width: 1180px;
  margin: 0 auto;
}
.quote-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}
.quote-paper {
  background: #fff;
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: clamp(24px, 4vw, 48px);
}
.quote-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 3px solid var(--ink);
  margin-bottom: 28px;
}
.quote-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.quote-logo span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--red);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}
.quote-logo strong {
  display: block;
  font-size: 24px;
  letter-spacing: .04em;
}
.quote-logo small, .quote-meta small, .quote-price-card span, .quote-info-grid small {
  display: block;
  color: var(--muted);
}
.quote-meta {
  text-align: right;
  display: grid;
  gap: 4px;
  align-content: start;
}
.quote-title-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}
.quote-title-block h1 {
  color: var(--ink);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}
.quote-price-card {
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #17191f, #3c4452);
  color: white;
}
.quote-price-card small, .quote-price-card span { color: rgba(255,255,255,.68); }
.quote-price-card strong {
  display: block;
  font-size: 34px;
  letter-spacing: -.06em;
  margin: 4px 0;
}
.quote-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.quote-info-grid div {
  padding: 16px;
  border-radius: 16px;
  background: #f9fafb;
  border: 1px solid var(--line);
}
.quote-info-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.35;
}
.quote-table {
  min-width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.quote-table th, .quote-table td {
  font-size: 12px;
}
.quote-table td:last-child, .quote-table th:last-child {
  text-align: right;
  font-weight: 800;
}
.quote-bottom {
  display: grid;
  grid-template-columns: minmax(0,1fr) 340px;
  gap: 22px;
  align-items: start;
  margin-top: 24px;
}
.quote-notes {
  padding: 18px;
  border-radius: 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.quote-notes p {
  font-size: 13px;
  margin-bottom: 8px;
}
.quote-total-box {
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.quote-total-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.quote-total-box div:last-child { border-bottom: 0; }
.quote-total-box .grand {
  background: var(--ink);
  color: white;
}
.quote-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 32px;
}
.quote-signatures div {
  height: 96px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

@media (max-width: 900px) {
  .quote-title-block, .quote-bottom, .quote-info-grid, .quote-signatures { grid-template-columns: 1fr; }
  .quote-header { flex-direction: column; }
  .quote-meta { text-align: left; }
}

@media print {
  body { background: white; }
  .topbar, .no-print, .hero-card, .admin-sidebar { display: none !important; }
  main { padding: 0; }
  .quote-page { max-width: none; }
  .quote-paper { box-shadow: none; border: 0; border-radius: 0; padding: 12mm; }
  .quote-title-block { grid-template-columns: 1fr 68mm; }
  .quote-bottom { grid-template-columns: 1fr 72mm; }
  .quote-info-grid { grid-template-columns: repeat(4, 1fr); }
  .quote-signatures { grid-template-columns: repeat(3, 1fr); }
}
