:root {
  --navy:       #0A1F44;
  --blue:       #1A56DB;
  --blue-hover: #1648c0;
  --blue-light: #e8f0fe;
  --red:        #C53030;
  --gold:       #D69E2E;
  --gold-light: #fef7e6;
  --white:      #FFFFFF;
  --text:       #1a202c;
  --muted:      #64748b;
  --border:     #e2e8f0;
  --bg:         #f6f8fc;
  --shadow-sm:  0 2px 8px rgba(10, 31, 68, 0.06);
  --shadow-md:  0 8px 30px rgba(10, 31, 68, 0.08);
  --shadow-lg:  0 20px 60px rgba(10, 31, 68, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3, .hero-rejis { font-family: 'Space Grotesk', sans-serif; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ========== NAVBAR ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-logo { text-decoration: none; display: flex; align-items: center; }
.logo-rejis {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--navy);
  letter-spacing: 0.5px;
}
.logo-tag {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}
.nav-link { text-decoration: none; color: var(--text); font-weight: 500; font-size: 14px; }
.nav-link:hover { color: var(--blue); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ========== HERO ========== */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy) 0%, #12336e 100%);
  color: #fff;
  padding: 70px 0 90px;
  overflow: hidden;
}
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 720px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}
.hero-title { font-size: clamp(30px, 5vw, 48px); font-weight: 700; margin-bottom: 16px; }
.hero-text { font-size: 16px; color: rgba(255,255,255,0.85); margin: 0 auto; }
.hero-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
}
.hero-shape-1 { width: 300px; height: 300px; background: var(--blue); top: -80px; left: -80px; }
.hero-shape-2 { width: 260px; height: 260px; background: var(--gold); bottom: -100px; right: -60px; }
.hero-shape-3 { width: 180px; height: 180px; background: var(--red); top: 40px; right: 15%; opacity: 0.2; }

/* ========== MAIN ========== */
.main-content { padding: 30px 20px 80px; }
.main-content .card { margin-top: 28px; }

/* ========== CARDS ========== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.card-head-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.card-head h2 { font-size: 20px; color: var(--navy); }
.card-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ========== FORMS ========== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

/* ========== TABS ========== */
.tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tab-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.tab-btn:hover { border-color: var(--blue); color: var(--blue); }
.tab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.add-block { margin-bottom: 24px; padding: 18px; background: #fafbfd; border: 1px dashed var(--border); border-radius: var(--radius-md); }
.link-row { display: flex; gap: 10px; }
.link-row input { flex: 1; }

.fetch-hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--gold-light);
  border: 1px solid #f5e0a8;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.fetch-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--blue-light);
  border: 1px solid #c3d6fb;
  font-size: 14px;
}
.fetch-result .prod-price { font-size: 20px; font-weight: 700; color: var(--navy); }
.fetch-result .prod-delivery { font-size: 13px; color: var(--muted); }
.fetch-result .prod-actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fetch-result .prod-actions input { width: 80px; padding: 8px; }
.fetch-result.error { background: #fef2f2; border-color: #fecaca; color: var(--red); }

/* ========== TABLE ========== */
.table-wrap { overflow-x: auto; }
.items-table { width: 100%; border-collapse: collapse; }
.items-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
}
.items-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.items-table .col-qty { width: 70px; }
.items-table .col-price { width: 130px; }
.items-table .col-total { width: 130px; text-align: right; }
.items-table .col-action { width: 40px; }
.items-table .total-cell { font-weight: 700; }
.items-table .qty-input {
  width: 60px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.empty-row td { text-align: center; color: var(--muted); padding: 30px; font-style: italic; }
.delete-btn {
  border: none;
  background: none;
  color: var(--red);
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: 6px;
}
.delete-btn:hover { background: #fef2f2; }
.item-link-chip {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  font-weight: 600;
}
.chip-link { background: var(--gold-light); color: #92600a; }
.chip-manual { background: var(--blue-light); color: var(--blue); }
.item-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-secondary:hover { opacity: 0.92; }
.btn-outline {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ========== TOTALS ========== */
.totals-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  align-items: start;
}
.totals-summary {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 90px;
}
.total-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.total-line span:last-child { font-weight: 600; }
.total-big {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  border-bottom: none;
  padding-top: 16px;
}
.total-big span:last-child { color: #4ade80; }

.send-options { margin-top: 22px; }
.send-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.send-grid { display: flex; flex-direction: column; gap: 10px; }
.send-btn {
  width: 100%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  justify-content: flex-start;
}
.send-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: #4ade80;
  color: #fff;
}
.send-btn i { font-size: 17px; }

/* ========== FOOTER ========== */
.footer {
  background: #060e24;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 36px 0;
  font-size: 14px;
}
.footer-brand { color: #fff; font-weight: 600; margin-bottom: 6px; }
.footer-contact { margin-bottom: 8px; }
.footer-copy { font-size: 12.5px; color: rgba(255,255,255,0.4); }

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== REVEAL ========== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .totals-grid { grid-template-columns: 1fr; }
  .link-row { flex-direction: column; }
  .nav-menu { gap: 12px; }
  .nav-link { display: none; }
  .main-content { padding: 20px 12px 60px; }
  .card { padding: 20px; }
}
