/* OTIMIFY Estudio — dark brand theme */

:root {
  --bg: #05060a;
  --surface: #0d0f15;
  --surface2: #151820;
  --border: #1e2230;
  --text: #cdd8d0;
  --muted: #7d8b80;
  --neon: #9eff3d;
  --neon2: #3dffb0;
  --red: #ff4d4d;
  --orange: #ff9940;
  --radius: 10px;
  --font: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Login ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  width: 100%;
  max-width: 360px;
  padding: 48px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.login-box .wordmark {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--neon);
  margin-bottom: 6px;
}

.login-box .login-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.login-box .error {
  font-size: 0.85rem;
  color: var(--red);
  margin-bottom: 16px;
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-box input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.15s;
}

.login-box input[type="password"]:focus {
  border-color: var(--neon);
}

.login-box button {
  background: var(--neon);
  border: none;
  border-radius: 6px;
  color: #05060a;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 12px;
  transition: opacity 0.15s;
}

.login-box button:hover { opacity: 0.88; }

/* ---- App layout ---- */
header {
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.wordmark {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--neon);
}

.header-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  margin-top: 40px;
}

.section-title:first-child { margin-top: 0; }

/* ---- Grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.12s;
}

.card:hover {
  border-color: var(--neon);
  transform: translateY(-2px);
}

.card.cancelado:hover { border-color: var(--muted); }

.card-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
  background: var(--surface2);
}

.card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.card-body {
  padding: 14px 16px 16px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-fecha {
  font-size: 0.78rem;
  color: var(--muted);
  flex: 1;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-renderizado, .badge-agendado {
  background: rgba(158, 255, 61, 0.15);
  color: var(--neon);
}

.badge-publicado {
  background: rgba(61, 255, 176, 0.12);
  color: var(--neon2);
}

.badge-cancelado {
  background: rgba(125, 139, 128, 0.2);
  color: var(--muted);
}

.badge-descartado, .badge-error {
  background: rgba(255, 77, 77, 0.15);
  color: var(--red);
}

.badge-pendiente, .badge-maestro_ok, .badge-auditado {
  background: rgba(255, 153, 64, 0.15);
  color: var(--orange);
}

.card-titulo {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.88);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  padding: 32px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-header {
  margin-bottom: 24px;
}

.modal-fecha {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.modal-titulo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

/* ---- Placas grid ---- */
.placas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.placa-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface2);
  display: block;
}

.placa-placeholder {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--surface2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
}

/* ---- Caption ---- */
.caption-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.caption-text {
  font-size: 0.88rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ---- Cancelar button ---- */
.btn-cancelar {
  background: transparent;
  border: 1px solid var(--red);
  border-radius: 6px;
  color: var(--red);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  transition: background 0.15s;
}

.btn-cancelar:hover { background: rgba(255, 77, 77, 0.1); }

.btn-cancelar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Empty state ---- */
.empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 16px 0;
}

/* ---- Loading ---- */
.loading {
  color: var(--muted);
  padding: 48px 0;
  text-align: center;
  font-size: 0.9rem;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  header { padding: 14px 16px; }
  main { padding: 24px 16px 48px; }
  .placas-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 24px 20px; }
}
