/**
 * SGRCP — Design System
 * Dirección Regional de Agricultura Ucayali
 * Paleta: Verde institucional + Azul marino + Grises neutros
 */

/* ─── Importar fuente Inter ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Variables CSS ─────────────────────────────────────────────────────── */
:root {
  /* Colores principales */
  --primary:          #0f5132;
  --primary-mid:      #198754;
  --primary-light:    #d1e7dd;
  --primary-hover:    #146c43;
  --secondary:        #1e3a5f;
  --secondary-light:  #dce8f5;
  --accent:           #20c997;
  --accent-light:     #d2f4ea;

  /* Neutros */
  --bg:               #f0f4f8;
  --surface:          #ffffff;
  --border:           #e2e8f0;
  --border-light:     #f1f5f9;

  /* Texto */
  --text:             #1e293b;
  --text-muted:       #64748b;
  --text-light:       #94a3b8;

  /* Sidebar */
  --sidebar-bg:       #0f172a;
  --sidebar-width:    260px;
  --sidebar-hover:    rgba(255,255,255,0.07);
  --sidebar-active:   rgba(255,255,255,0.14);
  --sidebar-border:   rgba(255,255,255,0.06);

  /* Semánticos */
  --success:          #198754;
  --warning:          #f59e0b;
  --danger:           #ef4444;
  --info:             #3b82f6;

  /* Espaciado y forma */
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        14px;
  --radius-xl:        20px;
  --shadow-sm:        0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:        0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:        0 10px 30px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-glow:      0 0 0 3px rgba(25,135,84,0.18);
  --transition:       200ms cubic-bezier(0.4,0,0.2,1);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ─── TIPOGRAFÍA ────────────────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 600; letter-spacing: -0.01em; }
.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0;
}
.text-muted { color: var(--text-muted) !important; }

/* ─── NAVBAR PÚBLICA ────────────────────────────────────────────────────── */
.navbar-public {
  background: var(--primary);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: background var(--transition), box-shadow var(--transition);
}
.navbar-public .navbar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}
.navbar-public .brand-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  color: #fff;
  flex-shrink: 0;
}
.navbar-public .brand-text-main {
  font-size: 0.95rem; font-weight: 700; color: #fff; line-height: 1.1;
}
.navbar-public .brand-text-sub {
  font-size: 0.65rem; color: rgba(255,255,255,0.72); line-height: 1.2; font-weight: 400;
}
.navbar-public .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-size: 0.875rem; font-weight: 500;
  padding: 0.45rem 0.85rem !important;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  display: flex; align-items: center; gap: 0.35rem;
}
.navbar-public .nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff !important;
}
.navbar-public .nav-link.active {
  background: rgba(255,255,255,0.18);
  color: #fff !important;
}
.navbar-public .btn-access {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 0.8rem; font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.navbar-public .btn-access:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ─── HERO PÚBLICO ──────────────────────────────────────────────────────── */
.hero-public {
  background: linear-gradient(135deg, var(--primary) 0%, #1a7a4a 50%, var(--secondary) 100%);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero-public::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-public .hero-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
  font-size: 0.75rem; font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.hero-public h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.hero-public .hero-sub {
  color: rgba(255,255,255,0.78);
  font-size: 1rem;
  margin-bottom: 2rem;
  font-weight: 400;
}
.hero-public .btn-hero-primary {
  background: #fff;
  color: var(--primary);
  font-weight: 600; font-size: 0.95rem;
  padding: 0.7rem 1.75rem;
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem;
}
.hero-public .btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  color: var(--primary);
}
.hero-public .btn-hero-secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 500; font-size: 0.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.3);
  transition: background var(--transition);
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem;
}
.hero-public .btn-hero-secondary:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* ─── CARDS GENERALES ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
  font-weight: 600;
  font-size: 0.9rem;
}
.card-body { padding: 1.25rem; }

/* Stats cards */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.stat-card .stat-value {
  font-size: 1.875rem; font-weight: 700;
  line-height: 1; color: var(--text);
}
.stat-card .stat-label {
  font-size: 0.8rem; color: var(--text-muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.stat-card .stat-trend {
  font-size: 0.78rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.2rem;
}
.stat-card::after {
  content: '';
  position: absolute; right: -10px; bottom: -10px;
  width: 70px; height: 70px;
  border-radius: 50%;
  opacity: 0.06;
}
.stat-card.stat-primary   { border-left: 3px solid var(--primary-mid); }
.stat-card.stat-primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.stat-primary::after { background: var(--primary-mid); }
.stat-card.stat-info      { border-left: 3px solid var(--info); }
.stat-card.stat-info .stat-icon { background: #dbeafe; color: var(--info); }
.stat-card.stat-info::after { background: var(--info); }
.stat-card.stat-warning   { border-left: 3px solid var(--warning); }
.stat-card.stat-warning .stat-icon { background: #fef3c7; color: var(--warning); }
.stat-card.stat-warning::after { background: var(--warning); }
.stat-card.stat-secondary { border-left: 3px solid var(--secondary); }
.stat-card.stat-secondary .stat-icon { background: var(--secondary-light); color: var(--secondary); }
.stat-card.stat-secondary::after { background: var(--secondary); }

/* Publication cards (public) */
.pub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.pub-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.pub-card .pub-card-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--primary-mid), var(--accent));
}
.pub-card .pub-card-body { padding: 1.1rem; flex: 1; }
.pub-card .pub-card-title {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  text-decoration: none; line-height: 1.4;
  display: block; margin-bottom: 0.6rem;
}
.pub-card .pub-card-title:hover { color: var(--primary-mid); }
.pub-card .pub-card-footer {
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* ─── TABLAS ────────────────────────────────────────────────────────────── */
.table {
  font-size: 0.875rem;
  color: var(--text);
}
.table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  white-space: nowrap;
}
.table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover td { background: rgba(25,135,84,0.04); }

/* ─── FORMS ─────────────────────────────────────────────────────────────── */
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-mid);
  box-shadow: var(--shadow-glow);
  outline: none;
  background: var(--surface);
}
.form-control::placeholder { color: var(--text-light); }
.form-text {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.input-group .input-group-text {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.input-group .form-control:focus + .input-group-text,
.input-group-text + .form-control:focus {
  border-color: var(--primary-mid);
}
.input-group > .form-control:focus { z-index: 3; }

/* Form validation states */
.form-control.is-valid { border-color: var(--success); background-image: none; }
.form-control.is-valid:focus { box-shadow: 0 0 0 3px rgba(25,135,84,0.15); }
.form-control.is-invalid { border-color: var(--danger); background-image: none; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.valid-feedback   { font-size: 0.775rem; color: var(--success); font-weight: 500; }
.invalid-feedback { font-size: 0.775rem; color: var(--danger);  font-weight: 500; }

/* ─── BOTONES ───────────────────────────────────────────────────────────── */
.btn {
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 0.45rem 1rem;
  transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.btn-primary {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}
.btn-primary:hover {
  background: #162d4e; border-color: #162d4e;
  box-shadow: 0 4px 12px rgba(30,58,95,0.3);
  transform: translateY(-1px);
}
.btn-success {
  background: var(--primary-mid);
  border-color: var(--primary-mid); color: #fff;
}
.btn-success:hover {
  background: var(--primary-hover); border-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(25,135,84,0.3);
  transform: translateY(-1px);
}
.btn-outline-success {
  color: var(--primary-mid); border-color: var(--primary-mid);
}
.btn-outline-success:hover {
  background: var(--primary-mid); color: #fff;
  transform: translateY(-1px);
}
.btn-outline-secondary { color: var(--text-muted); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-sm { font-size: 0.8rem; padding: 0.3rem 0.7rem; }
.btn-lg { font-size: 1rem; padding: 0.65rem 1.5rem; }

/* ─── BADGES ────────────────────────────────────────────────────────────── */
.badge {
  font-size: 0.72rem; font-weight: 600;
  padding: 0.3em 0.65em;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.badge-status {
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.badge-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ─── ALERTS ────────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: none;
  padding: 0.85rem 1.1rem;
  display: flex; align-items: flex-start; gap: 0.6rem;
}
.alert-success { background: var(--primary-light); color: #0a4020; }
.alert-danger   { background: #fee2e2; color: #7f1d1d; }
.alert-warning  { background: #fef3c7; color: #78350f; }
.alert-info     { background: #dbeafe; color: #1e3a8a; }

/* ─── SIDEBAR ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed; left: 0; top: 0;
  z-index: 1040;
  display: flex; flex-direction: column;
  transition: width var(--transition), transform var(--transition);
  overflow-x: hidden;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
.sidebar.collapsed { width: 64px; }

/* Sidebar header */
.sidebar-header {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 64px; flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--primary-mid);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; font-weight: 700;
}
.sidebar-brand { overflow: hidden; transition: opacity var(--transition), width var(--transition); }
.sidebar-brand-name {
  font-size: 0.875rem; font-weight: 700; color: #fff; line-height: 1.1;
  white-space: nowrap;
}
.sidebar-brand-sub {
  font-size: 0.65rem; color: rgba(255,255,255,0.45);
  white-space: nowrap; margin-top: 1px;
}
.sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; pointer-events: none; }

/* Sidebar toggle button */
.sidebar-toggle {
  width: 28px; height: 28px;
  background: var(--sidebar-hover);
  border: none; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0; margin-left: auto;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.sidebar-toggle:hover { background: var(--sidebar-active); color: #fff; }
.sidebar.collapsed .sidebar-toggle { transform: scaleX(-1); }

/* Sidebar nav */
.sidebar-nav { padding: 0.75rem 0.5rem; flex: 1; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 3px; }

.sidebar-section-label {
  font-size: 0.63rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
  padding: 0.85rem 0.6rem 0.3rem;
  white-space: nowrap; overflow: hidden;
  transition: opacity var(--transition);
}
.sidebar.collapsed .sidebar-section-label { opacity: 0; }

.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  color: rgba(255,255,255,0.65);
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none; white-space: nowrap;
  margin-bottom: 2px;
  position: relative;
}
.sidebar-nav .nav-link .nav-icon {
  font-size: 1rem; flex-shrink: 0;
  width: 20px; text-align: center;
}
.sidebar-nav .nav-link .nav-label {
  overflow: hidden; transition: opacity var(--transition), width var(--transition);
}
.sidebar.collapsed .sidebar-nav .nav-link .nav-label { opacity: 0; width: 0; }
.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover); color: #fff;
}
.sidebar-nav .nav-link.active {
  background: var(--primary-mid);
  color: #fff;
}
.sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--accent);
  border-radius: 0 2px 2px 0;
}

/* Sidebar tooltip on collapsed */
.sidebar.collapsed .nav-link { justify-content: center; }
.sidebar.collapsed .nav-link[data-bs-toggle="tooltip"] { position: relative; }

/* Sidebar footer */
.sidebar-footer {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sidebar-avatar {
  width: 30px; height: 30px; flex-shrink: 0;
  background: var(--primary-mid);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff;
}
.sidebar-user-name {
  font-size: 0.8rem; color: rgba(255,255,255,0.8); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: opacity var(--transition);
}
.sidebar.collapsed .sidebar-user-name { opacity: 0; width: 0; }
.sidebar-logout {
  display: flex; align-items: center; gap: 0.5rem;
  color: rgba(255,255,255,0.45); font-size: 0.8rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.sidebar-logout:hover { background: rgba(239,68,68,0.12); color: #fca5a5; }
.sidebar.collapsed .sidebar-logout { justify-content: center; }
.sidebar.collapsed .sidebar-logout span { opacity: 0; width: 0; overflow: hidden; }

/* ─── MAIN CONTENT (con sidebar) ────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left var(--transition);
}
.main-wrapper.expanded { margin-left: 64px; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1020;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }

.content-area { padding: 1.5rem; flex: 1; }
.content-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem;
}
.breadcrumb-bar {
  font-size: 0.78rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.35rem;
}
.breadcrumb-bar a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-bar a:hover { color: var(--primary-mid); }

/* ─── COUNTDOWN TIMER ───────────────────────────────────────────────────── */
.countdown-timer {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.countdown-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  text-align: center;
}
.countdown-block.urgent { border-color: var(--warning); background: #fffbeb; }
.countdown-block.expired { border-color: var(--danger); background: #fff1f2; }

/* ─── STEP CARDS (Portal público) ──────────────────────────────────────── */
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem 1.25rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.step-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.step-number {
  width: 40px; height: 40px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.step-icon {
  font-size: 2.25rem; margin-bottom: 0.75rem; display: block;
}
.step-card h6 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; }
.step-card p { font-size: 0.8rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* ─── SEARCH CARD (Portal público) ─────────────────────────────────────── */
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: relative;
  z-index: 2;
  margin-top: -2.5rem;
}

/* ─── FILTER BAR ────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

/* ─── PAGINATION ────────────────────────────────────────────────────────── */
.pagination .page-link {
  font-size: 0.8rem; border-radius: var(--radius-sm) !important;
  color: var(--text-muted); border-color: var(--border);
  margin: 0 2px; padding: 0.4rem 0.7rem;
  transition: all var(--transition);
}
.pagination .page-link:hover { background: var(--bg); color: var(--text); }
.pagination .page-item.active .page-link {
  background: var(--primary-mid); border-color: var(--primary-mid);
}

/* ─── FILE CARDS ────────────────────────────────────────────────────────── */
.file-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem; color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
}
.file-card:hover { border-color: var(--primary-mid); }
.file-card.cuestionario { border-left: 3px solid var(--info); }
.file-card.especificaciones { border-left: 3px solid var(--warning); }

/* ─── LOADING SPINNER (RUC) ─────────────────────────────────────────────── */
.spinner-ruc {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--primary-mid); border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── FOOTER ────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--sidebar-bg);
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
}
.panel-footer {
  background: var(--sidebar-bg);
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
}

/* ─── EMPTY STATE ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3.5rem 1.5rem;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 3rem; opacity: 0.35; display: block; margin-bottom: 1rem;
}
.empty-state p { font-size: 0.875rem; margin: 0; }

/* ─── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper, .main-wrapper.expanded { margin-left: 0; }
  .panel-footer { margin-left: 0; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
  }
  .sidebar-overlay.active { display: block; }
}
@media (max-width: 767.98px) {
  .content-area { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .search-card { margin-top: 0; border-radius: var(--radius-md); }
  .hero-public { padding: 3rem 0 5rem; }
  .stat-card { margin-bottom: 0; }
}

/* ─── Print ─────────────────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .navbar-public, .btn, footer, form,
  .filter-bar, .site-footer, .panel-footer { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd; }
}

/* ─── MICROINTERACCIONES ────────────────────────────────────────────────── */
/* Ripple en botones */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0; border-radius: inherit;
  transition: opacity 300ms;
}
.btn:active::after { opacity: 1; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Focus visible global */
:focus-visible {
  outline: 2px solid var(--primary-mid);
  outline-offset: 2px;
}

/* Smooth scroll */
html { scroll-behavior: smooth; }
