.hh-wrapper {
  max-width: 1100px;
  margin: 0 auto;
}

.hh-header-card,
.hh-main-card,
.hh-historial {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 24px;
}

.hh-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hh-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hh-logo-box {
  width: 120px;
  flex-shrink: 0;
}

.hh-logo-box img {
  width: 100%;
  height: auto;
  display: block;
}

.hh-header-card h2 {
  margin-bottom: 6px;
}

.hh-header-card p {
  color: var(--muted);
  font-size: 0.85rem;
}

.hh-badge {
  display: inline-block;
  margin-top: 8px;
  background: #f0fdf4;
  color: #166534;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 800;
}

.hh-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.hh-actions button,
.hh-table-actions button,
.hh-historial-controls button {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--accent);
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
}

.hh-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.hh-inputs-grid input,
.hh-generate-box input,
.hh-search input,
.hh-historial select {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #0b1220;
  color: var(--text);
}

.hh-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.hh-table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.hh-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 12px;
}

.hh-table td {
  background: #0b1220;
  padding: 12px;
  text-align: center;
}

.hh-table td:first-child {
  border-radius: 12px 0 0 12px;
  font-weight: 800;
  color: var(--accent);
}

.hh-table td:last-child {
  border-radius: 0 12px 12px 0;
}

.hh-table input {
  width: 100%;
  min-width: 90px;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  text-align: center;
  font-weight: 700;
}

.hh-table .hh-time-input {
  min-width: 112px;
}

.hh-time-input::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

.hh-error {
  color: #ef4444 !important;
  font-weight: 900;
}

.hh-table-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hh-generate-box {
  display: flex;
  gap: 10px;
  background: #0b1220;
  padding: 8px;
  border-radius: 14px;
}

.hh-generate-box input {
  width: 80px;
}

.hh-save-btn {
  background: var(--accent) !important;
}

.hh-total-banner {
  background: #020617;
  color: white;
  margin-top: 28px;
  padding: 24px;
  border-radius: 20px;
  text-align: center;
  border-bottom: 5px solid var(--accent);
}

.hh-total-banner small {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.hh-total-banner strong {
  font-size: 2rem;
  color: var(--accent);
}

.hh-historial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hh-historial-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hh-historial-controls h3 {
  cursor: pointer;
}

.hh-search {
  min-width: 240px;
}

.hh-historial-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.hh-export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hh-export-btn {
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 12px;
  padding: 11px 13px;
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.hh-export-btn--full {
  background: var(--accent);
  color: #0f172a;
  border-color: transparent;
}

.hh-export-btn:disabled {
  cursor: wait;
  opacity: 0.58;
}

.hh-registro-item {
  background: #0b1220;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  cursor: pointer;
}

.hh-registro-item:hover {
  outline: 1px solid var(--accent);
}

.hh-registro-item small {
  color: var(--muted);
}

.hh-delete-mini {
  border: none;
  background: #fee2e2;
  color: #ef4444;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

/* PDF */
.hh-pdf-mode {
  background: #ffffff !important;
  color: #1e293b !important;
  max-width: 1100px !important;
  width: 1100px !important;
  padding: 20px !important;
}

.hh-pdf-mode .hh-header-card,
.hh-pdf-mode .hh-main-card {
  background: #ffffff !important;
  color: #1e293b !important;
  box-shadow: none !important;
  border: 1px solid #e2e8f0 !important;
}

.hh-pdf-mode .hh-table td {
  background: #f8fafc !important;
  color: #1e293b !important;
}

.hh-pdf-mode input {
  color: #1e293b !important;
  background: #ffffff !important;
}

/* IMPRESIÓN */
@media print {
  body * {
    visibility: hidden;
  }

  #hhCaptureArea,
  #hhCaptureArea * {
    visibility: visible;
  }

  .export-ignore {
    display: none !important;
  }

  #hhCaptureArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white !important;
    color: #1e293b !important;
  }

  .hh-header-card,
  .hh-main-card {
    box-shadow: none !important;
    background: white !important;
    color: #1e293b !important;
  }

  .hh-historial {
    display: none !important;
  }
}

/* CELULAR */
@media(max-width: 768px) {
  .hh-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .hh-header-card,
  .hh-main-card,
  .hh-historial {
    padding: 16px;
    border-radius: 18px;
    margin-bottom: 14px;
  }

  .hh-header-card {
    flex-direction: column;
    align-items: center;
  }

  .hh-header-left {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    text-align: left;
  }

  .hh-logo-box {
    width: 90px;
    flex-shrink: 0;
  }

  .hh-header-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hh-header-left h2 {
    font-size: 1.35rem;
    margin-bottom: 4px;
    font-weight: 900;
  }

  .hh-header-left p {
    font-size: 0.78rem;
  }

  .hh-badge {
    font-size: 0.68rem;
    padding: 5px 10px;
    margin-top: 5px;
  }

  .hh-actions {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .hh-actions button {
    padding: 10px;
    font-size: 0.72rem;
  }

  .hh-inputs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-bottom: 12px;
  }

  .producto-box {
    grid-column: 1 / -1;
  }

  .form-box {
    margin: 0 !important;
    padding: 0 !important;
  }

  .form-box label {
    display: block;
    margin: 0 0 3px 0 !important;
    padding: 0 !important;
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .hh-inputs-grid input {
    height: 34px;
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .hh-table-responsive {
    overflow: hidden;
    border-radius: 16px;
    padding-bottom: 0;
  }

  .hh-table {
    display: table;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-spacing: 0 6px;
  }

  .hh-table thead {
    display: table-header-group;
  }

  .hh-table tbody {
    display: table-row-group;
  }

  .hh-table tbody tr {
    display: table-row;
  }

  .hh-table tbody td {
    display: table-cell;
    min-width: 0;
    padding: 7px 3px;
    font-size: 0.68rem;
    vertical-align: middle;
    text-align: center;
  }

  .hh-table th {
    padding: 7px 2px;
    font-size: 0.6rem;
  }

  .hh-table th:nth-child(1) { width: 6%; }
  .hh-table th:nth-child(2),
  .hh-table th:nth-child(3) { width: 21%; }
  .hh-table th:nth-child(4) { width: 12%; }
  .hh-table th:nth-child(5) { width: 16%; }
  .hh-table th:nth-child(6) { width: 15%; }
  .hh-table th:nth-child(7) { width: 9%; }

  .hh-table input,
  .hh-table .hh-time-input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 5px 2px;
    font-size: 0.68rem;
  }

  .hh-table .hh-delete-mini {
    width: 26px;
    height: 28px;
    padding: 0;
    font-size: 0.7rem;
  }

  .hh-table-actions {
    flex-direction: column;
    align-items: stretch;
    margin-top: 12px;
    gap: 10px;
  }

  .hh-generate-box {
    width: 100%;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 8px;
  }

  .hh-generate-box input {
    width: 100%;
  }

  .hh-generate-box button,
  .hh-save-btn {
    width: 100%;
    padding: 11px;
    font-size: 0.72rem;
  }

  .hh-total-banner {
    padding: 16px;
    margin-top: 16px;
  }

  .hh-total-banner strong {
    font-size: 1.8rem;
  }

  .hh-historial-header,
  .hh-historial-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .hh-historial-tools,
  .hh-export-actions {
    width: 100%;
    align-items: stretch;
  }

  .hh-export-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hh-export-btn {
    width: 100%;
    padding-inline: 8px;
    font-size: 0.7rem;
  }

  .hh-historial select,
  .hh-search,
  .hh-search input {
    width: 100%;
  }

  .hh-registro-item {
    flex-direction: row;
    align-items: flex-start;
    padding: 13px 14px;
    gap: 10px;
  }

  .hh-registro-item > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  .hh-registro-item .hh-delete-mini {
    flex: 0 0 auto;
    align-self: flex-start;
    margin: 0;
  }
}

/* CELULAR MUY PEQUEÑO */
@media(max-width: 480px) {
  .hh-header-card,
  .hh-main-card,
  .hh-historial {
    padding: 14px;
    border-radius: 16px;
    margin-bottom: 12px;
  }

  .hh-header-left {
    justify-content: center;
    align-items: center;
    gap: 12px;
    text-align: left;
  }

  .hh-logo-box {
    width: 78px;
  }

  .hh-header-left h2 {
    font-size: 1.18rem;
    margin-bottom: 3px;
    font-weight: 900;
  }

  .hh-header-left p {
    font-size: 0.7rem;
  }

  .hh-badge {
    font-size: 0.64rem;
    padding: 4px 9px;
    margin-top: 4px;
  }

  .hh-inputs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    margin-bottom: 10px;
  }

  .producto-box {
    grid-column: 1 / -1;
  }

  .form-box label {
    font-size: 0.64rem;
    margin-bottom: 2px !important;
  }

  .hh-inputs-grid input {
    height: 32px;
    padding: 5px 7px;
    font-size: 0.68rem;
  }

  .hh-table {
    min-width: 0;
  }

  .hh-table th,
  .hh-table td {
    padding: 6px 1px;
    font-size: 0.6rem;
  }

  .hh-table input,
  .hh-table .hh-time-input {
    min-width: 0;
    padding: 5px 1px;
    font-size: 0.62rem;
  }
}
