/* =====================================================================
   Diseño moderno para todo el panel (Bootstrap 4 / AdminLTE 3)
   Afecta tarjetas, tablas, formularios, ventanas (modals) y botones.
   ===================================================================== */
:root {
  --mv-primary: #2d5394; --mv-primary-dark: #1b3a6e; --mv-bg: #f3f5fa; --mv-border: #e3e8f1;
  --mv-text: #26324b; --mv-muted: #6b778c; --mv-radius: 12px;
  --mv-shadow: 0 1px 3px rgba(20, 35, 70, .06), 0 6px 18px rgba(20, 35, 70, .06);
}

body, .content-wrapper { background: var(--mv-bg); color: var(--mv-text); }

/* ---- Encabezado de pagina ---- */
.content-header h1 { font-size: 1.6rem; font-weight: 700; color: var(--mv-primary-dark); letter-spacing: -.01em; }
.content-header .breadcrumb { background: transparent; padding: 0; margin: 0; font-size: .85rem; }
.content-header { padding-top: 18px; }

/* ---- Tarjetas ---- */
.card { border: 0; border-radius: var(--mv-radius); box-shadow: var(--mv-shadow); margin-bottom: 18px; }
.card-header { background: transparent; border-bottom: 1px solid var(--mv-border); padding: 14px 18px; border-radius: var(--mv-radius) var(--mv-radius) 0 0; }
.card-header .card-title { font-weight: 700; color: var(--mv-primary-dark); margin: 0; }
.card-body { padding: 18px; }
.card-outline.card-primary { border-top: 3px solid var(--mv-primary); }
.small-box { border-radius: var(--mv-radius); box-shadow: var(--mv-shadow); }
.callout { border-radius: 10px; border: 0; border-left: 4px solid var(--mv-primary); box-shadow: var(--mv-shadow); }

/* ---- Tablas ---- */
.table { color: var(--mv-text); }
.table thead th {
  border-top: 0; border-bottom: 2px solid var(--mv-border) !important; background: #f8f9fc; color: var(--mv-muted);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; white-space: nowrap; vertical-align: middle;
}
.table td { border-top: 1px solid var(--mv-border); vertical-align: middle; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: var(--mv-border); }
.table-striped tbody tr:nth-of-type(odd) { background: #fafbfe; }
.table-hover tbody tr:hover, .table tbody tr:hover { background: #eef3fc; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--mv-border); border-radius: 8px; padding: 6px 10px; height: 36px; background: #fff; margin-left: 6px;
}
.dataTables_wrapper .dataTables_info { color: var(--mv-muted); font-size: .85rem; padding-top: 14px; }
.page-item .page-link { border-radius: 8px; margin: 0 2px; border: 1px solid var(--mv-border); color: var(--mv-primary); }
.page-item.active .page-link { background: var(--mv-primary); border-color: var(--mv-primary); color: #fff; }
.table .btn-sm, .table .btn-xs { border-radius: 7px; }
.table td .btn + .btn { margin-left: 4px; }
.table-responsive, .dataTables_wrapper { width: 100%; }
table.dataTable { border-collapse: collapse !important; }

/* ---- Formularios ---- */
label { font-weight: 600; font-size: .85rem; color: var(--mv-text); margin-bottom: 4px; }
.form-control, .custom-select {
  border: 1px solid #d5dbe8; border-radius: 9px; min-height: 40px; background: #fff; color: var(--mv-text);
  transition: border-color .15s, box-shadow .15s;
}
.form-control-sm { min-height: 34px; border-radius: 8px; }
.form-control:focus, .custom-select:focus { border-color: var(--mv-primary); box-shadow: 0 0 0 .2rem rgba(45, 83, 148, .15); }
.form-control[readonly]:not(.keep-ro) { background: #f6f8fc; }
textarea.form-control { min-height: 80px; }
.input-group-text { border-radius: 9px 0 0 9px; border: 1px solid #d5dbe8; }
.form-group { margin-bottom: 14px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--mv-primary); }
::placeholder { color: #9aa5b8 !important; }

/* ---- Botones ---- */
.btn { border-radius: 9px; font-weight: 600; letter-spacing: .01em; }
.btn-sm { padding: .32rem .75rem; }
.btn:focus { box-shadow: 0 0 0 .2rem rgba(45, 83, 148, .2); }

/* ---- Ventanas ---- */
.modal-content { border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(10, 20, 50, .35); }
.modal-header {
  background: linear-gradient(135deg, var(--mv-primary-dark), var(--mv-primary)) !important; color: #fff !important;
  border-bottom: 0; padding: 16px 22px;
}
.modal-header .modal-title { font-weight: 700; font-size: 1.1rem; color: #fff; }
.modal-header .close { color: #fff !important; opacity: .85; text-shadow: none; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--mv-border); background: #fafbfe; padding: 14px 22px; }
.modal-backdrop.show { opacity: .55; }

/* ---- Insignias y avisos ---- */
.badge { border-radius: 6px; font-weight: 600; padding: .35em .6em; }
.alert { border: 0; border-radius: 10px; }

/* ---- Menu lateral ---- */
.main-sidebar { box-shadow: 4px 0 24px rgba(20, 35, 70, .08) !important; }
.nav-sidebar .nav-link { border-radius: 9px; margin: 2px 6px; }
.nav-sidebar > .nav-item > .nav-link.active { background: linear-gradient(135deg, var(--mv-primary-dark), var(--mv-primary)) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(45, 83, 148, .35); }

/* ---- Celular y tablet ---- */
@media (max-width: 767.98px) {
  .content-header h1 { font-size: 1.3rem; }
  .card-body { padding: 12px; }
  .modal-body { padding: 16px; }
  .modal-dialog { margin: 10px; }
  .modal-footer { flex-wrap: wrap; gap: 8px; }
  .modal-footer .btn { flex: 1 1 auto; }
  .table thead th { white-space: normal; }
  .dataTables_wrapper .dataTables_filter { text-align: left !important; }
  .dataTables_wrapper .dataTables_filter input { margin-left: 0; width: 100%; }
  .btn-block-sm { display: block; width: 100%; }
}
