/* ── ESTILOS DEL PANEL ADMINISTRATIVO — GOBERNACIÓN DEL ESTADO ZULIA ── */
:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --gob-blue: #1e3a8a;
  --gob-dark: #0f172a;
  --gob-gold: #f59e0b;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── PANTALLA DE LOGIN ── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at top right, #e0f2fe 0%, #f8fafc 60%);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  text-align: center;
}

.login-logo {
  width: 72px;
  height: auto;
  margin-bottom: 16px;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gob-dark);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 12px 42px 12px 14px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.toggle-password-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.toggle-password-btn:hover {
  color: var(--text-main);
}

.btn-login-submit {
  width: 100%;
  background: var(--gob-blue);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}

.btn-login-submit:hover {
  background: #172554;
}

.btn-login-submit:active {
  transform: scale(0.99);
}

.login-error {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  text-align: left;
}

/* ── PANEL ADMINISTRATIVO PRINCIPAL ── */
.admin-layout {
  display: none; /* Se activa tras login */
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.admin-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.admin-header-logo {
  width: 40px;
  height: auto;
}

.admin-header-titles {
  display: flex;
  flex-direction: column;
}

.admin-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gob-dark);
}

.admin-header-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-header-action {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-header-public {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-header-public:hover {
  background: #e2e8f0;
}

.btn-header-logout {
  background: #fff;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.btn-header-logout:hover {
  background: var(--danger-bg);
}

/* ── CONTENIDO DEL DASHBOARD ── */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  flex: 1;
}

/* Fila de Métricas / KPIs */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-blue { background: #e0f2fe; color: var(--primary); }
.kpi-icon-green { background: #dcfce7; color: var(--success); }
.kpi-icon-amber { background: #fef3c7; color: var(--warning); }
.kpi-icon-purple { background: #f3e8ff; color: #9333ea; }

.kpi-details {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gob-dark);
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Barra de Pestañas (Tabs) */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  overflow-x: auto;
}

.admin-tab-btn {
  background: none;
  border: none;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-tab-btn:hover {
  color: var(--primary);
}

.admin-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Paneles de Contenido */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Tarjetas y Secciones */
.admin-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.admin-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gob-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Filas de Información */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.info-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.info-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--gob-dark);
}

/* Botones de Acción */
.btn-primary-action {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.btn-primary-action:hover {
  background: var(--primary-hover);
}

.btn-secondary-action {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-secondary-action:hover {
  background: #f1f5f9;
}

.btn-danger-action {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger-action:hover {
  background: #dc2626;
}

.btn-warning-action {
  background: var(--warning);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Estilos de la Barra de Progreso y AI en Admin */
.progress-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #38bdf8);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-ticker {
  font-size: 12px;
  color: var(--text-muted);
}

/* Caja de Mensaje / Notificaciones */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.admin-toast.success { background: #065f46; border-left: 4px solid #10b981; }
.admin-toast.error { background: #881337; border-left: 4px solid #ef4444; }

/* Log Console Box */
.log-console {
  background: #0f172a;
  color: #94a3b8;
  font-family: monospace;
  font-size: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  max-height: 220px;
  overflow-y: auto;
  line-height: 1.6;
}

.log-entry {
  display: flex;
  gap: 12px;
}

.log-time {
  color: #64748b;
}

.log-msg {
  color: #f1f5f9;
}
