/* ========================================
   GLOBAL STYLES - Usados en todas las páginas
   ======================================== */

:root {
  /* Colores Corporativos */
  --primary: #FFD700;        /* Amarillo */
  --primary-dark: #FFA500;   /* Naranja oscuro */
  --primary-light: #FFED4E;  /* Amarillo claro */
  --secondary: #000000;      /* Negro */
  --secondary-light: #333333; /* Negro oscuro */
  --danger: #DC143C;         /* Rojo */
  --danger-dark: #8B0000;    /* Rojo oscuro */
  --success: var(--success);
  --warning: #f59e0b;
  --info: #0ea5e9;
  --light: #f8fafc;
  --dark: #1e293b;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.1);
  
  /* Fondos Corporativos */
  --bg-yellow: rgba(255, 215, 0, 0.08);  /* Amarillo muy claro */
  --bg-red: rgba(220, 20, 60, 0.05);    /* Rojo muy claro */
  --bg-white: #ffffff;                   /* Blanco puro */
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  --gradient-red: linear-gradient(135deg, #DC143C 0%, #8B0000 100%);
  --gradient-dark: linear-gradient(135deg, #000000 0%, #333333 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dark);
  background-color: #f8fafc;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ========================================
   NAVBAR
   ======================================== */

.navbar {
  background: #000000;
  color: white;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 70px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
  order: -1;
}

.navbar-logo img {
  height: 50px;
  width: auto;
  border-radius: 0.5rem;
}

.navbar-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary);
}

.logout-btn {
  background: #000000;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
}

.logout-btn:hover {
  background: var(--primary);
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.navbar-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.6rem 1rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.85rem;
}

.navbar-btn:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.2);
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
  width: 250px;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.08), rgba(255, 255, 255, 0.95));
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  padding: 2rem 0;
  position: fixed;
  left: 0;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
  z-index: 99;
  border-right: 3px solid var(--primary);
}

.sidebar-header {
  padding: 0 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 1rem;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--dark);
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1rem;
}

.sidebar-btn {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
}

.sidebar-btn:hover {
  background: rgba(255, 215, 0, 0.1);
  color: var(--danger);
  border-left-color: var(--danger);
  padding-left: 1.75rem;
}

.sidebar-btn.active {
  background: var(--gradient-primary);
  color: var(--secondary);
  border-left-color: var(--danger);
  font-weight: 600;
  padding-left: 1.75rem;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
  margin-left: 250px;
  margin-top: 70px;
  flex: 1;
  background-color: #f8fafc;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 70px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--dark);
  letter-spacing: -0.5px;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  color: var(--secondary);
  margin-bottom: 0.75rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Contenedor */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Botones */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  user-select: none;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--secondary);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
  background: var(--gradient-primary);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-danger {
  background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);
  color: #000000;
  box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
  font-weight: 700;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 165, 0, 0.5);
}

.btn-secondary {
  background-color: var(--light);
  color: var(--dark);
  border: 2px solid var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--border);
}

.btn-block {
  width: 100%;
  display: block;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Formularios */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 255, 255, 0.95));
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Tablas */
table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 215, 0, 0.08);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

thead {
  background: var(--gradient-primary);
  border-bottom: 3px solid var(--danger);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
}

tbody tr {
  background: var(--bg-white);
}

tbody tr:nth-child(even) {
  background: var(--bg-yellow);
}

tbody tr:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(220, 20, 60, 0.05)) !important;
  transition: all 0.3s ease;
}

/* Cards */
.card {
  background: var(--bg-yellow);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px var(--shadow);
  padding: 1.5rem;
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary);
}

.card.card-red {
  background: var(--bg-red);
  border-left-color: var(--danger);
}

.card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-pending {
  background: rgba(255, 215, 0, 0.2);
  color: var(--secondary);
  border: 1px solid var(--primary);
}

.badge-activo {
  background: rgba(16, 185, 129, 0.2);
  color: var(--secondary);
  border: 1px solid var(--success);
}

.badge-inactivo {
  background: rgba(220, 20, 60, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.badge-validated {
  background: rgba(16, 185, 129, 0.2);
  color: var(--secondary);
}

.badge-signed {
  background: var(--gradient-primary);
  color: var(--secondary);
}

/* Modales */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.95));
  color: #000000;
  padding: 2rem;
  border-radius: 0.75rem;
  border: 3px solid #FFD700;
  border-top: 6px solid #FFA500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close {
  float: right;
  font-size: 1.5rem;
  font-weight: bold;
  color: #000000;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close:hover {
  color: #333333;
  transform: scale(1.2);
}

/* Alertas */
.alert {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  border-left: 4px solid;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary);
  border-left-color: var(--success);
}

.alert-error {
  background: rgba(220, 20, 60, 0.1);
  color: var(--danger-dark);
  border-left-color: var(--danger);
}

.alert-info {
  background: rgba(255, 215, 0, 0.1);
  color: var(--secondary);
  border-left-color: var(--info);
}

/* Notificaciones */
.notification {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 215, 0, 0.08);
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  max-width: 400px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.success {
  border-left: 4px solid var(--success);
}

.notification.error {
  border-left: 4px solid var(--danger);
}

/* Utilidades */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--secondary);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }
  
  .modal-content {
    padding: 1.5rem;
  }

  /* Responsive sidebar */
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
  }

  .main-content {
    margin-left: 0;
    margin-top: 60px;
    padding: 1rem;
  }

  .sidebar-header {
    padding: 0 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.25rem;
    padding: 0 1rem;
  }

  .sidebar-btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    text-align: center;
  }
}

/* ========================================
   UTILITY CLASSES - Fondos corporativos
   ======================================== */

.bg-yellow {
  background: var(--bg-yellow) !important;
}

.bg-red {
  background: var(--bg-red) !important;
}

.bg-white {
  background: var(--bg-white) !important;
}

.bg-gradient-yellow {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 165, 0, 0.08)) !important;
}

.bg-gradient-red {
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.08), rgba(139, 0, 0, 0.05)) !important;
}
