/* crm.p71.eu — Production styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f3f4f6; color: #1f2937; font-size: 14px; line-height: 1.5;
}
header {
  background: #1f2937; color: white; padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center;
}
header h1 { font-size: 18px; font-weight: 600; }
header .user { font-size: 13px; opacity: 0.7; }
nav {
  background: white; border-bottom: 1px solid #e5e7eb;
  padding: 0 24px; display: flex; gap: 4px;
}
nav button {
  background: none; border: none; padding: 14px 20px; cursor: pointer;
  font-size: 14px; color: #6b7280; border-bottom: 2px solid transparent;
  font-weight: 500;
}
nav button.active { color: #1f2937; border-bottom-color: #2563eb; }
nav button:hover { color: #1f2937; }
main { padding: 24px; max-width: 1500px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; }
h2 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.subtitle { color: #6b7280; margin-bottom: 24px; font-size: 13px; }

/* FORM */
.form-card {
  background: white; border-radius: 8px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); max-width: 760px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row.three { grid-template-columns: 2fr 1fr 1fr; }
.form-field { display: flex; flex-direction: column; }
.form-field.full { grid-column: 1 / -1; }
label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  color: #4b5563; margin-bottom: 6px; letter-spacing: 0.3px;
}
input, select, textarea {
  padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 14px; font-family: inherit; background: white;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
textarea { resize: vertical; min-height: 80px; }
.auto-number {
  background: #ecfdf5; border: 1px dashed #10b981; color: #065f46;
  padding: 10px 12px; border-radius: 6px; font-family: monospace;
  font-size: 15px; font-weight: 600;
}
.form-actions {
  display: flex; gap: 12px; margin-top: 24px;
  padding-top: 20px; border-top: 1px solid #e5e7eb;
}
button.primary {
  background: #2563eb; color: white; border: none; padding: 10px 20px;
  border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer;
}
button.primary:hover { background: #1d4ed8; }
button.primary:disabled { background: #93c5fd; cursor: wait; }
button.secondary {
  background: white; color: #4b5563; border: 1px solid #d1d5db;
  padding: 10px 20px; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.info-box {
  background: #eff6ff; border-left: 3px solid #2563eb; padding: 12px 16px;
  border-radius: 4px; margin-bottom: 20px; font-size: 13px; color: #1e40af;
}
.info-box ul { margin-left: 18px; margin-top: 6px; }

/* TABLE */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select, .toolbar input { padding: 8px 12px; font-size: 13px; }
.search { flex: 1; min-width: 200px; max-width: 280px; }
.table-wrapper {
  background: white; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; min-width: 1100px; }
thead { background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
th {
  text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; color: #6b7280; letter-spacing: 0.3px; white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid #f3f4f6; font-size: 13px; vertical-align: top; }
tr.row { cursor: pointer; }
tr.row:hover { background: #f9fafb; }
.stev { font-family: monospace; font-weight: 600; color: #1f2937; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge.povprasevanje { background: #dbeafe; color: #1e40af; }
.badge.v-delu { background: #fef3c7; color: #92400e; }
.badge.poslano { background: #fed7aa; color: #9a3412; }
.badge.cakanje { background: #e5e7eb; color: #374151; }
.badge.zakljuceno { background: #d1fae5; color: #065f46; }
.badge.ni-opravljeno { background: #fecaca; color: #991b1b; }
.prov-tag {
  display: inline-block; background: #f3f4f6; color: #4b5563;
  padding: 1px 6px; border-radius: 3px; font-family: monospace;
  font-size: 11px; font-weight: 600; margin-left: 4px;
}
.price { font-family: monospace; font-weight: 600; color: #065f46; white-space: nowrap; }
.price.estimate { color: #6b7280; font-weight: 500; font-style: italic; }

/* DASHBOARD */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.stat-card {
  background: white; padding: 16px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-card .label {
  font-size: 11px; color: #6b7280; text-transform: uppercase;
  letter-spacing: 0.3px; font-weight: 600;
}
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 4px; color: #1f2937; }
.stat-card .delta { font-size: 12px; color: #6b7280; margin-top: 4px; }
.stat-card.alert .value { color: #dc2626; }
.stat-card.success .value { color: #059669; }

.kanban {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 10px; overflow-x: auto;
}
.kanban-col {
  background: #f3f4f6; border-radius: 8px; padding: 10px;
  min-height: 400px; min-width: 220px;
}
.kanban-col.drag-over { background: #dbeafe; box-shadow: inset 0 0 0 2px #2563eb; }
.kanban-col-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding: 0 4px;
}
.kanban-col-header h3 {
  font-size: 12px; text-transform: uppercase; color: #4b5563; letter-spacing: 0.3px;
}
.count {
  background: #e5e7eb; color: #4b5563; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
}
.kanban-card {
  background: white; border-radius: 6px; padding: 10px 12px;
  margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border-left: 3px solid #2563eb; cursor: pointer;
  position: relative;
}
.kanban-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.kanban-card.alert { border-left-color: #dc2626; }
.kanban-card.dragging { opacity: 0.5; cursor: grabbing; }
.kanban-card .stev { font-size: 11px; color: #6b7280; margin-bottom: 2px; font-family: monospace; }
.kanban-card .title { font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 4px; line-height: 1.3; }
.kanban-card .meta { font-size: 11px; color: #6b7280; }
.kanban-card .meta-row { display: flex; justify-content: space-between; margin-top: 6px; flex-wrap: wrap; gap: 4px; }
.kanban-card .city { color: #2563eb; font-weight: 500; }
.kanban-card .status-mini-select {
  width: 100%; margin-top: 8px; padding: 4px 6px;
  font-size: 11px; border: 1px solid #e5e7eb; border-radius: 4px;
}

/* CHARTS (Analitika) */
.charts-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.chart-card {
  background: white; padding: 16px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.chart-card h3 { font-size: 14px; margin-bottom: 12px; color: #1f2937; }
.chart-card canvas { max-height: 280px; }

/* MODAL */
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 100; padding: 20px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: white; border-radius: 10px; width: 100%; max-width: 720px;
  margin-top: 40px; overflow: hidden;
}
.modal header {
  background: #1f2937; padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center; color: white;
}
.modal header h3 { font-size: 16px; font-family: monospace; }
.modal-close {
  background: none; border: none; color: white; font-size: 18px; cursor: pointer;
}
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-actions {
  padding: 16px 20px; border-top: 1px solid #e5e7eb;
  display: flex; gap: 12px; justify-content: flex-end;
}

/* TOAST */
#toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  padding: 12px 16px; border-radius: 6px; color: white;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: none;
}
#toast.success { background: #059669; display: block; }
#toast.error   { background: #dc2626; display: block; }
#toast.info    { background: #2563eb; display: block; }

/* RESPONSIVE */
@media (max-width: 1199px) {
  .kanban { grid-template-columns: repeat(3, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .kanban { grid-template-columns: 1fr; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  nav { overflow-x: auto; }
  nav button { white-space: nowrap; }
}
