:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --accent: #0284c7;
  --accent-light: #e0f2fe;

  --success: #059669;
  --success-hover: #047857;
  --success-light: #ecfdf5;

  --danger: #dc2626;
  --danger-light: #fef2f2;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  font-size: 26px;
  background: #fef08a;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.logo-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
  display: block;
}
.logo-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Layout */
.main-container {
  max-width: 1440px;
  margin: 20px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background-color: #ffffff;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}
.card-body {
  padding: 18px;
}
.sticky-card {
  position: sticky;
  top: 76px;
}

/* Forms & Grids */
.grid {
  display: grid;
  gap: 12px;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.form-input, .form-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: #ffffff;
  transition: all 0.15s;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-outline { background: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-accent { background: var(--accent-light); color: var(--accent); border-color: #bae6fd; font-weight: 600; }
.btn-accent:hover { background: #bae6fd; }
.btn-success { background: var(--success); color: #fff; font-weight: 600; }
.btn-success:hover { background: var(--success-hover); }
.btn-danger-outline { background: transparent; border-color: #fecaca; color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-light); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-icon { padding: 8px 10px; background: #f1f5f9; border-color: #cbd5e1; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* Badge */
.badge {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-muted);
  margin-left: 8px;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-work { background: #fef3c7; color: #b45309; }
.badge-mat { background: #e0f2fe; color: #0369a1; }

/* SEARCH SECTION */
.search-card {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.search-box-wrap {
  padding: 16px 18px;
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border-color);
}
.search-input-inner {
  display: flex;
  align-items: center;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 14px;
  font-size: 18px;
  color: #94a3b8;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 14px 44px 14px 46px;
  font-size: 15px;
  font-weight: 500;
  border: 2px solid #3b82f6;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  transition: all 0.15s;
}
.search-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.2);
}
.clear-btn {
  position: absolute;
  right: 12px;
  background: #e2e8f0;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #475569;
}
.search-help {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% - 8px);
  left: 18px;
  right: 18px;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 500;
}
.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.1s;
}
.result-item:last-child { border-bottom: none; }
.result-item:hover, .result-item.selected {
  background: #eff6ff;
}
.result-item-main {
  flex: 1;
}
.result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}
.result-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.result-price-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #0f766e;
  padding: 4px 8px;
  background: #ccfbf1;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Quantity input within dropdown row */
.result-quick-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
}
.qty-mini-input {
  width: 55px;
  padding: 4px 6px;
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: center;
  border: 1px solid #94a3b8;
  border-radius: var(--radius-sm);
}

/* Quick Tiles */
.quick-tiles-section {
  padding: 12px 18px;
  background: #ffffff;
}
.quick-tiles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.quick-tabs {
  display: flex;
  gap: 4px;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tab-btn:hover { background: #f1f5f9; color: var(--text-main); }
.tab-btn.active {
  background: #e2e8f0;
  color: var(--text-main);
  font-weight: 600;
}
.quick-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.quick-tile {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  transition: all 0.15s;
}
.quick-tile:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}
.tile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}
.tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.tile-price {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.tile-add {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: #dbeafe;
  padding: 1px 6px;
  border-radius: 4px;
}

/* Bill Table */
.table-responsive {
  overflow-x: auto;
}
.bill-table {
  width: 100%;
  border-collapse: collapse;
}
.bill-table th {
  background: #f8fafc;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}
.bill-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  vertical-align: middle;
}
.bill-table tr:hover td {
  background-color: #f8fafc;
}

.table-input-name {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  padding: 4px;
  border-radius: 4px;
}
.table-input-name:focus {
  border-color: var(--primary);
  background: #fff;
  outline: none;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  background: #fff;
}
.qty-btn {
  background: #f1f5f9;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover { background: #e2e8f0; }
.qty-input {
  width: 44px;
  border: none;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
}
.qty-input:focus { outline: none; }

.price-input {
  width: 90px;
  padding: 4px 6px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.voc-input {
  width: 85px;
  padding: 4px 6px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 500;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  color: #475569;
}
.voc-input:focus {
  background: #fff;
  border-color: var(--primary);
  color: #0f172a;
}

.margin-input {
  width: 55px;
  padding: 4px 4px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: var(--radius-sm);
  color: #166534;
}
.margin-input:focus {
  background: #fff;
  border-color: #16a34a;
}

.margin-quick-btn {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  color: #166534;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.1s ease;
}
.margin-quick-btn:hover {
  background: #dcfce7;
}
.margin-quick-btn.active {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #15803d !important;
}

.btn-delete-row {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  border-radius: 4px;
}
.btn-delete-row:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* Financial Summary Sidebar */
.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.hr {
  height: 1px;
  background: var(--border-color);
  margin: 14px 0;
}
.summary-total-box {
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  text-align: center;
}
.total-amount {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2px;
}

.final-settlement-card {
  background: #ecfdf5;
  border: 2px solid #10b981;
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  margin-top: 10px;
}
.settle-label {
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  letter-spacing: 0.5px;
}
.settle-amount {
  font-size: 26px;
  font-weight: 800;
  color: #065f46;
  margin-top: 4px;
}

.supplier-stamp {
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
  color: var(--text-muted);
  line-height: 1.4;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-lg { max-width: 780px; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #94a3b8;
}
.modal-close:hover { color: var(--text-main); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.list-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-group-item {
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s;
}
.list-group-item:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

/* Utilities */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; align-items: flex-end; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.uppercase { text-transform: uppercase; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }

/* Print styling */
.print-only { display: none; }

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 15mm 15mm 15mm;
  }
  
  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11pt !important;
    line-height: 1.4 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Skrýt všechny ovládací prvky aplikace */
  .navbar, .search-card, .quick-tiles-section, .table-actions, .export-actions, 
  .btn-delete-row, .qty-btn, .modal-backdrop, .right-col, .customer-picker-wrap,
  .btn-add-item, #catalog-search-input, #btn-clear-search, .search-results-dropdown,
  .main-container {
    display: none !important;
  }

  /* Zobrazit pouze čistý tiskový dokument */
  .print-only {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Styl reprezentativního vyúčtování pro zákazníka */
  .invoice-paper {
    width: 100%;
    color: #1e293b;
    font-size: 11pt;
  }

  /* 1. HLAVIČKA DOKLADU */
  .doc-header-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
  }
  .brand-col {
    vertical-align: bottom;
  }
  .brand-name {
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.3px;
    line-height: 1.1;
  }
  .brand-tagline {
    font-size: 11px;
    color: #0284c7;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 3px;
  }
  .doc-badge-col {
    vertical-align: bottom;
    text-align: right;
  }
  .doc-type-badge {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  .doc-meta-inline {
    font-size: 11px;
    color: #64748b;
  }
  .doc-meta-inline b {
    color: #1e293b;
  }

  /* 2. PŘEDMĚT ZAKÁZKY */
  .order-banner-table {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #0284c7;
    border-radius: 4px;
    margin-bottom: 14px;
    border-collapse: collapse;
  }
  .order-banner-table td {
    padding: 6px 12px;
    font-size: 11.5px;
  }
  .order-banner-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #0369a1;
    letter-spacing: 0.5px;
  }
  .order-banner-text {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
  }

  /* 3. STRANY: DODAVATEL & ODBĚRATEL */
  .parties-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 12px 0;
    margin-bottom: 16px;
  }
  .party-card {
    width: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 10px 14px;
    vertical-align: top;
  }
  .party-header {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
    margin-bottom: 6px;
  }
  .party-firm {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
  }
  .party-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    line-height: 1.45;
    color: #334155;
  }
  .party-details-table td {
    padding: 1px 0;
    vertical-align: top;
  }
  .party-details-table td.lbl {
    width: 52px;
    color: #64748b;
    font-weight: 600;
  }
  .party-details-table td.val {
    font-weight: 500;
    color: #0f172a;
  }

  /* 4. POLOŽKOVÁ TABULKA */
  .items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
  }
  .items-table th {
    background: #0f172a;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 7px 8px;
    border: none;
  }
  .items-table td {
    padding: 6px 8px;
    font-size: 11px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    color: #1e293b;
  }
  .items-table tr:nth-child(even) td {
    background-color: #f8fafc;
  }
  .col-idx { width: 28px; text-align: center; color: #64748b; }
  .col-name { text-align: left; }
  .col-type { width: 75px; text-align: center; }
  .col-qty { width: 65px; text-align: center; font-weight: 600; }
  .col-price { width: 100px; text-align: right; }
  .col-total { width: 110px; text-align: right; font-weight: 700; color: #0f172a; }

  .type-pill {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
  }
  .type-mat { background: #e0f2fe; color: #0369a1; }
  .type-work { background: #fef3c7; color: #92400e; }

  /* 5. REKAPITULACE & POZNÁMKY */
  .bottom-layout-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 25px;
  }
  .bottom-layout-table td {
    vertical-align: top;
  }
  .notes-box {
    padding-right: 25px;
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
  }
  .notes-box-inner {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    padding: 10px 14px;
    min-height: 100px;
  }
  .notes-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }

  .summary-card {
    width: 320px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 10px 14px;
    float: right;
  }
  .sum-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
  }
  .sum-table td {
    padding: 3px 0;
    color: #475569;
  }
  .sum-table td.val {
    text-align: right;
    font-weight: 600;
    color: #0f172a;
  }
  .sum-table tr.sep td {
    border-top: 1px solid #e2e8f0;
    padding-top: 4px;
    margin-top: 2px;
  }
  .sum-table tr.grand td {
    border-top: 2px solid #0f172a;
    padding: 6px 0 4px 0;
    font-size: 12.5px;
    font-weight: 800;
    color: #0f172a;
  }
  .sum-table tr.advance td {
    color: #0284c7;
    font-weight: 600;
  }

  .settle-final-block {
    background: #f0fdf4;
    border: 1.5px solid #16a34a;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
  }
  .settle-final-table {
    width: 100%;
    border-collapse: collapse;
  }
  .settle-final-lbl {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #166534;
    vertical-align: middle;
  }
  .settle-final-val {
    text-align: right;
    font-size: 16px;
    font-weight: 900;
    color: #15803d;
    vertical-align: middle;
  }

  /* 6. PATIČKA */
  .footer-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 10px;
    color: #64748b;
  }
  .footer-table td {
    vertical-align: bottom;
  }
  .signature-area {
    width: 220px;
    text-align: center;
    border-top: 1px solid #94a3b8;
    padding-top: 5px;
    color: #334155;
    font-size: 11px;
    font-weight: 500;
    float: right;
  }
}
