:root {
  --ink: #1a1c1c;
  --teal: #00938a;
  --mint: #c0fff9;
  --panel: #f4fbfa;
  --line: #d5ebe8;
  --deep: #0c6f68;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background: #dfeeed;
  font-family: "Century Gothic", CenturyGothic, "Trebuchet MS", "Segoe UI", sans-serif;
}

.app {
  display: grid;
  grid-template-columns: 400px 1fr;
  min-height: 100vh;
}

.form-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 28px 22px 40px;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  max-height: 100vh;
}

.form-panel::-webkit-scrollbar {
  width: 10px;
}

.form-panel::-webkit-scrollbar-track {
  background: #e5f2f0;
}

.form-panel::-webkit-scrollbar-thumb {
  background: #9bc9c4;
  border-radius: 8px;
  border: 2px solid #e5f2f0;
}

.eyebrow {
  margin: 0;
  color: var(--deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.form-head h1 {
  margin: 6px 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.lead, .hint {
  margin: 0;
  color: #3d5552;
  font-size: 14px;
  line-height: 1.45;
}

.block { margin-top: 26px; }

.block h2 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--deep);
}

.field { margin-bottom: 12px; }

label, .route-head {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #24524e;
}

input {
  width: 100%;
  border: 1px solid #c5ddd9;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 9px 10px;
}

input:focus {
  outline: 2px solid var(--deep);
  border-color: transparent;
}

.route-head,
.route {
  display: grid;
  grid-template-columns: 1.2fr 0.75fr 0.85fr 46px;
  gap: 6px;
}

.route { margin-bottom: 6px; }

.remove {
  padding: 0;
  border: 1px solid #e4b4b4;
  background: #fff;
  color: #9a3030;
  font-size: 12px;
}

.add-route {
  width: 100%;
  margin-top: 4px;
  background: #fff;
  color: var(--deep);
  border: 1px dashed #8fc4be;
}

.route-head span {
  font-size: 11px;
  font-weight: 700;
  color: #5d7673;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

button {
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 11px 14px;
}

.primary {
  flex: 1;
  background: var(--deep);
  color: #fff;
}

.primary:hover { background: #095e58; }
button:disabled { opacity: 0.65; cursor: wait; }

.ghost {
  background: transparent;
  color: var(--deep);
  border: 1px solid #b7d9d5;
}

.hint { margin-top: 12px; font-size: 12px; }

.preview {
  overflow: auto;
  padding: 28px 20px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.sheet {
  position: relative;
  width: 210mm;
  height: 297mm;
  flex: 0 0 auto;
  background: #fff;
  color: #111;
  box-shadow: 0 12px 40px rgba(16, 48, 46, 0.16);
  padding: 11mm 13mm 0;
  overflow: hidden;
}

.banner {
  display: block;
  width: 100%;
  height: 31mm;
  object-fit: cover;
  object-position: center;
}

.identity,
.contacts {
  display: grid;
  grid-template-columns: 1fr 52mm;
  column-gap: 6mm;
  align-items: start;
}

.identity { margin-top: 6mm; }

.company {
  margin: 0;
  font-size: 11.5pt;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.slogan {
  margin: 1.4mm 0 0;
  font-size: 7.5pt;
  font-style: italic;
}

.tarih {
  margin: 4mm 0 0;
  font-size: 8pt;
  white-space: nowrap;
}

.tarih span { font-weight: 700; font-style: italic; }

.contacts { margin-top: 5.5mm; align-items: flex-start; }

.addr p {
  margin: 0 0 1.1mm;
  font-size: 8.4pt;
  line-height: 1.2;
}

.under {
  display: table;
  border-bottom: 0.4pt solid #222;
  padding-bottom: 0.2mm;
}

.valid {
  margin-top: 0.4mm;
  text-align: left;
}

.valid p {
  margin: 0;
  font-size: 8pt;
  font-weight: 700;
}

.valid strong {
  display: block;
  margin-top: 1.6mm;
  font-size: 8pt;
  font-weight: 400;
}

.kime {
  margin: 8mm 0 6mm;
  font-size: 8.5pt;
}

.kime span {
  font-size: 7.5pt;
  font-weight: 700;
  margin-right: 4mm;
}

.kime strong { font-weight: 400; }

.table-wrap {
  position: relative;
}

.watermark {
  position: absolute;
  left: calc(50% - 24mm);
  top: calc(50% - 22.75mm);
  z-index: 0;
  width: 48mm;
  height: 45.5mm;
  object-fit: contain;
  opacity: 0.16;
  pointer-events: none;
}

.banner,
.identity,
.contacts,
.kime,
.table-wrap {
  position: relative;
  z-index: 1;
}

.legal-wrap,
.sheet-foot {
  z-index: 1;
}

table {
  position: relative;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-top: 0.5px solid var(--teal);
  border-left: 0.5px solid var(--teal);
  table-layout: fixed;
}

th, td {
  border: 0;
  border-right: 0.5px solid var(--teal);
  border-bottom: 0.5px solid var(--teal);
  font-size: 8.3pt;
  line-height: 1.15;
  padding: 1.35mm 2mm;
  background: transparent;
}


th {
  background: var(--mint);
  font-size: 7.4pt;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
}

.sheet[data-density="compact"] .kime { margin: 4mm 0 3mm; }
.sheet[data-density="compact"] th,
.sheet[data-density="compact"] td { padding: 0.8mm 1.6mm; font-size: 7.5pt; }

.sheet[data-density="tight"] .identity { margin-top: 3mm; }
.sheet[data-density="tight"] .contacts { margin-top: 2.5mm; }
.sheet[data-density="tight"] .kime { margin: 3mm 0 2mm; }
.sheet[data-density="tight"] th,
.sheet[data-density="tight"] td { padding: 0.4mm 1.4mm; font-size: 6.8pt; }

td:first-child { text-align: left; width: 58%; }
td:nth-child(2),
td:nth-child(3),
th:nth-child(2),
th:nth-child(3) { text-align: center; width: 21%; }

.legal-wrap {
  position: absolute;
  left: 13mm;
  right: 13mm;
  bottom: 28mm;
}

.legal-wrap hr {
  height: 0.6pt;
  border: 0;
  background: #222;
  margin: 0 0 2.4mm;
}

.legal-wrap p {
  margin: 0;
  font-size: 7.4pt;
  line-height: 1.35;
  text-align: justify;
}

.sheet-foot {
  position: absolute;
  left: 12mm;
  right: 12mm;
  bottom: 11mm;
  height: 15.5mm;
}

.sheet-foot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.sheet-foot p {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5pt;
  font-weight: 700;
  letter-spacing: 0.01em;
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  body { background: #fff; }
  .form-panel { display: none !important; }
  .app { display: block; }
  .preview { padding: 0; display: block; overflow: visible; }
  .sheet {
    box-shadow: none;
    margin: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .form-panel { max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, #c8fff8 0%, transparent 42%),
    radial-gradient(circle at 84% 78%, #b7ebe4 0%, transparent 38%),
    #dfeeed;
}

.login-card {
  width: min(100%, 380px);
  background: rgba(244, 251, 250, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px 24px;
  box-shadow: 0 18px 40px rgba(16, 48, 46, 0.12);
}

.login-card h1 {
  margin: 6px 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.login-submit {
  width: 100%;
  margin-top: 8px;
}

.login-error {
  margin: 0 0 10px;
  color: #9a3030;
  font-size: 13px;
  font-weight: 700;
}
