/* ============================================
   SHARED STYLES - QASO SYSTEM
   Estilos globales compartidos entre todas las páginas
   ============================================ */

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #E8F4F8;
  min-height: 100vh;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: #5DADE2;
  color: white;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-warning {
  background: #ffc107;
  color: #212529;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-info {
  background: #17a2b8;
  color: white;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06);
  margin-bottom: 25px;
  overflow: hidden;
  border: 1px solid #E5F2F7;
}

.card-header {
  padding: 20px;
  background: #F0F8FC;
  border-bottom: 1px solid #E5F2F7;
  font-weight: 600;
  color: #2E86AB;
}

.card-body {
  padding: 25px;
}

/* ============================================
   FORMS
   ============================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: 600;
  color: #2E86AB;
  font-size: 0.9rem;
}

input,
select,
textarea {
  padding: 12px;
  border: 2px solid #E5F2F7;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: white;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #5DADE2;
  box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.1);
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #E5F2F7;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #E5F2F7;
}

th {
  background: #F0F8FC;
  font-weight: 600;
  color: #2E86AB;
  font-size: 0.9rem;
}

tr:hover {
  background: #F8FBFD;
}

/* ============================================
   STATUS & TEXT COLORS
   ============================================ */
.status-normal {
  background: #d4edda;
  color: #155724;
}

.status-low {
  background: #fff3cd;
  color: #856404;
}

.status-zero {
  background: #f8d7da;
  color: #721c24;
}

.text-success {
  color: #28a745;
  font-weight: 600;
}

.text-danger {
  color: #dc3545;
  font-weight: 600;
}

.text-warning {
  color: #ffc107;
  font-weight: 600;
}

.text-info {
  color: #17a2b8;
  font-weight: 600;
}

/* ============================================
   MESSAGES
   ============================================ */
.message {
  padding: 12px 15px;
  border-radius: 8px;
  margin: 15px 0;
  font-weight: 500;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.message.warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ============================================
   UTILITIES
   ============================================ */
.loading {
  display: none;
  text-align: center;
  padding: 20px;
  color: #5DADE2;
  font-style: italic;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ============================================
   STATS GRID (Dashboard)
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06);
  border-left: 4px solid #5DADE2;
  border: 1px solid #E5F2F7;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2E86AB;
  margin-bottom: 5px;
}

.stat-label {
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ============================================
   AUTOCOMPLETE
   ============================================ */
.autocomplete-container {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #5DADE2;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.autocomplete-item {
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #E5F2F7;
  transition: background 0.2s ease;
}

.autocomplete-item:hover {
  background: #F0F8FC;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-code {
  font-weight: 600;
  color: #2E86AB;
}

.autocomplete-name {
  color: #6c757d;
  font-size: 0.85rem;
  margin-top: 2px;
}
