/* ============================================================================
   Portal de clientes · padelinteractivo.com
   ----------------------------------------------------------------------------
   Mismos colores y tipografías que la web. Para cambiar la paleta, toca las
   variables de :root (son las mismas que en styles.css de la web).
   Índice: 1 tokens · 2 base · 3 cabeceras · 4 componentes · 5 páginas
   ============================================================================ */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  --bg:          #F6F7F4;
  --bg-2:        #ECEFE8;
  --paper:       #FFFFFF;
  --court:       #0B7A5A;
  --court-deep:  #06543E;
  --court-soft:  #E3F2EB;
  --sky:         #1E7BD6;
  --sky-soft:    #E4EFFB;
  --ball:        #D8F24B;
  --ball-deep:   #A9C420;
  --ink:         #0D1512;
  --ink-soft:    #37443F;
  --ink-mute:    #66736F;
  --line:        rgba(13, 21, 18, .13);
  --line-soft:   rgba(13, 21, 18, .08);
  --danger:      #B93A27;
  --danger-soft: #FBEAE6;
  --warn:        #8A5A12;
  --warn-soft:   #FCF1D9;

  --display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --sans:    "Inter", "Segoe UI", system-ui, sans-serif;

  --radius:    16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 21, 18, .04), 0 2px 8px rgba(13, 21, 18, .04);
  --shadow:    0 12px 32px -12px rgba(13, 21, 18, .18);
  --shadow-lg: 0 40px 80px -32px rgba(13, 21, 18, .35);
  --ease:      cubic-bezier(.16, 1, .3, 1);
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img, svg, video { display: block; max-width: 100%; }
a { color: var(--court); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; color: var(--ink); line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 1.25rem + 1.6vw, 2.5rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
code { font-size: .9em; background: var(--bg-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
small { font-size: 12px; font-weight: 400; color: var(--ink-mute); }
:focus-visible { outline: 3px solid var(--court); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--ball); color: var(--ink); }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 28px; } }
.main { padding: 28px 0 72px; }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--ink-mute); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }

/* 3. CABECERAS ------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line-soft); }
.topbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; text-decoration: none !important; }
.brand img { width: 34px; height: 34px; }
.brand-text span { color: var(--court); }
.brand-tag { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--court-soft); color: var(--court-deep); }
@media (max-width: 420px) { .brand-text { display: none; } }

.nav { order: 3; display: flex; gap: 4px; width: calc(100% + 8px); margin: 0 -4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--ink-soft); font-weight: 500; white-space: nowrap; text-decoration: none; transition: background .15s, color .15s; }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav .badge { margin-left: 2px; }
@media (max-width: 480px) {
  .nav a { gap: 6px; padding: 8px 9px; font-size: 14px; }
  .nav .icon { width: 16px; height: 16px; }
}
/* Móvil, portal del cliente: menú de 4 pestañas con icono, como en las apps */
@media (max-width: 560px) {
  .mode-client .nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; margin: 0; overflow: visible; }
  .mode-client .nav a { position: relative; flex-direction: column; justify-content: center; gap: 3px; padding: 7px 2px 6px; font-size: 12px; font-weight: 600; }
  .mode-client .nav a > .icon { width: 19px; height: 19px; }
  .mode-client .nav .badge { position: absolute; top: 3px; left: calc(50% + 5px); min-width: 17px; height: 17px; padding: 0 4px; margin: 0; font-size: 10px; }
  .mode-client .who-name span { display: none; }
}
@media (min-width: 960px) { .nav { order: 0; width: auto; margin: 0 0 0 12px; flex: 1; } }

.who { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.who-name { display: inline-flex; align-items: center; gap: 8px; max-width: 220px; color: var(--ink); font-weight: 500; text-decoration: none !important; }
.who-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name .icon { color: var(--ink-mute); }
.mode-client .who-name { padding: 6px 10px; border-radius: 10px; transition: background .15s; }
.mode-client .who-name:hover, .mode-client .who-name.is-current { background: var(--bg-2); }
@media (max-width: 560px) { .mode-client .who-name { max-width: 170px; } }

/* Admin: barra oscura para distinguir de un vistazo que estás en modo superadmin */
.mode-admin .topbar { background: rgba(13, 21, 18, .97); border-bottom-color: transparent; }
.mode-admin .brand, .mode-admin .who-name { color: #fff; }
.mode-admin .brand-text span { color: var(--ball); }
.mode-admin .brand-tag { background: var(--ball); color: var(--ink); }
.mode-admin .nav a { color: rgba(255, 255, 255, .72); }
.mode-admin .nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.mode-admin .nav a[aria-current="page"] { background: var(--ball); color: var(--ink); }
.mode-admin .nav a[aria-current="page"] .badge { background: var(--ink); color: var(--ball); }
.mode-admin .who-name .icon { color: rgba(255, 255, 255, .6); }
.mode-admin .btn-quiet { color: rgba(255, 255, 255, .8); }
.mode-admin .btn-quiet:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ball); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1; }

.viewas { background: var(--ball); color: var(--ink); font-size: 14px; }
.viewas-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
.viewas-in > span { display: inline-flex; align-items: center; gap: 8px; }

/* Encabezado con imagen (portal del cliente) */
.banner { position: relative; isolation: isolate; overflow: hidden; color: #fff; background: linear-gradient(125deg, var(--court-deep) 0%, var(--court) 55%, #12936D 100%); }
.banner:not(.has-img)::before {
  /* Pista de pádel dibujada en líneas finas cuando no hay imagen */
  content: ""; position: absolute; z-index: -1; top: 22px; bottom: 22px; right: -60px; width: min(560px, 60%);
  border: 2px solid rgba(255, 255, 255, .16); border-radius: 6px;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 255, 255, .16) calc(50% - 1px), rgba(255, 255, 255, .16) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(180deg, transparent calc(50% - 1px), rgba(255, 255, 255, .1) calc(50% - 1px), rgba(255, 255, 255, .1) calc(50% + 1px), transparent calc(50% + 1px));
}
.banner:not(.has-img)::after { content: ""; position: absolute; z-index: -1; width: 120px; height: 120px; right: 9%; top: -42px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ECFF86, var(--ball) 55%, var(--ball-deep)); opacity: .9; }
.banner-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.banner.has-img::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(13, 21, 18, .08) 0%, rgba(13, 21, 18, .32) 45%, rgba(13, 21, 18, .74) 100%); }
.banner-in { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; min-height: 170px; padding-top: 28px; padding-bottom: 28px; }
.banner-lg .banner-in { min-height: 250px; }
@media (min-width: 768px) { .banner-lg .banner-in { min-height: 320px; padding-bottom: 36px; } }
.banner-text { max-width: 720px; }
.banner h1 { color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .2); }
.banner .subtitle { margin-top: 8px; color: rgba(255, 255, 255, .9); font-size: 16px; max-width: 62ch; }
.banner .crumbs, .banner .crumbs a { color: rgba(255, 255, 255, .82); }
.banner .btn-ghost { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); color: #fff; }
.banner .btn-ghost:hover { background: rgba(255, 255, 255, .24); }
.pos-top { object-position: center top; }
.pos-center { object-position: center center; }
.pos-bottom { object-position: center bottom; }
.banner-full { background: var(--ink); }
.banner-full img { width: 100%; height: auto; max-height: 560px; object-fit: contain; margin: 0 auto; }

/* Cabecera sencilla (admin y modo "imagen entera") */
.pagehead { padding: 30px 0 4px; }
.pagehead-in { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pagehead .subtitle { margin-top: 6px; color: var(--ink-mute); font-size: 15px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; font-size: 13px; color: var(--ink-mute); }
.crumbs a { color: inherit; font-weight: 500; }

/* 4. COMPONENTES ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 600 14px/1.2 var(--sans); white-space: nowrap; cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--court); color: #fff; }
.btn-primary:hover { background: var(--court-deep); }
.btn-ball { background: var(--ball); color: var(--ink); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08); }
.btn-ball:hover { background: #CDE83C; }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-quiet { background: transparent; color: var(--ink-soft); }
.btn-quiet:hover { background: var(--bg-2); color: var(--ink); }
.btn-danger { background: var(--paper); border-color: rgba(185, 58, 39, .35); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { background: var(--danger-soft); color: var(--danger); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #22302B; }
.btn-onDark { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-onDark:hover { background: rgba(255, 255, 255, .2); }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }

.card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
@media (min-width: 768px) { .card { padding: 24px; } }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 1.05rem; }
.card-title .icon { color: var(--court); }
.danger-zone { border-color: rgba(185, 58, 39, .22); }
.danger-zone .card-title .icon { color: var(--danger); }
.danger-zone .card-title + p { margin-top: -6px; margin-bottom: 12px; }

.section { margin-top: 36px; }
.section-first { margin-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; margin-left: 4px; border-radius: 999px; background: var(--bg-2); color: var(--ink-soft); font: 600 12px/1 var(--sans); vertical-align: 3px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; }
.link-more .icon { width: 16px; height: 16px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-soft); font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; vertical-align: middle; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.chip-new { background: #F1FAC4; color: #4D5C05; }
.chip-progress { background: var(--sky-soft); color: #165EA5; }
.chip-ok { background: var(--court-soft); color: var(--court-deep); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-mute { background: var(--bg-2); color: var(--ink-mute); }
.chip-mute::before { display: none; }

.flashes { display: grid; gap: 8px; margin-bottom: 22px; }
.flash, .notice { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border: 1px solid; border-radius: 12px; font-size: 14px; }
.flash .icon, .notice > .icon { margin-top: 1px; }
.flash-ok { background: var(--court-soft); border-color: rgba(11, 122, 90, .22); color: var(--court-deep); }
.flash-err { background: var(--danger-soft); border-color: rgba(185, 58, 39, .25); color: #8A2A1B; }
.flash-info, .notice-info { background: var(--sky-soft); border-color: rgba(30, 123, 214, .22); color: #134F8C; }
.notice-warn { background: var(--warn-soft); border-color: rgba(138, 90, 18, .22); color: #6B4610; }
.notice { margin-bottom: 18px; }
.notice a, .flash a { color: inherit; text-decoration: underline; }
.notice-list { margin-top: 6px; padding-left: 18px; }
.flash[hidden] { display: none; }

.empty { display: grid; justify-items: center; gap: 12px; padding: 44px 20px; text-align: center; color: var(--ink-mute); background: rgba(255, 255, 255, .6); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .icon { width: 34px; height: 34px; color: var(--court); }
.empty p { max-width: 46ch; }

/* Formularios */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink); }
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline > span:first-child { white-space: nowrap; }
.field-grow { flex: 1; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s;
}
select { padding-right: 32px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2337443F' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--court); box-shadow: 0 0 0 3px rgba(11, 122, 90, .16); }
input[type="file"] { font-size: 14px; color: var(--ink-soft); max-width: 100%; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: 600 13px var(--sans); cursor: pointer; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--court); }
.row-2, .row-3 { display: grid; gap: 16px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } .row-3 { grid-template-columns: repeat(3, 1fr); } }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-actions-sub { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form-inline .field { flex: 1 1 200px; }
.fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 14px; }
.fieldset + .fieldset { padding-top: 16px; border-top: 1px solid var(--line-soft); }
.fieldset legend { padding: 0; margin-bottom: 12px; font-family: var(--display); font-weight: 600; color: var(--ink); }

details.edit { margin-top: 12px; }
details.edit > summary, .add-card > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-weight: 600; font-size: 13px; color: var(--court); border-radius: 6px; }
details.edit > summary::-webkit-details-marker, .add-card > summary::-webkit-details-marker { display: none; }
details.edit > summary .icon { width: 15px; height: 15px; }
details.edit[open] > summary { margin-bottom: 14px; }
details.edit[open] { padding-top: 12px; border-top: 1px solid var(--line-soft); }
.add-card { margin-top: 14px; padding: 16px 20px; }
.add-card > summary { font-size: 15px; }
.add-card[open] > summary { margin-bottom: 16px; }

/* Tablas: en el móvil cada fila se convierte en una tarjeta */
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 12px 16px; background: #FAFBF8; border-bottom: 1px solid var(--line); color: var(--ink-mute); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FBFCFA; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 4px; }
.table .cell-main { font-weight: 600; color: var(--ink); }
.table .cell-main a { color: var(--ink); }
.table .cell-sub { display: block; font-weight: 400; font-size: 13px; color: var(--ink-mute); }
.table tr.is-off td { opacity: .6; }
@media (max-width: 720px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody { display: block; }
  .table-stack tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack td { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 3px 0; border: 0; text-align: right; }
  .table-stack td::before { content: attr(data-label); flex: none; color: var(--ink-mute); font-size: 12px; text-align: left; }
  .table-stack td.cell-main { display: block; text-align: left; font-size: 15px; margin-bottom: 4px; }
  .table-stack td.cell-main::before, .table-stack td.actions::before { display: none; }
  .table-stack td.actions { justify-content: flex-start; margin-top: 8px; }
  .table-stack td.cell-wide { display: block; text-align: left; }
  .table-stack td.cell-wide::before { display: block; margin-bottom: 2px; }
}

/* Listas de elementos editables (accesos, facturas del admin) */
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { padding: 14px 16px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: var(--shadow-sm); }
.item.is-off { opacity: .7; }
.item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.item-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--court-soft); color: var(--court); }
.item-main { flex: 1 1 220px; min-width: 0; display: grid; }
.item-main strong { color: var(--ink); }
.item-main .muted { font-size: 13px; overflow-wrap: anywhere; }
.item-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.item-note { margin-top: 10px; }
.item.is-new { border-color: rgba(169, 196, 32, .55); box-shadow: inset 4px 0 0 var(--ball), var(--shadow-sm); }
.item-main strong .chip { margin-left: 6px; vertical-align: 1px; }
.section-tight { margin-top: 26px; }
.section-tight:first-child { margin-top: 0; }

.home-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .home-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .home-grid { grid-template-columns: 1fr 1fr 340px; } }
.home-grid > .card { min-width: 0; }
.home-grid .section-head { margin-bottom: 6px; }
.home-grid .mini-list li { flex-wrap: nowrap; }
.home-grid .mini-main strong { font-size: 14px; }

.missing-list { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.missing-list li { padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); }
.missing-list a { font-weight: 600; }
.amount { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.mini-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.mini-list li:last-child { border-bottom: 0; }
.mini-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--bg-2); color: var(--ink-soft); }
.mini-main { flex: 1 1 200px; min-width: 0; display: grid; }
.mini-main strong { color: var(--ink); overflow-wrap: anywhere; }
.mini-main .muted { font-size: 13px; }
.mini-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mini-where { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--court); }
.mini-thumb { position: relative; display: grid; place-items: center; width: 84px; aspect-ratio: 16 / 9; flex: none; overflow: hidden; border-radius: 8px; background: var(--ink); color: rgba(255, 255, 255, .65); }
.mini-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.subnav { display: flex; gap: 6px; margin: -6px 0 8px; overflow-x: auto; scrollbar-width: none; }
.subnav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--paper); color: var(--ink-soft); font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.subnav a:hover { border-color: var(--court); color: var(--court); }
.subnav .icon { width: 15px; height: 15px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.toolbar-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.toolbar.toolbar-form { justify-content: flex-start; }
.toolbar-form select { width: auto; min-width: 160px; }
.toolbar-note { display: inline-flex; align-items: center; gap: 8px; color: var(--warn); font-weight: 600; font-size: 14px; }

.data-list { display: grid; gap: 12px; }
.data-list div { display: grid; gap: 2px; }
.data-list dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-mute); }
.data-list dd { color: var(--ink); overflow-wrap: anywhere; }
.data-list + p { margin-top: 16px; }
@media (min-width: 720px) { .data-list-cols { grid-template-columns: 1fr 1fr; gap: 16px 24px; } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 8px; }
@media (min-width: 860px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: grid; gap: 2px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none !important; }
.stat-n { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-n small { font-size: 18px; color: var(--ink-mute); }
.stat-l { font-size: 13px; color: var(--ink-mute); }
.stat-link { transition: border-color .15s, transform .15s var(--ease); }
.stat-link:hover { border-color: rgba(11, 122, 90, .35); transform: translateY(-1px); }
.stat-accent { background: var(--ink); border-color: var(--ink); }
.stat-accent .stat-n { color: var(--ball); }
.stat-accent .stat-l { color: rgba(255, 255, 255, .7); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: paso; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-size: 14px; counter-increment: paso; }
.steps li::before { content: counter(paso); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ball); color: var(--ink); font-weight: 700; font-size: 13px; }
.tips { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; }
.help { background: linear-gradient(180deg, #fff, #F8FBF2); }
.help h2 { margin-bottom: 16px; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.checklist li { display: flex; align-items: center; gap: 8px; }
.checklist .is-ok .icon { color: var(--court); }
.checklist .is-bad { color: var(--danger); }

/* Vista previa de vídeos e imágenes */
.preview { width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 16px; background: #0B110F; color: #fff; box-shadow: var(--shadow-lg); overflow: hidden; }
.preview::backdrop { background: rgba(8, 12, 10, .78); backdrop-filter: blur(3px); }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; }
.preview-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.preview-tools { display: flex; gap: 6px; flex: none; }
.preview-body { display: grid; place-items: center; background: #000; min-height: 200px; }
.preview-body video, .preview-body img { width: 100%; max-height: calc(100vh - 120px); object-fit: contain; }
.preview-msg { padding: 48px 24px; text-align: center; color: rgba(255, 255, 255, .8); max-width: 44ch; }

/* 5. PÁGINAS --------------------------------------------------------------- */

/* Acceso */
.auth { min-height: 100vh; display: grid; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.15fr 1fr; } }
.auth-visual { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 220px; padding: 28px; overflow: hidden; color: #fff; background: linear-gradient(130deg, var(--court-deep), var(--court) 60%, #12936D); }
.auth-visual img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.auth-visual::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(13, 21, 18, .05), rgba(13, 21, 18, .7)); }
.auth-visual:not(.has-img)::before { content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; right: -40px; top: -40px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ECFF86, var(--ball) 55%, var(--ball-deep)); opacity: .9; }
@media (min-width: 900px) { .auth-visual { padding: 56px; } }
.auth-claim p { font-family: var(--display); font-size: clamp(24px, 2rem + 1vw, 44px); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; max-width: 16ch; }
.eyebrow { display: inline-block; margin-bottom: 12px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ball); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 22px; }
.auth-card h1 { font-size: 30px; margin-bottom: 6px; }
.auth-help { font-size: 13px; color: var(--ink-mute); }
.auth-simple { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-simple .card { width: 100%; max-width: 560px; display: grid; gap: 18px; }

/* Tiendas */
.grid-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card-link { color: inherit; text-decoration: none !important; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(11, 122, 90, .3); }
.store-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.store-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--court-soft); color: var(--court); }
.store-icon .icon { width: 22px; height: 22px; }
.store-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.store-text strong { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--ink); }
.store-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; font-size: 13px; color: var(--ink-mute); }
.card-arrow { color: var(--ink-mute); transition: transform .2s var(--ease), color .2s; }
.card-link:hover .card-arrow { color: var(--court); transform: translateX(3px); }
.split { display: grid; gap: 24px; }
@media (min-width: 980px) { .split { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }

/* Carpetas de los sensores */
.folders { display: grid; gap: 18px 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.folder { position: relative; display: block; padding-top: 13px; color: inherit; text-decoration: none !important; transition: transform .2s var(--ease); }
.folder:hover { transform: translateY(-3px); }
.folder-tab { position: absolute; top: 0; left: 0; width: 46%; height: 26px; border-radius: 12px 12px 0 0; background: #CFE8DC; transition: background .2s; }
.folder-body { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 158px; padding: 16px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 0 14px 14px 14px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; }
.folder:hover .folder-body { box-shadow: var(--shadow); border-color: rgba(11, 122, 90, .3); }
.folder:hover .folder-tab { background: #B9DFCD; }
.folder.has-new .folder-tab { background: var(--ball); }
.folder.has-fix .folder-tab { background: #F3D58B; }
.folder-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.folder-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--court-soft); color: var(--court); }
.folder-code { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-mute); background: var(--bg); padding: 2px 7px; border-radius: 6px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-name { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--ink); }
.folder-product { font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.folder-product.is-empty { color: var(--ink-mute); font-style: italic; }
.folder-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; font-size: 13px; color: var(--ink-mute); }
.folder-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--ink-mute); }
/* Carpeta general de la tienda y carpetas creadas por el admin: azul, para no confundirlas con los sensores */
.folder-general .folder-tab, .folder-custom .folder-tab { background: #CFE0F5; }
.folder-general:hover .folder-tab, .folder-custom:hover .folder-tab { background: #B8D2F0; }
.folder-general .folder-icon, .folder-custom .folder-icon { background: var(--sky-soft); color: var(--sky); }
.folder-general.has-new .folder-tab, .folder-custom.has-new .folder-tab { background: var(--ball); }

.admin-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .admin-grid { grid-template-columns: repeat(3, 1fr); align-items: start; } .admin-grid-wide { grid-template-columns: 2fr 1fr; } }
.stack { display: grid; gap: 16px; align-content: start; }

/* Carpeta de un sensor */
.layout-2 { display: grid; gap: 24px; }
@media (min-width: 1000px) { .layout-2 { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .layout-even { grid-template-columns: 1fr 1fr; } }
.col-main { min-width: 0; }
.col-side { display: grid; gap: 16px; }
@media (min-width: 1000px) { .col-side { position: sticky; top: 88px; } }

.uploader { padding: 14px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 34px 20px; text-align: center; border: 2px dashed rgba(11, 122, 90, .35); border-radius: 12px; background: linear-gradient(180deg, #FDFEFC, var(--court-soft)); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--court); background: var(--court-soft); }
.drop:focus-within { outline: 3px solid var(--court); outline-offset: 2px; }
.drop-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 4px; border-radius: 50%; background: var(--court); color: #fff; box-shadow: 0 10px 24px -10px rgba(11, 122, 90, .7); transition: transform .2s var(--ease); }
.drop:hover .drop-icon, .drop.is-over .drop-icon { transform: translateY(-3px); }
.drop-icon .icon { width: 24px; height: 24px; }
.drop strong { font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--ink); }
.drop u { text-decoration-color: var(--ball-deep); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.queue:not(:empty) { margin-top: 12px; }
.q-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg); }
.q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); }
.q-status { font-size: 13px; color: var(--ink-mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.q-bar span { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--court); transition: width .25s; }
.q-item.is-done .q-status { color: var(--court); font-weight: 600; }
.q-item.is-error { background: var(--danger-soft); border-color: rgba(185, 58, 39, .2); }
.q-item.is-error .q-status { color: var(--danger); font-weight: 600; white-space: normal; }
.q-item.is-error .q-bar span { background: var(--danger); }

.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.file { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px 14px; align-items: center; padding: 12px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: var(--shadow-sm); }
.file.is-fix { border-color: rgba(138, 90, 18, .3); }
.file-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--ink); color: rgba(255, 255, 255, .6); }
.file-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.file-thumb:hover img { transform: scale(1.05); }
/* Las imágenes (logos, carteles) se ven enteras; los vídeos llenan el recuadro */
.file-thumb.kind-image, .mini-thumb.kind-image { background: var(--bg-2); color: var(--ink-mute); }
.file-thumb.kind-image img, .mini-thumb.kind-image img { object-fit: contain; }
.file-thumb .icon { width: 26px; height: 26px; }
.file-thumb .play { position: absolute; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.file-thumb .play .icon { width: 14px; height: 14px; margin-left: 2px; }
.file-info { min-width: 0; display: grid; gap: 2px; }
.file-name { color: var(--ink); overflow-wrap: anywhere; }
.file-meta { font-size: 13px; color: var(--ink-mute); }
.file-note { display: flex; gap: 8px; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: #6B4610; font-size: 13px; }
.file-note .icon { width: 16px; height: 16px; margin-top: 1px; }
.file-status { grid-column: 2; }
.file-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.file-admin { grid-column: 1 / -1; margin-top: 0; }
@media (min-width: 760px) {
  .file { grid-template-columns: 136px minmax(0, 1fr) auto; }
  .file-status { grid-column: 3; grid-row: 1; justify-self: end; }
  .file-actions { grid-column: 2 / -1; }
}

.hdr-preview { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 1; min-height: 90px; margin-bottom: 18px; overflow: hidden; border-radius: 12px; background: linear-gradient(125deg, var(--court-deep), var(--court)); }
.hdr-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hdr-preview img.is-dim { opacity: .45; }
.hdr-preview.is-full { aspect-ratio: auto; background: var(--ink); }
.hdr-preview.is-full img { position: static; height: auto; object-fit: contain; }
.hdr-preview-label { position: relative; padding: 6px 12px; border-radius: 999px; background: rgba(13, 21, 18, .6); color: #fff; font-size: 13px; font-weight: 600; }

/* Panel del admin */
.groups { display: grid; gap: 14px; }
.group { padding: 6px 20px 8px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 10px; border-bottom: 1px solid var(--line-soft); }
.group-client { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); }
.group-head h3 a { color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 4px 20px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.timeline li { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
@media (min-width: 640px) { .timeline li { grid-template-columns: 120px 1fr; gap: 16px; } }
.tl-when { color: var(--ink-mute); font-size: 13px; white-space: nowrap; }
.tl-what { overflow-wrap: anywhere; }
.tl-what strong { color: var(--ink); }

.setup h1 { font-size: 26px; }

/* Pie */
.foot { padding: 22px 0 28px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-mute); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
