/* ============================================
   PORTAL ADMINISTRATIVO — CSS
   ============================================ */
:root {
  --azul:      #1A4A00;
  --azul-med:  #3D7A00;
  --azul-clr:  #29ABE2;
  --dorado:    #E87722;
  --dorado-clr:#F5C400;
  --bg:        #f2f7ee;
  --sidebar-w: 240px;
  --trans:     .2s ease;
  --radius:    10px;
  --radius-sm: 7px;
  --sombra:    0 2px 10px rgba(0,0,0,.08);
  --sombra-lg: 0 4px 24px rgba(0,0,0,.12);
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: #1e293b;
  display: flex;
  min-height: 100vh;
  font-size: 15px;
}

/* ── SIDEBAR ──────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--azul);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo { font-size: 28px; display:flex; align-items:center; }
.sidebar-logo img { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; }
.sidebar-title { color: #fff; font-family: 'Cinzel', serif; font-size: .95rem; }
.sidebar-sub   { color: rgba(255,255,255,.5); font-size: .72rem; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  transition: var(--trans);
}
.nav-link:hover  { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.15); color: #fff; box-shadow: inset 3px 0 0 var(--dorado-clr); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.admin-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--dorado);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.admin-name { color: #fff; font-size: .85rem; font-weight: 700; }
.admin-rol  { color: rgba(255,255,255,.5); font-size: .72rem; text-transform: capitalize; }
.btn-logout {
  display: block;
  text-align: center;
  padding: 8px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.75);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: .82rem;
  transition: var(--trans);
}
.btn-logout:hover { background: rgba(239,68,68,.3); color: #fff; }

/* ── CONTENIDO PRINCIPAL ──────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title { font-family: 'Cinzel', serif; color: var(--azul); font-size: 1.4rem; }
.page-sub   { color: #64748b; font-size: .85rem; margin-top: 2px; }

/* ── CARDS ───────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.card-header h2 { font-size: 1rem; color: var(--azul); }
.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── MÉTRICAS ─────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.metric-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.metric-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.metric-val { font-size: 1.5rem; font-weight: 700; color: var(--azul); }
.metric-lbl { font-size: .78rem; color: #94a3b8; }

/* ── TABLAS ───────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.table thead tr { background: #f8fafc; border-bottom: 2px solid #e5e7eb; }
.table th {
  padding: 11px 14px;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.td-empty { text-align: center; padding: 40px; color: #94a3b8; }

/* ── BADGES ──────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .76rem;
  font-weight: 700;
  background: #e5e7eb;
  color: #374151;
  white-space: nowrap;
}
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-orange { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }

/* ── BOTONES ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: var(--trans);
  white-space: nowrap;
}
.btn-primary { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-med); }
.btn-outline { background: transparent; border-color: var(--azul); color: var(--azul); }
.btn-outline:hover { background: var(--azul); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 1rem;
  transition: var(--trans);
}
.btn-icon:hover { background: #f1f5f9; }
.btn-icon.btn-danger:hover { background: #fee2e2; }

.quick-btn {
  display: inline-block;
  padding: 10px 18px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  color: var(--azul);
  text-decoration: none;
  transition: var(--trans);
}
.quick-btn:hover { background: var(--azul); color: #fff; }

.link-sm { font-size: .82rem; color: var(--azul-med); text-decoration: none; }
.link-sm:hover { text-decoration: underline; }

/* ── FORMULARIOS ─────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { display: block; font-size: .82rem; font-weight: 700; color: #374151; margin-bottom: 5px; }
.form-input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: var(--trans);
  background: #fff;
}
.form-input:focus { border-color: var(--azul-med); box-shadow: 0 0 0 3px rgba(37,99,168,.12); }
textarea.form-input { resize: vertical; }
select.form-input { cursor: pointer; }

.form-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.form-grid2 .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid2 { grid-template-columns: 1fr; } }

/* ── MODALES ─────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sombra-lg);
  animation: fadeUp .2s ease;
}
@keyframes fadeUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { font-family: 'Cinzel', serif; color: var(--azul); font-size: 1rem; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #94a3b8; transition: var(--trans); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── ALERTAS ─────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .88rem; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* ── TOAST ───────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--sombra-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: var(--trans);
  z-index: 9999;
  max-width: 360px;
}
.toast.show  { transform: none; opacity: 1; }
.toast.error { background: #dc2626; }

/* ── TALLER ROWS en DASHBOARD ────────────── */
.taller-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.taller-row:last-child { border: none; }
.taller-nombre { font-weight: 700; color: var(--azul); font-size: .9rem; }
.taller-meta   { font-size: .78rem; color: #94a3b8; margin-top: 2px; }
.empty-msg { color: #94a3b8; text-align: center; padding: 20px; font-size: .9rem; }

/* ── ANUNCIOS en ADMIN ──────────────────── */
.anuncio-card {
  background: var(--bg);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--trans);
}
.anuncio-card:hover { box-shadow: var(--sombra); }
.anuncio-titulo { font-weight: 700; color: var(--azul); margin-bottom: 6px; }
.anuncio-desc   { font-size: .85rem; color: #555; margin-bottom: 8px; }
.anuncio-btn    { display: inline-block; padding: 5px 12px; background: var(--azul); color: #fff; border-radius: 20px; font-size: .78rem; }

/* ── MOBILE NAV BAR ──────────────────────── */
.mobile-nav-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 54px;
  background: var(--azul);
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  z-index: 210;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.mobile-nav-title {
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: .88rem;
  flex: 1;
}
.nav-hamburger {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans);
}
.nav-hamburger:hover { background: rgba(255,255,255,.22); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 195;
}

.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  align-items: center;
  justify-content: center;
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    top: 0;
  }
  .sidebar-brand { padding-right: 50px; }
  .sidebar-close-btn { display: flex; }
  .main-wrap {
    margin-left: 0;
    margin-top: 54px;
  }
  .mobile-nav-bar { display: flex; }

  body.sidebar-open .sidebar          { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay  { display: block; }

  /* Topbar desktop queda oculto en mobile si se usa mobile-nav-bar */
  .topbar { margin-top: 0; }
}
