/* ============================================
   AULOX.APP — Estilos Globales (app.css)
   Compartido entre todos los paneles y vistas
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --brand-primary: #6C3AED;
  --brand-primary-light: #8B5CF6;
  --brand-primary-dark: #5B21B6;
  --brand-secondary: #06B6D4;
  --brand-accent: #F59E0B;
  --success: #22C55E;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;
  --gray-50: #FAFAFE;
  --gray-100: #F1F0FB;
  --gray-200: #E4E2F2;
  --gray-300: #C9C6DD;
  --gray-400: #9B97B3;
  --gray-500: #6E6A85;
  --gray-600: #4A4660;
  --gray-700: #312D47;
  --gray-800: #1E1A33;
  --gray-900: #0F0B21;
  --gradient-brand: linear-gradient(135deg, #6C3AED, #06B6D4);
  --gradient-hero: linear-gradient(135deg, #0F0B21 0%, #1E1A33 40%, #2D1B69 100%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(15,11,33,0.06);
  --shadow-md: 0 4px 20px rgba(15,11,33,0.08);
  --shadow-lg: 0 8px 40px rgba(15,11,33,0.12);
  --shadow-brand: 0 4px 24px rgba(108,58,237,0.3);
  --sidebar-width: 260px;
  --header-height: 64px;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: 'DM Sans', sans-serif; color: var(--gray-700); background: var(--gray-50); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5 { font-family: 'Outfit', sans-serif; line-height: 1.2; }
input, select, textarea { font-family: inherit; }

/* ---- TYPOGRAPHY ---- */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.15rem; }
.text-xl { font-size: 1.5rem; }
.text-2xl { font-size: 2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--gray-400); }
.text-primary { color: var(--brand-primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-gradient { background: var(--gradient-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: 50px; font-weight: 600; font-size: 0.9rem;
  transition: all 0.25s ease; border: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--brand-primary); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-primary-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-outline { background: transparent; color: var(--brand-primary); border: 2px solid var(--brand-primary); }
.btn-outline:hover { background: var(--brand-primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16A34A; }
.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-icon { padding: 10px; border-radius: 12px; }

/* ---- FORM ELEMENTS ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.85rem; font-weight: 600; color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200); background: #fff; font-size: 0.92rem;
  color: var(--gray-800); transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-primary-light);
  box-shadow: 0 0 0 3px rgba(108,58,237,0.1);
}
.form-input.error, .form-select.error, .form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.78rem; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- CARDS ---- */
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 24px; transition: box-shadow 0.3s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--gray-800); }
.card-body { }
.card-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-200); }

/* ---- STAT CARDS ---- */
.stat-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 24px; display: flex; align-items: flex-start; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 14px; display: flex;
  align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.purple { background: rgba(108,58,237,0.1); }
.stat-icon.cyan { background: rgba(6,182,212,0.1); }
.stat-icon.green { background: rgba(34,197,94,0.1); }
.stat-icon.amber { background: rgba(245,158,11,0.1); }
.stat-icon.red { background: rgba(239,68,68,0.1); }
.stat-label { font-size: 0.82rem; color: var(--gray-400); margin-bottom: 4px; }
.stat-value { font-family: 'Outfit', sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--gray-900); }
.stat-change { font-size: 0.78rem; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ---- TABLES ---- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--gray-200); }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table thead { background: var(--gray-50); }
.table th {
  padding: 12px 16px; text-align: left; font-weight: 600; color: var(--gray-500);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---- BADGES / STATUS ---- */
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 50px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge-success { background: rgba(34,197,94,0.1); color: #16A34A; }
.badge-warning { background: rgba(245,158,11,0.1); color: #D97706; }
.badge-danger { background: rgba(239,68,68,0.1); color: #DC2626; }
.badge-info { background: rgba(59,130,246,0.1); color: #2563EB; }
.badge-primary { background: rgba(108,58,237,0.1); color: var(--brand-primary); }
.badge-neutral { background: var(--gray-100); color: var(--gray-500); }

/* ---- ALERTS ---- */
.alert {
  padding: 14px 20px; border-radius: var(--radius-md); font-size: 0.9rem;
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
  animation: alertSlide 0.3s ease;
}
@keyframes alertSlide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.alert-success { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2); color: #15803D; }
.alert-error { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: #B91C1C; }
.alert-warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); color: #92400E; }
.alert-info { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); color: #1E40AF; }
.alert-icon { font-size: 1.2rem; flex-shrink: 0; }
.alert-close {
  margin-left: auto; background: none; border: none; font-size: 1.2rem; cursor: pointer;
  color: inherit; opacity: 0.5; padding: 0 4px;
}
.alert-close:hover { opacity: 1; }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,11,33,0.5); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 9000;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-xl); padding: 32px;
  max-width: 520px; width: 90%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(15,11,33,0.2); animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.15rem; font-weight: 700; color: var(--gray-900); }
.modal-close { background: var(--gray-100); border: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.1rem; color: var(--gray-500); }
.modal-close:hover { background: var(--gray-200); }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ---- PAGINATION ---- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 24px; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 8px; font-size: 0.85rem; font-weight: 500;
  color: var(--gray-600); border: 1px solid var(--gray-200); transition: all 0.2s;
}
.pagination a:hover { background: var(--gray-100); border-color: var(--brand-primary-light); color: var(--brand-primary); }
.pagination .active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 1.15rem; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; color: var(--gray-400); margin-bottom: 20px; }

/* ---- LOADING SPINNER ---- */
.spinner { width: 24px; height: 24px; border: 3px solid var(--gray-200); border-top-color: var(--brand-primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

/* ---- UTILITIES ---- */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.hidden { display: none !important; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  .modal { padding: 24px; }
}
