/* Cienpar Panel — mismo verde de marca que cienpar.com.py (--verde: #2EAD4B) */
:root {
  --verde: #2ead4b;
  --verde-oscuro: #1f7a36;
  --verde-tint: #e5f4e9;
  --gris-900: #1a2420;
  --gris-600: #5b665f;
  --gris-300: #dde3dc;
  --gris-100: #f6f7f4;
  --blanco: #ffffff;
  --rojo: #b9402a;
  --rojo-tint: #fbe9e5;
  --ambar: #a5730f;
  --ambar-tint: #faf1de;
  --radio: 8px;
  --sombra: 0 1px 2px rgba(20, 30, 24, 0.05), 0 4px 14px -8px rgba(20, 30, 24, 0.15);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--gris-100);
  color: var(--gris-900);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--verde-oscuro); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; }

/* ---- layout ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--gris-900);
  color: #d6ddd8;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .brand {
  color: var(--blanco);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--verde); }
.sidebar a {
  color: #b7c1ba;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 0.92rem;
}
.sidebar a:hover { background: rgba(255,255,255,0.06); text-decoration: none; color: var(--blanco); }
.sidebar a.active { background: var(--verde); color: #fff; font-weight: 600; }
.sidebar .user-box {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.82rem;
  color: #93a099;
}
.sidebar .user-box b { color: #e4e9e5; display:block; }

.main { flex: 1; min-width: 0; padding: 26px 32px 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.topbar h1 { font-size: 1.4rem; }

/* ---- login ---- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--gris-900), #223229);
}
.login-card {
  background: var(--blanco); border-radius: 12px; padding: 34px 32px;
  width: 100%; max-width: 360px; box-shadow: var(--sombra);
}
.login-card .brand { display:flex; align-items:center; gap:8px; font-weight:700; font-size:1.15rem; margin-bottom: 4px; }
.login-card .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--verde); }
.login-card p.sub { color: var(--gris-600); font-size: 0.88rem; margin-bottom: 22px; }

/* ---- forms ---- */
label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 4px; color: var(--gris-900); }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--gris-300); border-radius: 6px;
  font-size: 0.92rem; font-family: inherit; background: var(--blanco); color: var(--gris-900);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--verde); outline-offset: 0; border-color: var(--verde); }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer;
  background: var(--verde); color: #fff; padding: 9px 16px; border-radius: 7px;
  font-size: 0.9rem; font-weight: 600; font-family: inherit;
}
.btn:hover { background: var(--verde-oscuro); text-decoration: none; }
.btn.secondary { background: var(--blanco); color: var(--gris-900); border: 1px solid var(--gris-300); }
.btn.secondary:hover { background: var(--gris-100); }
.btn.danger { background: var(--rojo); }
.btn.block { width: 100%; justify-content: center; }

/* ---- cards / tiles ---- */
.card {
  background: var(--blanco); border: 1px solid var(--gris-300); border-radius: var(--radio);
  padding: 18px 20px; box-shadow: var(--sombra);
}
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile { background: var(--blanco); border: 1px solid var(--gris-300); border-radius: var(--radio); padding: 14px 16px; }
.tile .l { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gris-600); }
.tile .v { font-size: 1.35rem; font-weight: 700; margin-top: 4px; }
.section-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gris-600); margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--gris-300); border-radius: var(--radio); background: var(--blanco); }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--gris-300); white-space: nowrap; }
th { background: var(--gris-100); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gris-600); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--verde-tint); }

/* ---- badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.badge.disponible { background: var(--verde-tint); color: var(--verde-oscuro); }
.badge.reservado { background: var(--ambar-tint); color: var(--ambar); }
.badge.vendido { background: #e6e9e7; color: var(--gris-600); }
.badge.en_preparacion, .badge.en_taller { background: var(--ambar-tint); color: var(--ambar); }
.badge.en_consignacion { background: #e6f1f5; color: #2f6f8f; }
.badge.retenido, .badge.fuera_de_stock { background: var(--rojo-tint); color: var(--rojo); }

/* ---- flash messages ---- */
.flash { padding: 10px 14px; border-radius: 7px; margin-bottom: 14px; font-size: 0.88rem; }
.flash.success { background: var(--verde-tint); color: var(--verde-oscuro); }
.flash.error { background: var(--rojo-tint); color: var(--rojo); }

/* ---- pipeline kanban ---- */
.pipeline { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.pipeline-col { flex: 0 0 auto; width: 210px; background: var(--gris-100); border-radius: var(--radio); padding: 10px; }
.pipeline-col h4 { font-size: 0.78rem; text-transform: uppercase; color: var(--gris-600); display:flex; justify-content:space-between; }
.pipeline-card {
  background: var(--blanco); border: 1px solid var(--gris-300); border-radius: 7px;
  padding: 10px 11px; margin-top: 8px; font-size: 0.84rem; box-shadow: var(--sombra);
}
.pipeline-card .cust { font-weight: 700; }
.pipeline-card .veh { color: var(--gris-600); font-size: 0.8rem; margin-top: 2px; }
.pipeline-card form { margin-top: 8px; display:flex; gap:6px; }
.pipeline-card select { font-size: 0.78rem; padding: 4px 6px; }
.pipeline-col.perdido { background: var(--rojo-tint); }

/* ---- photo gallery ---- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; border: 1px solid var(--gris-300); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--gris-300); position: relative; margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--verde); }
.timeline .when { font-size: 0.74rem; color: var(--gris-600); }

@media (max-width: 820px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .sidebar .user-box { display: none; }
  .main { padding: 18px; }
}
