/* Cortina Design — evidencija: putni nalozi, računi, proizvodnja, obrada, povijest.
   Dopunjuje app.css: tamna podloga, zlatni naglasak, kontrole najmanje 48 px. */

.cd-intro {
  color: #c3ccd8;
  max-width: 70ch;
}
.cd-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}
.cd-bar button,
.cd-form-actions button,
.actions button {
  min-height: 48px;
}
.primary {
  background: #d4a70b;
  color: #080808;
}

/* ── filtri ────────────────────────────────────────────────────── */
.cd-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 18px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 14px;
  padding: 4px 20px 20px;
  margin: 18px 0;
}
.cd-filters label {
  margin: 14px 0 0;
  color: #c3ccd8;
  font-size: 15px;
}
.cd-filters input,
.cd-filters select {
  width: 100%;
}

/* ── kartice i redci ───────────────────────────────────────────── */
.cd-list {
  display: block;
}
.cd-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 14px;
  padding: 24px;
  margin: 18px 0;
  overflow-wrap: anywhere;
}
.cd-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.cd-card h3,
.cd-card h4 {
  margin: 0;
}
.cd-card h4 {
  margin-top: 22px;
  color: #e8c854;
}
.cd-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #30363d;
  padding: 14px 0;
}
.cd-line:first-of-type {
  border-top: 0;
}
.cd-compact {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 10px 0;
}
.cd-line .actions {
  margin: 0;
}
.cd-text {
  white-space: pre-wrap;
  color: #dbe3ec;
}
.cd-help {
  color: #a4aebb;
  font-size: 15px;
  max-width: 70ch;
}
.cd-inline-note {
  color: #a4aebb;
  align-self: center;
}
.cd-total {
  color: #e8c854;
  font-weight: 650;
}
.cd-empty {
  border: 1px dashed #4a545f;
  border-radius: 12px;
  padding: 22px;
  color: #a4aebb;
  text-align: center;
}
.cd-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.cd-summary div {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 14px;
  padding: 18px;
}
.cd-summary strong {
  display: block;
  color: #e8c854;
  font-size: 22px;
}
.cd-estimate {
  border-left: 3px solid #766328;
  padding-left: 16px;
  margin: 16px 0;
}
.cd-revision {
  margin-top: 16px;
}

/* ── opisne liste ──────────────────────────────────────────────── */
.cd-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.cd-meta dt {
  color: #a4aebb;
  font-size: 14px;
}
.cd-meta dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

/* ── tablice ───────────────────────────────────────────────────── */
.cd-table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}
.cd-table-wrap table {
  min-width: 520px;
}

/* ── obrasci ───────────────────────────────────────────────────── */
.cd-form input,
.cd-form textarea,
.cd-form select {
  width: 100%;
}
.cd-form textarea {
  min-height: 96px;
}
.cd-fieldset {
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 4px 18px 18px;
  margin: 18px 0;
}
.cd-fieldset legend {
  color: #e8c854;
  padding: 0 8px;
}
.cd-two {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.cd-two > label {
  flex: 1 1 160px;
}
.cd-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin: 14px 0;
}
.cd-check input {
  width: 26px;
  height: 26px;
  min-height: 26px;
  margin: 0;
  flex: none;
}
.cd-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.cd-error:empty {
  display: none;
}
.cd-error {
  border: 1px solid #a05252;
  background: #2b1616;
  color: #ffc9c9;
  border-radius: 10px;
  padding: 14px;
  margin-top: 16px;
}
.cd-order-picker {
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 4px 18px 18px;
  margin: 18px 0;
}
.cd-order-picker small {
  margin-top: 10px;
}
.cd-dialog-body {
  display: block;
}

/* ── proizvodni redci ──────────────────────────────────────────── */
.cd-rows {
  display: block;
}
.cd-row {
  display: grid;
  grid-template-columns:
    minmax(170px, 1.4fr) 120px 120px 110px minmax(170px, 1.2fr)
    minmax(150px, 1fr) auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid #30363d;
  padding: 14px 0;
}
.cd-row label {
  margin: 0;
  font-size: 14px;
  color: #a4aebb;
}
.cd-row input,
.cd-row select {
  width: 100%;
  min-height: 48px;
}
@media (max-width: 1150px) {
  .cd-row {
    grid-template-columns: 1fr 1fr;
  }
  .cd-row button {
    grid-column: 1 / -1;
  }
}

/* ── prilozi računa ────────────────────────────────────────────── */
.cd-files {
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 4px 18px 18px;
  margin-bottom: 18px;
}
.cd-file-list {
  overflow-wrap: anywhere;
  color: #c3ccd8;
}
.cd-preview-item {
  border-top: 1px solid #30363d;
  padding: 14px 0;
}
.cd-preview-image {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-top: 12px;
}
.cd-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid #424a55;
  background: #21262d;
  color: #ffe19a;
  text-decoration: none;
  font-weight: 650;
}

/* ── povijest ──────────────────────────────────────────────────── */
.cd-audit {
  border-left: 3px solid #766328;
  padding: 4px 0 4px 16px;
  margin: 16px 0;
}
.cd-audit p {
  margin: 6px 0 0;
  color: #dbe3ec;
}

/* ── ispis ─────────────────────────────────────────────────────── */
.cd-print-area {
  display: none;
}
.cd-paper {
  color: #000;
  background: #fff;
  padding: 24px;
}
.cd-print-dialog {
  width: min(900px, 94vw);
  max-width: 94vw;
}
.cd-print-dialog .cd-paper {
  margin-bottom: 20px;
}
.cd-paper dt,
.cd-paper small {
  color: #333;
}
.cd-paper-head {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
  background: #fff;
  color: #000;
}
.cd-paper-sub {
  margin-top: 0;
}
.cd-paper-status {
  border: 1px solid #000;
  display: inline-block;
  padding: 6px 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.cd-paper-foot {
  border-top: 1px solid #000;
  margin-top: 24px;
  padding-top: 8px;
  font-size: 12px;
}
.cd-sign {
  display: flex;
  gap: 40px;
  margin-top: 40px;
}
.cd-sign-cell {
  flex: 1;
}
.cd-sign-line {
  display: block;
  border-bottom: 1px solid #000;
  height: 40px;
}

@media print {
  .cd-paper-head {
    display: flex !important;
  }
  .cd-card,
  .cd-compact,
  .cd-summary div,
  .cd-paper {
    background: #fff;
    color: #000;
    border: 1px solid #888;
    break-inside: avoid;
  }
  .cd-filters,
  .cd-bar,
  .cd-form,
  .cd-files,
  .cd-order-picker,
  .cd-error,
  .cd-link,
  .no-print {
    display: none !important;
  }
  .cd-help,
  .cd-total,
  .cd-intro,
  .cd-inline-note,
  .cd-meta dt,
  .cd-audit p,
  .badge {
    color: #000;
    background: #fff;
  }
  .cd-empty,
  .cd-audit,
  .cd-estimate {
    border-color: #888;
  }
  body.cd-printing > *:not(#cd-print-area) {
    display: none !important;
  }
  body.cd-printing #cd-print-area,
  body.cd-printing .cd-print-area {
    display: block !important;
    background: #fff;
    color: #000;
  }
  .cd-paper h1 {
    font-size: 22px;
  }
  .cd-paper h2 {
    font-size: 17px;
    margin-top: 18px;
  }
  .cd-paper table {
    width: 100%;
    border-collapse: collapse;
  }
  .cd-paper th,
  .cd-paper td {
    border: 1px solid #000;
    padding: 6px;
    font-size: 12px;
    text-align: left;
  }
  .cd-paper .cd-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .cd-paper .cd-table-wrap {
    overflow: visible;
  }
  .cd-paper .cd-table-wrap table {
    min-width: 0;
  }
}
