/* ============================================================
   Sistema de Radicación de Documentos — Monarca Computer S.A.S
   Estilos globales v1.0.0
   ============================================================ */

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

:root {
  --primary:   #1a3a6b;
  --primary-h: #14305a;
  --accent:    #e8a020;
  --danger:    #c0392b;
  --success:   #27ae60;
  --bg:        #f4f6f9;
  --white:     #ffffff;
  --border:    #dde1e7;
  --text:      #2d3748;
  --text-light:#718096;
  --shadow:    0 2px 8px rgba(0,0,0,0.10);
  --radius:    6px;
}

body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }

/* ---- Login ---- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--primary); }
.login-card { background: var(--white); border-radius: 10px; padding: 40px 36px; width: 360px; box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h2 { color: var(--primary); font-size: 18px; letter-spacing: 1px; }
.login-logo p { color: var(--text-light); font-size: 12px; margin-top: 4px; }

/* ---- Navbar ---- */
.navbar { background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 52px; box-shadow: var(--shadow); }
.navbar-brand { font-weight: 700; font-size: 15px; letter-spacing: 0.5px; }
.navbar-menu { display: flex; align-items: center; gap: 4px; }
.nav-link { color: rgba(255,255,255,0.8); text-decoration: none; padding: 6px 12px; border-radius: var(--radius); font-size: 13px; transition: background .2s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.15); color: #fff; }

/* ---- Layout principal ---- */
.main-content { max-width: 1100px; margin: 32px auto; padding: 0 24px; }
.main-content h1 { font-size: 22px; color: var(--primary); margin-bottom: 6px; }
.subtitle { color: var(--text-light); margin-bottom: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { margin-bottom: 0; }

/* ---- Stats ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); border-top: 3px solid var(--primary); }
.stat-number { font-size: 36px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ---- Formularios ---- */
.form-card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="file"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; color: var(--text); background: var(--white); transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; }
small { color: var(--text-light); font-size: 11px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ---- Botones ---- */
.btn { display: inline-block; padding: 9px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: background .2s, opacity .2s; }
.btn-primary  { background: var(--primary);   color: #fff; }
.btn-primary:hover  { background: var(--primary-h); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e0; }
.btn-danger   { background: var(--danger);    color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Búsqueda ---- */
.search-bar { display: flex; gap: 12px; margin-bottom: 20px; }
.search-input { flex: 1; }

/* ---- Tablas ---- */
.tabla { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tabla th { background: var(--primary); color: #fff; padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.3px; }
.tabla td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.tabla tr:last-child td { border-bottom: none; }
.tabla tr:hover td { background: #f0f4f8; }
.section { margin-top: 32px; }
.section h2 { font-size: 16px; color: var(--primary); margin-bottom: 12px; }

/* ---- Paginación ---- */
.paginacion { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.paginacion button { padding: 6px 12px; border: 1px solid var(--border); background: var(--white); border-radius: var(--radius); cursor: pointer; }
.paginacion button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Modales ---- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: var(--white); border-radius: 10px; padding: 32px; width: 520px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.modal-content h2 { color: var(--primary); margin-bottom: 20px; font-size: 18px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ---- Resultado radicado ---- */
.radicado-resultado { text-align: center; background: var(--bg); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.radicado-numero { font-size: 20px; font-weight: 700; color: var(--primary); font-family: monospace; letter-spacing: 2px; margin-bottom: 12px; }

/* ---- Mensajes ---- */
.error-msg { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.success-msg { background: #f0fff4; color: var(--success); border: 1px solid #9ae6b4; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; }

/* ---- Radio group ---- */
.radio-group { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.radio-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: normal; }
.radio-label input[type="radio"] { width: auto; }

/* ---- Aviso plantilla ---- */
.aviso-plantilla {
  margin-top: 8px; padding: 10px 14px;
  background: #fffbeb; border: 1px solid #f6c444; border-radius: var(--radius);
  font-size: 12px; color: #7d4e00;
}
.aviso-plantilla a { color: var(--primary); font-weight: 600; }

/* ---- Dashboard estadísticas ---- */
.stats-filtro-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.filtro-acciones { display: flex; gap: 8px; align-items: flex-end; }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.chart-wide { grid-column: 1 / -1; }
.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.chart-card h2 { font-size: 14px; color: var(--primary); margin-bottom: 16px; }

@media (max-width: 768px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-wide  { grid-column: 1; }
  .stats-filtro-row { flex-direction: column; align-items: stretch; }
}

/* ---- Sticker de impresión ---- */
@media print {
  .sticker-print {
    width: 10cm; height: 5cm;
    border: 1px solid #000;
    padding: 6px;
    font-family: Arial, sans-serif;
    font-size: 9pt;
    page-break-after: always;
  }
  .sticker-print .sticker-numero { font-weight: bold; font-size: 11pt; }
}
