:root {
  --f7l-bg: #0b1d33;
  --f7l-bg-soft: #0f2a4d;
  --f7l-text: #ffffff;
  --f7l-muted: #cfd7e3;
  --f7l-accent: #ff8c1a;
  --f7l-accent-strong: #ff7a00;
  --f7l-black: #111111;
  --f7l-border: #1e3a5f;
  --f7l-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  --f7l-radius: 14px;
  --f7l-radius-sm: 10px;
  --f7l-gap: 14px;
  --f7l-speed: .18s;
}

.f7l-list,
.f7l-jugadores,
.f7l-form {
  color: var(--f7l-text);
  background: linear-gradient(180deg, var(--f7l-bg) 0%, #071527 100%);
  border: 1px solid var(--f7l-border);
  border-radius: var(--f7l-radius);
  padding: 20px;
  margin: 18px 0;
  box-shadow: var(--f7l-shadow)
}

.f7l-list h3,
.f7l-jugadores h3 {
  color: var(--f7l-text);
  margin-top: 0;
  margin-bottom: 12px;
  letter-spacing: .3px;
  font-weight: 700
}

.muted {
  color: var(--f7l-muted)
}

.f7l-list ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--f7l-gap)
}

.f7l-list li {
  background: var(--f7l-bg-soft);
  border: 1px solid var(--f7l-border);
  border-radius: var(--f7l-radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform var(--f7l-speed), box-shadow var(--f7l-speed), border-color var(--f7l-speed)
}

.f7l-list li:hover {
  transform: translateY(-2px);
  border-color: var(--f7l-accent);
  box-shadow: 0 6px 18px rgba(255, 140, 26, .18)
}

.f7l-list .f7l-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 34px;
  outline: 2px solid rgba(255, 140, 26, .25)
}

.f7l-form p {
  margin: 10px 0
}

.f7l-form label {
  color: var(--f7l-text);
  font-weight: 600
}

.f7l-form input,
.f7l-form select,
.f7l-form textarea {
  width: 100%;
  max-width: 520px;
  background: #fff;
  color: var(--f7l-black);
  border: 2px solid #e7e9ee;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--f7l-speed), box-shadow var(--f7l-speed)
}

.f7l-form input::placeholder,
.f7l-form textarea::placeholder {
  color: #888
}

.f7l-form input:focus,
.f7l-form select:focus,
.f7l-form textarea:focus {
  border-color: var(--f7l-accent);
  box-shadow: 0 0 0 3px rgba(255, 140, 26, .25)
}

.f7l-form .button,
.f7l-jugadores .button,
.f7l-media-btn,
.f7l-btn-search,
.f7l-list .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--f7l-accent);
  color: var(--f7l-black);
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--f7l-speed), box-shadow var(--f7l-speed), background var(--f7l-speed);
  text-decoration: none
}

.f7l-form .button:hover,
.f7l-jugadores .button:hover,
.f7l-media-btn:hover,
.f7l-btn-search:hover,
.f7l-list .button:hover {
  transform: translateY(-1px);
  background: var(--f7l-accent-strong);
  box-shadow: 0 6px 16px rgba(255, 140, 26, .3)
}

.button-danger {
  background: #ff3b30 !important;
  color: #111 !important
}

.f7l-form .button-link-delete,
.f7l-media-clear {
  background: transparent !important;
  color: var(--f7l-text) !important;
  border: 1px dashed var(--f7l-border);
  padding: 8px 10px;
  border-radius: 10px
}

.f7l-form .button-link-delete:hover,
.f7l-media-clear:hover {
  border-color: var(--f7l-accent);
  color: var(--f7l-accent) !important
}

.f7l-ok {
  background: #e6ffed;
  color: #0b3d0b;
  border: 1px solid #b5f5c9;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 10px 0
}

.f7l-alert {
  background: #fff3cd;
  color: #5c3b00;
  border: 1px solid #ffe08a;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 10px 0
}

.f7l-jugadores .f7l-searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px
}

.f7l-jugadores .f7l-q,
.f7l-jugadores .f7l-fed,
.f7l-jugadores .f7l-div,
.f7l-jugadores .f7l-club {
  background: #fff;
  color: var(--f7l-black);
  border: 2px solid #e7e9ee;
  border-radius: 10px;
  padding: 10px 12px
}

.f7l-jugadores .f7l-q {
  min-width: 260px
}

.f7l-jugadores .f7l-fed {
  min-width: 180px
}

.f7l-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--f7l-bg-soft);
  border: 1px solid var(--f7l-border);
  border-radius: 12px;
  overflow: hidden
}

.f7l-table thead th {
  background: rgba(255, 140, 26, .15);
  color: var(--f7l-text);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--f7l-border)
}

.f7l-table td {
  color: var(--f7l-text);
  padding: 10px 12px;
  border-bottom: 1px solid var(--f7l-border)
}

.f7l-table tr:last-child td {
  border-bottom: none
}

.f7l-table tbody tr:hover {
  background: rgba(255, 140, 26, .06)
}

.f7l-table img,
.f7l-media-wrap img {
  display: block;
  margin: 6px 0;
  border-radius: 10px;
  outline: 2px solid rgba(255, 140, 26, .18)
}

@media (max-width: 640px) {

  .f7l-list,
  .f7l-jugadores,
  .f7l-form {
    padding: 16px;
  }

  .f7l-table thead {
    display: none;
  }

  .wp-list-table tr {
    display: block;
    border-bottom: 1px solid var(--f7l-border);
  }

  .wp-list-table td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
  }

  .wp-list-table td::before {
    content: attr(data-label);
    color: var(--f7l-muted);
    font-weight: 600;
  }
}

/* Grid hoja de cálculo */
.f7l-grid-wrap {
  overflow-x: auto;
}

.f7l-grid {
  border-collapse: collapse;
  width: 100%;
  min-width: 960px;
  background: #fff;
}

.f7l-grid th,
.f7l-grid td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  vertical-align: middle;
}

.f7l-grid thead th {
  background: #f3f4f6;
  color: #111;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.f7l-grid .cell {
  width: 100%;
  box-sizing: border-box;
}

.f7l-grid input.cell[type=text],
.f7l-grid select.cell {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}

.f7l-grid .cell-center {
  text-align: center;
}

.mobile-label {
  display: none;
}

.f7l-searchbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.f7l-searchbar .button-primary {
  font-weight: 600;
}

.f7l-btn-addrow {
  margin-left: 4px;
}

/* Mobile Grid Stack */
@media (max-width: 768px) {

  /* Searchbar Mobile */
  .f7l-searchbar {
    justify-content: center;
  }

  .f7l-searchbar input,
  .f7l-searchbar select {
    width: 90% !important;
    min-width: 0 !important;
    max-width: 90% !important;
    margin: 4px auto;
  }

  .f7l-searchbar .button {
    margin: 8px 4px;
    /* Spacing for buttons */
  }

  /* Container & Reset */
  .f7l-grid {
    min-width: 100%;
    display: block;
    background: transparent;
  }

  .f7l-grid thead {
    display: none;
  }

  .f7l-grid tbody {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }

  /* Card Style */
  .f7l-grid tr {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    position: relative;
  }

  /* Universal Cell Reset */
  .f7l-grid td {
    display: block;
    border: none;
    padding: 0;
  }

  /* --- Row 1: ID + Fed --- */
  .f7l-grid td:nth-child(1) {
    order: 1;
    flex: 1 1 60%;
  }

  /* ID */
  .f7l-grid td:nth-child(4) {
    order: 2;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  /* Fed */

  /* --- Row 2: Names --- */
  .f7l-grid td:nth-child(2) {
    order: 3;
    flex: 1 1 45%;
    min-width: 120px;
  }

  /* Nombre */
  .f7l-grid td:nth-child(3) {
    order: 4;
    flex: 1 1 45%;
    min-width: 120px;
  }

  /* Apellido */

  /* --- Row 3 & 4: Selectors --- */
  .f7l-grid td:nth-child(5) {
    order: 5;
    width: 100%;
  }

  /* Div */
  .f7l-grid td:nth-child(6) {
    order: 6;
    width: 100%;
  }

  /* Club */

  /* --- Row 5: Actions (Merged) --- */
  .f7l-grid td:nth-child(7) {
    /* Photo */
    order: 7;
    flex: 1;
    display: flex;
    align-items: center;
  }

  .f7l-grid td:last-child {
    /* Actions */
    order: 8;
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    margin-top: 0;
    border: none;
    padding-top: 0;
  }

  /* Internal Element Styling for Card */
  .f7l-grid input.cell[type=text],
  .f7l-grid select.cell {
    border: 1px solid #e0e0e0;
    padding: 10px;
    font-size: 15px;
    background: #f9f9f9;
  }

  .f7l-grid input.cell[type=text]:focus,
  .f7l-grid select.cell:focus {
    background: #fff;
    border-color: var(--f7l-accent);
  }

  /* Labels */
  .mobile-label {
    display: inline-block;
    margin-right: 6px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
  }

  /* UI Tweaks */
  .f7l-foto-ui {
    justify-content: flex-start;
  }

  .f7l-btn-icon {
    width: 42px;
    height: 42px;
  }

  .f7l-btn-icon svg {
    width: 22px;
    height: 22px;
  }
}

/* Highlight animation for new rows */
@keyframes f7l-flash {
  0% {
    background-color: rgba(255, 140, 26, 0.4);
  }

  100% {
    background-color: #ffffff;
  }
}

.f7l-row-highlight {
  animation: f7l-flash 1.5s ease-out forwards;
}

/* Icon Buttons */
.f7l-btn-icon {
  padding: 6px !important;
  width: 32px;
  height: 32px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
}

.f7l-btn-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.f7l-btn-danger {
  background: #ff3b30;
  color: #fff;
}

.f7l-btn-danger:hover {
  background: #c02b22;
}

.f7l-media-clear.f7l-btn-icon {
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
}

.f7l-media-clear.f7l-btn-icon:hover {
  border-color: #f00;
  color: #f00;
}