/* assets/styles/components.css */

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

.btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.btn.primary:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
}

.btn.wine {
  background: var(--wine);
  border-color: var(--wine);
  color: #ffffff !important;
}

.btn.wine:hover {
  background: #621927;
  border-color: #621927;
  color: #ffffff !important;
}

.btn.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #17243a;
}

.btn.gold:hover {
  background: var(--gold-hover);
}

.btn.small {
  padding: 5px 10px;
  font-size: 12px;
}

.btn.danger {
  background: var(--wine);
  border-color: var(--wine);
  color: #ffffff !important;
  font-weight: 600;
}

.btn.danger:hover {
  background: #621927;
  border-color: #621927;
  color: #ffffff !important;
}

/* Tarjetas y Paneles */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

@media (max-width: 1024px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
  margin-bottom: 20px;
}

.panel h3 {
  font-size: 16px;
  color: var(--navy);
  margin: 0 0 14px;
  font-weight: 700;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
}

.stat {
  padding: 18px 20px;
}

.stat .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stat strong {
  display: block;
  color: var(--navy);
  font-size: 28px;
  font-weight: 800;
  margin: 8px 0 2px;
}

.stat small {
  color: var(--muted);
  font-size: 11px;
}

.stat .icon {
  width: 36px;
  height: 36px;
  background: #eef3f9;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-size: 16px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

/* Tablas */
.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #fafbfc;
  font-weight: 700;
}

td,
th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tr:hover td {
  background: #fdfdfd;
}

tr:last-child td {
  border-bottom: 0;
}

/* Insignias y Pills */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: #eef1f6;
  color: #475467;
}

.pill.green {
  background: var(--green-bg);
  color: var(--green);
}

.pill.amber {
  background: var(--amber-bg);
  color: var(--amber);
}

.pill.red {
  background: var(--red-bg);
  color: var(--red);
}

.pill.blue {
  background: var(--blue-bg);
  color: var(--navy);
}

/* Barras de Progreso */
.progress {
  height: 7px;
  background: #edf0f4;
  border-radius: 10px;
  overflow: hidden;
  min-width: 90px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* Barras de herramientas e inputs */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 240px;
  background: #fff;
  font-size: 13px;
}

.search:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(16, 38, 75, 0.08);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: #475467;
}

.field input,
.field select,
.field textarea {
  border: 1px solid #d9dee7;
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  outline: none;
  color: var(--ink);
  width: 100%;
  font-size: 13px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(16, 38, 75, 0.08);
}

.field textarea {
  min-height: 85px;
  resize: vertical;
}

.formgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.formgrid .field {
  margin: 0;
}

.full {
  grid-column: 1 / -1;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 24, 48, 0.65);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal.show {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 18px;
  color: var(--navy);
  margin: 0;
  font-weight: 750;
}

.modal-head .x {
  border: 0;
  background: #f1f3f7;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--muted);
}

.modal-head .x:hover {
  background: #e2e8f0;
  color: var(--ink);
}

/* Checklist Evaluaciones */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkrow {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
  align-items: center;
  background: #fff;
  transition: border-color 0.15s ease;
}

.checkrow:hover {
  border-color: #cbd5e1;
}

.checkrow p {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 13.5px;
  color: #1e293b;
}

.checkrow small {
  color: var(--muted);
  font-size: 11px;
}

.checkrow select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #f8fafc;
  font-weight: 600;
}

.checkrow select.val-C {
  background: var(--green-bg);
  color: var(--green);
  border-color: #bbf7d0;
}

.checkrow select.val-NC {
  background: var(--red-bg);
  color: var(--red);
  border-color: #fecaca;
}

.checkrow select.val-P {
  background: var(--blue-bg);
  color: var(--navy);
  border-color: #bfdbfe;
}

.checkrow select.val-NA {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.tabs button {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  color: var(--muted);
  border-bottom: 2.5px solid transparent;
  font-size: 13px;
  font-weight: 600;
}

.tabs button:hover {
  color: var(--navy);
}

.tabs button.active {
  color: var(--navy);
  font-weight: 700;
  border-color: var(--gold);
}

/* Empty, notices, banners */
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.empty b {
  display: block;
  color: var(--navy);
  margin: 8px 0;
  font-size: 15px;
}

.notice {
  padding: 12px 16px;
  border-radius: 9px;
  background: #f5f1e9;
  border-left: 4px solid var(--gold);
  color: #66502c;
  font-size: 12.5px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.portal-banner {
  background: linear-gradient(135deg, var(--navy), #1d3c6d);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.portal-banner h2 {
  margin: 4px 0 6px;
  font-size: 22px;
}

.portal-banner p {
  color: #d9e2f0;
  margin: 0;
}

/* Toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  font-size: 13px;
  font-weight: 500;
  border-left: 4px solid var(--gold);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(12px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast.show {
  display: block;
}

.footer-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.5;
}

/* Subida de archivos */
.file-upload-zone {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-input-hidden {
  display: none;
}

.file-link {
  color: var(--navy-light);
  text-decoration: underline;
  font-size: 12px;
  font-weight: 600;
}


/* Pantalla de Login */
.login-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(16, 38, 75, 0.14);
  max-width: 440px;
  width: 100%;
  padding: 36px 32px;
  animation: modalIn 0.25s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-box {
  margin-bottom: 14px;
}

.login-logo {
  max-height: 58px;
  max-width: 220px;
  object-fit: contain;
}

.login-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--wine);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.login-header h2 {
  font-size: 20px;
  color: var(--navy);
  margin: 0 0 6px;
  font-weight: 800;
}

.login-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.login-form {
  margin-bottom: 20px;
}

.login-error {
  background: var(--red-bg);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 16px;
  border: 1px solid #fecaca;
  font-weight: 600;
}

.login-quick-hint {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 20px;
  text-align: center;
}

.login-quick-hint code {
  color: var(--navy);
  font-weight: 700;
  font-size: 12px;
}

.login-footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}