/* CaufiOS - Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..700;1,14..32,300..700&display=swap');

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f7f8fa;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1; }

a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Nav ── */
nav {
  background: #1e3a5f;
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 2000;
  box-shadow: none;
  border-bottom: 1px solid rgba(0,0,0,.12);
}
nav .nav-inner {
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 2px;
  height: 56px;
  width: 100%;
  box-sizing: border-box;
}
/* Thin divider after logo */
nav .nav-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,.15);
  margin: 0 14px;
  flex-shrink: 0;
}
nav .nav-logo {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  white-space: nowrap;
  letter-spacing: .5px;
  flex-shrink: 0;
}
nav .nav-logo span { color: #60a5fa; }
nav a.nav-link {
  color: rgba(255,255,255,.6);
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  transition: background .16s, color .16s;
  border-bottom: none;
}
nav a.nav-link:hover {
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.95);
  text-decoration: none;
}
nav a.nav-link.active {
  background: rgba(255,255,255,.13);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
nav .nav-spacer { flex: 1; }

/* ── Secondary sub-nav (director_ops) ── */
nav .nav-sub {
  background: rgba(0,0,0,.2);
  border-top: 1px solid rgba(255,255,255,.07);
}
nav .nav-sub-inner {
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 2px;
  height: 36px;
}
nav .nav-sub-inner.nav-sub-centered {
  justify-content: center;
}
nav a.nav-sub-link {
  color: rgba(255,255,255,.6);
  padding: 5px 13px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
  transition: background .16s, color .16s;
  text-decoration: none;
}
nav a.nav-sub-link:hover {
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.95);
  text-decoration: none;
}
nav a.nav-sub-link.active {
  background: rgba(255,255,255,.13);
  color: #fff;
  font-weight: 600;
}

/* User section */
nav .nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,.12);
}
nav .nav-logout { margin-left: 7px; }
/* Avatar circle */
nav .nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
}
nav .nav-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
nav .nav-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
}
nav .nav-role-pill {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  white-space: nowrap;
  letter-spacing: .3px;
}
/* Bell */
nav .nav-bell {
  position: relative;
  cursor: pointer;
  color: rgba(255,255,255,.6);
  padding: 6px;
  border-radius: 7px;
  transition: background .16s, color .16s;
  display: flex;
  align-items: center;
}
nav .nav-bell:hover { background: rgba(255,255,255,.09); color: #fff; }
nav .nav-bell .badge-count {
  position: absolute;
  top: 2px; right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 9px;
  padding: 1px 4px;
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
}
/* Logout */
nav .nav-logout {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
  white-space: nowrap;
}
nav .nav-logout:hover {
  background: rgba(239,68,68,.2);
  border-color: rgba(239,68,68,.4);
  color: #fca5a5;
}

/* ── Main ── */
main {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 16px 12px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.page-header h1 { font-size: 18px; font-weight: 600; color: #1e293b; }

/* ── Cards / Panels ── */
.card {
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 6px;
  padding: 20px;
  box-shadow: none;
}

/* Dashboard stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 6px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: none;
}
.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card .stat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-card .stat-value {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.5px;
}
.stat-card .stat-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 500;
}
/* pending */
.stat-card.pending .stat-icon   { background: #fef9ee; color: #b45309; }
.stat-card.pending .stat-value  { color: #b45309; }
/* approved */
.stat-card.approved .stat-icon  { background: #eff4ff; color: #2563eb; }
.stat-card.approved .stat-value { color: #2563eb; }
/* in-progress */
.stat-card.in-progress .stat-icon  { background: #f3f0ff; color: #6d28d9; }
.stat-card.in-progress .stat-value { color: #6d28d9; }
/* closed */
.stat-card.closed .stat-icon   { background: #f0fdf4; color: #15803d; }
.stat-card.closed .stat-value  { color: #15803d; }

/* Report cards grid */
.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.report-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
}
.report-card h3 { font-size: 14px; margin-bottom: 8px; color: #1e3a5f; }
.report-card p { font-size: 12px; color: #64748b; margin-bottom: 14px; }
.report-card .btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .12s, background .12s;
  white-space: nowrap;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn:active { opacity: .75; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary   { background: #1d4ed8; color: #fff; }
.btn-success   { background: #16a34a; color: #fff; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-warning   { background: #d97706; color: #fff; }
.btn-outline   { background: transparent; color: #1d4ed8; border: 1px solid #1d4ed8; }
.btn-sm        { padding: 4px 10px; font-size: 12px; }
.btn-xs        { padding: 2px 7px; font-size: 11px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  background: #f7f8fa;
  color: #475569;
  font-weight: 500;
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid #eaecf0;
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f3f5;
  vertical-align: middle;
}
tbody tr:nth-child(even) { background: transparent; }
tbody tr:hover { background: #f7f8fa; }
tbody tr:last-child td { border-bottom: none; }

.table-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 5px;
  color: #374151;
}
.form-group label.required::after { content: ' *'; color: #dc2626; }
.form-control {
  display: block;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  color: #111;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29,78,216,.15);
}
.form-control:disabled { background: #f3f4f6; color: #6b7280; }
textarea.form-control { min-height: 90px; resize: vertical; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: #1d4ed8; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.form-actions { display: flex; gap: 10px; padding-top: 16px; flex-wrap: wrap; }

/* Filter bar */
/* ── Smart Filter Bar (shared: dashboard + orders) ── */
.smart-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 6px;
}
.smart-filters .sf-search {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.smart-filters .sf-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #94a3b8;
}
.smart-filters .sf-search input {
  padding-left: 34px;
  font-size: 13px;
  height: 36px;
}
.smart-filters select.form-control {
  font-size: 13px;
  height: 36px;
  min-width: 140px;
  width: auto;
}
.smart-filters .sf-divider {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  flex-shrink: 0;
}
.smart-filters .sf-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.smart-filters .btn { height: 36px; font-size: 13px; }

/* Legacy filter-bar — keep for other pages */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-control { min-width: 160px; }

/* Stacked action buttons in table cells */
.table-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.table-actions .btn { width: 100%; justify-content: center; }

/* ── Status Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2px;
  white-space: nowrap;
}
.badge-pending    { background: #fef9ee; color: #92400e; }
.badge-approved   { background: #eff4ff; color: #1e40af; }
.badge-in_progress { background: #f3f0ff; color: #5b21b6; }
.badge-closed     { background: #f0fdf4; color: #14532d; }
.badge-cancelled  { background: #f4f5f7; color: #64748b; }
.badge-activo     { background: #f0fdf4; color: #14532d; }
.badge-no_activo  { background: #fff1f0; color: #991b1b; }

/* ── Alerts ── */
.alert {
  padding: 10px 14px;
  border-radius: 5px;
  margin-bottom: 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-error   { background: #fff1f0; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef9ee; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff4ff; color: #1e40af; border: 1px solid #bfdbfe; }

#error-container, #success-container { margin-bottom: 12px; }

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 40px;
  color: #64748b;
  font-size: 14px;
}
.loading::before {
  content: '';
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid #e2e8f0;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #fff;
  border-radius: 6px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 24px rgba(0,0,0,.12);
  border: 1px solid #eaecf0;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.modal-header h2 { font-size: 16px; color: #1e3a5f; }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
  padding: 2px 6px;
}
.modal-close:hover { color: #111; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.pagination button {
  padding: 5px 11px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.pagination button:hover { background: #f1f5f9; }
.pagination button.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Timeline (events) ── */
.timeline { list-style: none; position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px; background: #e2e8f0;
}
.timeline li {
  position: relative;
  padding: 0 0 20px 20px;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -10px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #1d4ed8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #1d4ed8;
}
.timeline .event-time { font-size: 11px; color: #64748b; margin-bottom: 2px; }
.timeline .event-body { font-size: 13px; }
.timeline .event-body strong { color: #1e3a5f; }

/* ── Detail info grid ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.info-item .info-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.info-item .info-value { font-size: 14px; color: #111; font-weight: 500; }

/* ── Log entries ── */
.log-entry {
  border: 1px solid #eaecf0;
  border-radius: 5px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.log-entry .log-meta { font-size: 11px; color: #64748b; margin-bottom: 6px; }
.log-entry .log-text { font-size: 13px; margin-bottom: 8px; }
.log-entry .log-files { display: flex; gap: 8px; flex-wrap: wrap; }
.log-entry .log-files img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; border: 1px solid #e2e8f0; cursor: pointer; }
.log-entry .log-files a { font-size: 12px; color: #1d4ed8; }

/* ── Checklist ── */
.checklist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
}
@media (max-width: 640px) { .checklist-grid { grid-template-columns: 1fr; } }
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.checklist-item input[type="checkbox"] { margin-top: 2px; accent-color: #1d4ed8; flex-shrink: 0; }

/* Material table in maintenance */
.material-table th, .material-table td { padding: 6px 10px; }

/* ── Section headings ── */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #eaecf0;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
  font-size: 14px;
}

/* ── Thumbnails ── */
.thumb-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb-grid img { width: 100px; height: 75px; object-fit: cover; border-radius: 4px; border: 1px solid #e2e8f0; }

/* ── Login page ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 16px rgba(0,0,0,.1);
  border: 1px solid #eaecf0;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 { font-size: 22px; color: #1e3a5f; margin-bottom: 4px; }
.login-logo p { font-size: 12px; color: #64748b; }

/* ── Print ── */
@media print {
  nav, .btn, .filter-bar, .pagination, .modal-overlay, .page-header .btn { display: none !important; }
  body { background: #fff; font-size: 12px; }
  main { margin: 0; padding: 0; }
  .card { border: none; box-shadow: none; padding: 0; }
  table { font-size: 11px; }
  thead th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  nav .nav-inner { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 2px; }
  nav .nav-logo { width: 100%; margin-bottom: 4px; }
  nav .nav-user { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .checklist-grid { grid-template-columns: 1fr; }
}

/* ===== CAUFI BRAND COLORS ===== */
:root {
  --caufi-blue: #1e3a5f;
  --caufi-blue-light: #2d5a8e;
  --caufi-orange: #e87722;
  --caufi-orange-light: #f4a460;
}

nav { background: #1e3a5f !important; }
.nav-logo { color: #fff; font-size: 1.3rem; font-weight: 700; letter-spacing: 1px; }
.nav-logo span { color: var(--caufi-orange); }
/* nav-link brand overrides handled by nav a.nav-link rules above */
.btn-primary { background: var(--caufi-blue) !important; }
.btn-primary:hover { background: var(--caufi-blue-light) !important; }

/* Stats cards — accent via icon bg only (no border-left) */

/* Login page branding */
.login-box { background: #fff; border-radius: 8px; padding: 40px; max-width: 420px; margin: auto; box-shadow: 0 2px 16px rgba(0,0,0,.1); border: 1px solid #eaecf0; }
.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: transparent; }
.login-logo h1 { color: var(--caufi-blue); font-size: 2rem; margin: 0; }
.login-logo h1::after { content: 'OS'; color: var(--caufi-orange); }
.login-logo h1 { font-size: 2rem; }
.login-logo p { color: #64748b; margin: 4px 0 20px; }

/* Report hub cards */
.report-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; }
.report-card h3 { margin: 0 0 8px; color: var(--caufi-blue); font-size: 1rem; }
.report-card p { color: #64748b; font-size: 0.85rem; margin: 0 0 12px; }

/* Category badge for inventory */
.cat-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; background: #e2e8f0; color: #475569; }
.cat-carpas { background: #dbeafe; color: #1e40af; }
.cat-domos { background: #ede9fe; color: #5b21b6; }
.cat-mobiliario { background: #dcfce7; color: #166534; }
.cat-sanitario { background: #fce7f3; color: #9d174d; }
.cat-senalizacion_vial { background: #ffedd5; color: #9a3412; }
.cat-generacion { background: #fef9c3; color: #713f12; }
.cat-climatizacion { background: #cffafe; color: #164e63; }
.cat-electrico { background: #fef3c7; color: #92400e; }
.cat-seguridad_epp { background: #fee2e2; color: #991b1b; }
.cat-casetas_moviles { background: #f3f4f6; color: #1f2937; }

/* ── Leaflet z-index fix ──────────────────────────────────────────────────
   The sticky nav sits at z-index 2000. Force all Leaflet layers, controls
   and popups to stay below it so they never float over the header. */
.leaflet-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-tooltip-pane,
.leaflet-popup-pane { z-index: 4 !important; }

.leaflet-control-container .leaflet-control { z-index: 8 !important; }
.leaflet-control-container .leaflet-bottom { z-index: 8 !important; }
.leaflet-control-container .leaflet-top    { z-index: 8 !important; }

.leaflet-popup  { z-index: 10 !important; }

/* ── Import Modal ── */
.import-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:1000; display:flex; align-items:center; justify-content:center; padding:20px; }
.import-modal { background:#fff; border-radius:8px; border:1px solid #e2e8f0; width:100%; max-width:780px; max-height:88vh; display:flex; flex-direction:column; box-shadow:0 8px 40px rgba(0,0,0,.18); }
.import-modal-header { padding:18px 22px; border-bottom:1px solid #e2e8f0; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.import-modal-header h2 { font-size:15px; font-weight:600; color:#1e293b; margin:0; }
.import-modal-close { background:none; border:none; cursor:pointer; color:#64748b; font-size:18px; line-height:1; padding:4px; }
.import-modal-body { padding:22px; flex:1; overflow-y:auto; }
.import-modal-footer { padding:14px 22px; border-top:1px solid #e2e8f0; display:flex; align-items:center; gap:10px; flex-shrink:0; }
.import-desc { font-size:13px; color:#64748b; margin-bottom:18px; }
.import-btn-download { margin-bottom:18px; }
.import-dropzone { border:2px dashed #cbd5e1; border-radius:6px; padding:32px 20px; text-align:center; cursor:pointer; transition:border-color .15s, background .15s; background:#fafbfc; }
.import-dropzone:hover, .import-dropzone.drag-over { border-color:#1e3a5f; background:#f0f4f8; }
.import-dropzone-icon { font-size:32px; margin-bottom:8px; }
.import-dropzone p { font-size:13px; color:#64748b; margin:0 0 4px; }
.import-dropzone-link { color:#1e3a5f; text-decoration:underline; cursor:pointer; }
.import-dropzone-hint { font-size:11px; color:#94a3b8; }
.import-uploading { text-align:center; padding:20px; color:#64748b; font-size:13px; }

/* Summary badges */
.import-summary { display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.import-badge { font-size:12px; font-weight:600; padding:4px 10px; border-radius:4px; }
.import-badge-ok   { background:#f0fdf4; color:#15803d; }
.import-badge-warn { background:#fef9ee; color:#92400e; }
.import-badge-err  { background:#fef2f2; color:#b91c1c; }

/* Preview table */
.import-preview-table-wrap { max-height:340px; overflow-y:auto; border:1px solid #e2e8f0; border-radius:6px; }
.import-preview-table { width:100%; border-collapse:collapse; font-size:12px; }
.import-preview-table thead th { background:#f8fafc; padding:8px 10px; text-align:left; font-weight:600; color:#64748b; text-transform:uppercase; font-size:10px; letter-spacing:.5px; border-bottom:1px solid #e2e8f0; position:sticky; top:0; }
.import-preview-table tbody td { padding:7px 10px; border-bottom:1px solid #f1f5f9; vertical-align:top; }
.import-row-ok   { background:#f0fdf4; }
.import-row-warn { background:#fef9ee; }
.import-row-err  { background:#fef2f2; }
.import-row-status { font-size:11px; font-weight:600; white-space:nowrap; }
.import-row-data { color:#374151; line-height:1.6; }
.import-row-issues { color:#b91c1c; font-size:11px; line-height:1.5; }
.import-row-issues-warn { color:#92400e; font-size:11px; line-height:1.5; }
.import-no-errors { font-size:13px; color:#15803d; text-align:center; padding:16px; }

/* Done step */
.import-done-msg { text-align:center; padding:20px; }
.import-done-icon { font-size:40px; margin-bottom:10px; }
.import-done-msg p { font-size:14px; color:#1e293b; margin:0 0 6px; font-weight:500; }
.import-done-batch { font-size:11px; color:#94a3b8; }
.import-done-batch code { background:#f1f5f9; padding:2px 6px; border-radius:3px; }
