:root {
  --green:        #006B3C;
  --green-dk:     #004D2B;
  --green-lt:     #E8F4EE;
  --green-mid:    #1A8C56;
  --amber:        #B45309;
  --amber-lt:     #FEF3C7;
  --red:          #C0392B;
  --red-lt:       #FDECEA;
  --slate:        #1E293B;
  --slate-mid:    #475569;
  --slate-lt:     #94A3B8;
  --border:       #E2E8F0;
  --bg:           #F8FAFC;
  --white:        #FFFFFF;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 4px 12px rgba(0,0,0,0.08);
  --font:         'Inter', -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--slate);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ─── */
.header {
  background: var(--green);
  color: #fff;
  padding: 14px 20px 12px;
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
}
.header-brand { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: #FFD700; }
.header-info { flex: 1; }
.header-info h1 { font-size: 14px; font-weight: 600; letter-spacing: -0.1px; }
.header-info p  { font-size: 11px; opacity: 0.7; margin-top: 1px; }
.header-date    { font-size: 11px; opacity: 0.75; text-align: right; line-height: 1.5; }

/* ─── NAV ─── */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-tab {
  flex: 0 0 auto;
  padding: 11px 15px;
  font-size: 12px; font-weight: 500; font-family: var(--font);
  color: var(--slate-mid);
  border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.nav-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

/* ─── VIEWS ─── */
.view { display: none; padding: 16px; }
.view.active { display: block; }

/* ─── CARD ─── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.card-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--slate-lt);
  margin-bottom: 12px;
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
}
.badge-ok    { background: var(--green-lt);  color: var(--green); }
.badge-warn  { background: var(--amber-lt);  color: var(--amber); }
.badge-err   { background: var(--red-lt);    color: var(--red); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: var(--radius-sm);
  border: none; font-family: var(--font);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  width: 100%; margin-bottom: 8px;
}
.btn:active { transform: scale(0.97); filter: brightness(0.93); }
.btn-green  { background: var(--green);  color: #fff; }
.btn-amber  { background: var(--amber);  color: #fff; }
.btn-red    { background: var(--red);    color: #fff; }
.btn-ghost  { background: var(--white);  color: var(--green); border: 1.5px solid var(--green); }
.btn-slate  { background: var(--slate);  color: #fff; }
.btn-sm {
  padding: 7px 12px; font-size: 12px; border-radius: var(--radius-sm);
  border: none; font-family: var(--font); font-weight: 500; cursor: pointer;
  transition: filter 0.15s;
}
.btn-sm:active { filter: brightness(0.9); }

/* ─── FORM FIELDS ─── */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11px; font-weight: 600; color: var(--slate-mid); margin-bottom: 5px; letter-spacing: 0.2px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; color: var(--slate);
  background: var(--white); outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); }
.field textarea { resize: vertical; min-height: 72px; }

/* ─── IN DEVELOPMENT OVERLAY ─── */
.wip-overlay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center;
}
.wip-badge {
  background: var(--amber-lt); color: var(--amber);
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 20px; margin-bottom: 16px;
  text-transform: uppercase;
}
.wip-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.4; }
.wip-overlay h2 { font-size: 17px; font-weight: 600; color: var(--slate); margin-bottom: 6px; }
.wip-overlay p { font-size: 13px; color: var(--slate-lt); line-height: 1.6; }

/* ─── CALENDAR ─── */
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-nav h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.cal-nav-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--white);
  font-size: 16px; color: var(--slate-mid);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.cal-nav-btn:active { background: var(--green-lt); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
  margin-bottom: 12px;
}
.cal-daylabel {
  text-align: center; font-size: 10px; font-weight: 600;
  color: var(--slate-lt); padding: 4px 0; letter-spacing: 0.3px;
}
.cal-cell {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; position: relative; transition: background 0.12s;
  font-size: 12px; font-weight: 500; color: var(--slate);
  border: 1.5px solid transparent;
  gap: 2px;
}
.cal-cell:active { filter: brightness(0.93); }
.cal-cell.empty { cursor: default; pointer-events: none; }
.cal-cell.today { border-color: var(--green); font-weight: 700; color: var(--green); }
.cal-cell.selected { background: var(--green); color: #fff; border-color: var(--green); }
.cal-cell.selected.today { background: var(--green); }
.cal-cell.has-geo  { background: var(--green-lt); }
.cal-cell.has-meth { background: #EFF6FF; }
.cal-cell.has-both { background: linear-gradient(135deg, var(--green-lt) 50%, #EFF6FF 50%); }
.cal-cell.has-inc  { background: var(--red-lt); }
.cal-cell.selected { background: var(--green) !important; color: #fff !important; }

.cal-dots { display: flex; gap: 2px; }
.cal-dot  { width: 4px; height: 4px; border-radius: 50%; }
.cal-dot-geo  { background: var(--green); }
.cal-dot-meth { background: #2563EB; }
.cal-dot-inc  { background: var(--red); }
.cal-cell.selected .cal-dot-geo  { background: rgba(255,255,255,0.8); }
.cal-cell.selected .cal-dot-meth { background: rgba(255,255,255,0.8); }
.cal-cell.selected .cal-dot-inc  { background: rgba(255,255,255,0.8); }

.cal-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border);
}
.cal-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--slate-mid);
}
.cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ─── DAY PANEL ─── */
.day-panel {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 12px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.day-panel-header {
  padding: 14px 16px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.day-panel-header h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.day-panel-date { font-size: 11px; color: var(--slate-lt); }

.day-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 12px 16px;
}
.day-act-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; font-family: var(--font);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
}
.day-act-btn:active { transform: scale(0.96); }
.day-act-carga { background: var(--green); color: #fff; }
.day-act-inc   { background: var(--red-lt); color: var(--red); border-color: var(--red-lt); }
.day-act-edit  { background: var(--bg); color: var(--slate-mid); border-color: var(--border); }
.day-act-del   { background: var(--bg); color: var(--slate-lt);  border-color: var(--border); }

/* ─── DAY TABS ─── */
.day-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none; padding: 0 16px;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex: 0 0 auto; padding: 10px 14px;
  font-family: var(--font); font-size: 12px; font-weight: 500;
  color: var(--slate-lt); border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: color 0.15s, border-color 0.15s;
}
.day-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.day-tab-inc.active { color: var(--red); border-bottom-color: var(--red); }

.day-tab-content { padding: 16px; min-height: 120px; }
.day-tab-panel { display: none; animation: panelIn 0.15s ease; }
.day-tab-panel.active { display: block; }
@keyframes panelIn { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:translateY(0); } }

/* ─── PHOTO GRID ─── */
.photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
  margin-top: 10px;
}
.photo-thumb {
  aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; position: relative;
}
.photo-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.2s;
}
.photo-thumb:active img { transform: scale(0.97); }

.carga-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 10px;
}
.carga-card:last-child { margin-bottom: 0; }
.carga-card-header {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px;
}
.carga-card-title { font-size: 13px; font-weight: 600; flex: 1; }
.carga-card-sub   { font-size: 11px; color: var(--slate-lt); margin-top: 1px; }
.carga-card-actions { display: flex; gap: 5px; }

.empty-transport {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 16px; text-align: center;
}
.empty-transport-icon { font-size: 32px; opacity: 0.25; margin-bottom: 10px; }
.empty-transport h4 { font-size: 14px; font-weight: 500; color: var(--slate-mid); margin-bottom: 6px; }
.empty-transport p  { font-size: 12px; color: var(--slate-lt); margin-bottom: 14px; }

.inc-card {
  border: 1px solid var(--red-lt); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 10px; background: #FFFBFB;
}
.inc-card-title { font-size: 13px; font-weight: 600; color: var(--slate); }
.inc-card-transport { font-size: 11px; color: var(--slate-lt); margin-top: 1px; }
.inc-card-desc {
  font-size: 12px; color: var(--slate-mid); line-height: 1.6;
  margin-top: 8px; padding: 8px; background: var(--red-lt);
  border-radius: var(--radius-sm);
}

/* ─── MODAL ─── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.5); z-index: 200;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 16px 16px 0 0;
  padding: 20px 20px 32px;
  width: 100%; max-height: 88vh; overflow-y: auto;
}
.modal-handle {
  width: 36px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 0 auto 18px;
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.2px; }
.modal-sub   { font-size: 12px; color: var(--slate-lt); margin-bottom: 18px; }

/* ─── PHOTO DROPZONE ─── */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; cursor: pointer;
  background: var(--bg); transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: var(--green); background: var(--green-lt); }
.dropzone-icon { font-size: 24px; opacity: 0.4; margin-bottom: 6px; }
.dropzone-text { font-size: 12px; color: var(--slate-lt); }

.preview-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px;
}
.preview-item {
  aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; position: relative;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-remove {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.65); border: none; color: #fff;
  font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ─── VIEWER ─── */
.viewer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.95); z-index: 300;
  flex-direction: column; align-items: center; justify-content: center;
}
.viewer-overlay.open { display: flex; }
.viewer-img { max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: 4px; }
.viewer-caption { color: rgba(255,255,255,0.6); font-size: 12px; margin-top: 10px; }
.viewer-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.viewer-nav {
  display: flex; gap: 16px; margin-top: 14px;
}
.viewer-nav-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--slate); color: #fff;
  padding: 10px 18px; border-radius: 24px;
  font-size: 13px; font-weight: 500;
  z-index: 999; transition: transform 0.25s;
  white-space: nowrap; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
/* ─── HEADER LOGO ─── */
.header-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}
