:root {
  --azul: #123f67;
  --azul-2: #0e3556;
  --fondo: #edf1f5;
  --blanco: #ffffff;
  --borde: #c9d3dd;
  --texto: #142433;
  --muted: #6f7e8d;
  --input-bg: #f9fbfd;
  --shadow: 0 8px 24px rgba(15, 40, 70, 0.08);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--fondo);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--texto);
  padding: 6px 8px 20px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  width: min(99vw, 1900px);
  margin: 0 auto 10px;
}

.btn-pdf {
  background: var(--azul);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-pdf:hover {
  background: var(--azul-2);
}

.sheet {
  width: min(99vw, 1900px);
  margin: 0 auto;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 20px 20px 22px;
}

.sheet-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.empresa-info {
  font-size: 12px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.2px;
}

.logo-box {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 48px;
}

.logo-box img {
  max-width: 155px;
  max-height: 54px;
  object-fit: contain;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.header-left {
  flex: 1 1 auto;
  min-width: 0;
}

.titulo-linea {
  width: 100%;
}

.subtitulo-linea {
  margin-top: 1px;
}

.titulo-input,
.periodo-input {
  border: none;
  background: transparent;
  outline: none;
  padding: 0;
  color: var(--azul);
  font-weight: 800;
}

.titulo-input {
  width: 100%;
  font-size: 22px;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.periodo-input {
  width: 180px;
  font-size: 18px;
  line-height: 1.1;
}

.header-extra {
  flex: 0 0 auto;
  font-size: 13px;
  color: #4a5e72;
  white-space: nowrap;
  text-align: right;
  padding-bottom: 2px;
}

.divider {
  height: 2px;
  background: var(--azul);
  margin: 12px 0 18px;
  opacity: 0.9;
}

.card {
  border: 1px solid var(--borde);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--blanco);
}

.card-title {
  background: var(--azul);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 14px;
  letter-spacing: 0.3px;
}

.form-grid {
  display: grid;
  gap: 12px 16px;
  padding: 16px;
}

.form-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #000;
}

.field input {
  width: 100%;
  height: 36px;
  border: 1px solid #bcc8d4;
  border-radius: var(--radius-md);
  background: var(--input-bg);
  padding: 0 12px;
  font-size: 13px;
  color: var(--texto);
  outline: none;
}

.field input:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(18, 63, 103, 0.10);
}

.field input::placeholder {
  color: #8d9aaa;
}

.tabla-card {
  margin-top: 18px;
}

.tabla-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
}

.tabla-equipos {
  width: 100%;
  min-width: 1450px;
  border-collapse: collapse;
  table-layout: auto;
}

.tabla-equipos th,
.tabla-equipos td {
  border: 1px solid #3b3b3b;
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.tabla-equipos th {
  background: #ffffff;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 4px;
  line-height: 1.2;
  white-space: normal;
}

.tabla-equipos td input {
  width: 100%;
  min-height: 30px;
  height: 30px;
  border: none;
  border-radius: 0;
  background: #fff;
  padding: 4px 4px;
  font-size: 12px;
  color: #000;
  outline: none;
  text-align: center;
  box-shadow: none;
}

.tabla-equipos td input:focus {
  background: #f4f8fc;
}

.celda-mini {
  min-width: 42px;
}

.celda-pequena {
  min-width: 62px;
}

.celda-mediana {
  min-width: 82px;
}

.celda-lugar {
  min-width: 150px;
}

.celda-fecha {
  min-width: 108px;
}

.tabla-acciones {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 16px;
  background: #fff;
}

.btn-agregar-fila {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--azul);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-agregar-fila:hover {
  background: var(--azul-2);
  transform: scale(1.05);
}

.btn-quitar-fila {
  background: #b42318;
}

.btn-quitar-fila:hover {
  background: #8f1c13;
}

@media print {
  body {
    background: #fff;
    padding: 0;
  }

  .topbar {
    display: none !important;
  }

  .sheet {
    width: 100%;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 16px;
  }
}

@media (max-width: 900px) {
  .sheet {
    width: 100%;
    padding: 16px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .header-top,
  .header-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-left {
    width: 100%;
  }

  .titulo-input {
    font-size: 19px;
  }

  .periodo-input {
    width: 100%;
    font-size: 17px;
  }

  .header-extra {
    white-space: normal;
    text-align: left;
    padding-bottom: 0;
  }

  .logo-box {
    justify-content: flex-start;
  }
}