/* ============================================================
   NATURAL BIOVITAL — Estilos Globales
   Fuentes: Open Sans + Work Sans (Google Fonts CDN)
   Colores: Azul #2ea3f2 | Verde #27ae60 | Blanco #ffffff
   ============================================================ */

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

:root {
  --blue:       #2ea3f2;
  --blue-dark:  #1a7bc4;
  --blue-light: #e8f4fd;
  --green:      #27ae60;
  --green-light:#e8f7ef;
  --red:        #e74c3c;
  --red-light:  #fdecea;
  --orange:     #f39c12;
  --orange-light:#fef9e7;
  --gray-dark:  #2c3e50;
  --gray:       #546e7a;
  --gray-mid:   #90a4ae;
  --gray-light: #ecf0f1;
  --white:      #ffffff;
  --bg:         #f4f7f9;
  --border:     #dde3ea;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.12);
  --font:       'Open Sans', sans-serif;
  --font-alt:   'Work Sans', sans-serif;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--gray-dark); line-height: 1.6; min-height: 100vh; }

/* ── Tipografía ── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-alt); font-weight: 700; line-height: 1.3; color: var(--gray-dark); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
p  { margin-bottom: .75rem; }
a  { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: var(--radius); font-size: .9rem; font-weight: 600;
  border: none; cursor: pointer; transition: all .2s; font-family: var(--font); text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--blue);  color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(46,163,242,.35); }
.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover { background: #219a52; color: #fff; }
.btn-danger    { background: var(--red);   color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; }
.btn-outline   { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-gray      { background: var(--gray-light); color: var(--gray-dark); }
.btn-gray:hover{ background: var(--border); }
.btn-sm        { padding: 7px 14px; font-size: .8rem; }
.btn-lg        { padding: 14px 28px; font-size: 1rem; }
.btn-block     { width: 100%; display: flex; }
.btn:disabled  { opacity: .6; cursor: not-allowed; transform: none !important; }

/* ── Formularios ── */
.form-group    { margin-bottom: 1.1rem; }
.form-label    { display: block; font-size: .85rem; font-weight: 600; color: var(--gray); margin-bottom: 5px; }
.form-control  {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: .9rem; color: var(--gray-dark); background: #fff;
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,163,242,.15); }
.form-control::placeholder { color: var(--gray-mid); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2390a4ae' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint     { font-size: .78rem; color: var(--gray-mid); margin-top: 3px; }
.form-error    { font-size: .78rem; color: var(--red); margin-top: 3px; }

/* ── Tarjetas ── */
.card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3, .card-header h4 { margin: 0; }
.card-body   { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: #fafbfc; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 50px; font-size: .75rem; font-weight: 600; }
.badge-blue    { background: var(--blue-light);  color: var(--blue-dark); }
.badge-green   { background: var(--green-light); color: #1e7e44; }
.badge-red     { background: var(--red-light);   color: #c0392b; }
.badge-orange  { background: var(--orange-light);color: #d68910; }
.badge-gray    { background: var(--gray-light);  color: var(--gray); }

/* ── Alertas ── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--green-light); color: #1e7e44; border-left: 4px solid var(--green); }
.alert-danger  { background: var(--red-light);   color: #c0392b; border-left: 4px solid var(--red); }
.alert-warning { background: var(--orange-light);color: #d68910; border-left: 4px solid var(--orange); }
.alert-info    { background: var(--blue-light);  color: var(--blue-dark); border-left: 4px solid var(--blue); }

/* ── Tablas ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { background: #f8f9fa; color: var(--gray); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--gray-dark); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(2px); }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; animation: modalIn .2s ease; }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-body   { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.modal-close  { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--gray-mid); line-height: 1; }
.modal-close:hover { color: var(--red); }
@keyframes modalIn { from { transform: scale(.95) translateY(-10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

/* ── Utilidades ── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--gray-mid); }
.text-blue    { color: var(--blue); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-bold    { font-weight: 700; }
.text-sm      { font-size: .8rem; }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: .5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.p-0   { padding: 0; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.loading { opacity: .6; pointer-events: none; }

/* ── Spinner ── */
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner-blue { border-color: rgba(46,163,242,.3); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notifications ── */
#toast-container { position: fixed; bottom: 80px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--gray-dark); color: #fff; padding: 12px 18px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .875rem; max-width: 300px; animation: toastIn .3s ease; display: flex; align-items: center; gap: 10px; }
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }
.toast-info    { background: var(--blue); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Responsive ── */
@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .hide-mobile { display: none !important; }
  .card-body { padding: 14px; }
  .modal { max-width: 100%; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; }
}
