:root {
  --primary: #2563eb;
  --green: #16a34a;
  --orange: #ea580c;
  --gray-100: #f3f4f6;
  --gray-700: #374151;
  font-family: system-ui, sans-serif;
}
body { margin: 0; background: var(--gray-100); color: var(--gray-700); }
button { cursor: pointer; background: var(--primary); color: white; border: none; padding: .5rem 1rem; border-radius: .5rem; }
input, select { padding: .5rem; border: 1px solid var(--gray-700); border-radius: .375rem; }
.table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.table th, .table td { padding: .5rem; border-bottom: 1px solid var(--gray-700); text-align: left; }
.row-green { background: #dcfce7; }
.row-orange { background: #ffedd5; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; visibility: hidden; }
.modal[open] { visibility: visible; }
.modal-content { background: white; padding: 1rem; border-radius: .75rem; max-height: 80vh; overflow: auto; }
/* Oculta el modal per defecte */
simple-modal { display: none; }
.row-future { background: #ecfdf5; }   /* verd clar fosc */
.row-ongoing { background: #064e3b; color:white }  /* verd intens suau */
.row-past   { background: #fefce8; }   /* taronja pàl·lid */
button:disabled {
  opacity: 0.6;
  background: #e5e7eb !important;
  color: #888 !important;
  cursor: not-allowed !important;
  border-color: #d1d5db !important;
}
button.cancel {
  background: #868686;
  color: white;
}

.app-version-badge {
  position: fixed;
  left: .65rem;
  bottom: .5rem;
  z-index: 5000;
  color: #4b5563;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1;
  letter-spacing: .01em;
  opacity: .78;
  pointer-events: none;
  user-select: text;
}

.auth-main {
  display: grid;
  place-items: center;
  height: 100vh;
  padding: 1rem;
  box-sizing: border-box;
}

.auth-public-portal-link,
.auth-public-portal-link:visited {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 38px;
  padding: .42rem .72rem;
  border: 1px solid #cbd5e1;
  border-radius: .5rem;
  background: rgba(255, 255, 255, .88);
  color: #334155;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .08);
  font-size: .82rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.auth-public-portal-link:hover,
.auth-public-portal-link:focus-visible {
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .13);
  transform: translateY(-1px);
}

.auth-public-portal-link span:last-child {
  font-size: 1rem;
  line-height: .8;
}

.auth-frame {
  height: min(640px, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.auth-logo {
  height: 160px;
  width: auto;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.08));
  margin-bottom: .5em;
  cursor: pointer;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: white;
  padding: 2rem;
  padding-top: 1rem;
  border-radius: 1rem;
  min-width: 300px;
  box-sizing: border-box;
}

.auth-i18n-pending .auth-card {
  opacity: 0;
  pointer-events: none;
}

.auth-i18n-pending .auth-public-portal-link {
  opacity: 0;
}

.auth-card-wide {
  width: min(100vw - 2rem, 380px);
}

.auth-link-subtle,
.auth-link-subtle:visited {
  align-self: center;
  color: #64748b;
  font-size: .93rem;
  font-weight: 500;
  text-decoration: none;
  padding-top: 1rem;
}

.auth-link-subtle:hover {
  color: #334155;
  text-decoration: underline;
}

.auth-lang-select {
  align-self: center;
  margin-top: .75rem;
  font-size: .9rem;
  padding: .42rem .8rem;
}

.manager-assignment-field {
  gap: .45rem;
}

.subtle-checkbox {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .15rem;
  color: #64748b;
  font-size: .92rem;
  font-weight: 400;
  line-height: 1.25;
}

.subtle-checkbox input {
  width: .95rem;
  height: .95rem;
  min-width: .95rem;
}

button.saved-ok,
button.saved-ok:hover {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-color: #86efac !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .16) !important;
}


/* === Retro-Futurism App Theme Add-On === */
/* === Material 3/4 Inspired Subtle UI Theme Add-On === */

/* Import Roboto or Google Sans if you wish: */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

body {
  background: #f6f6f7;
  color: #222;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 1.07em;
  letter-spacing: 0.01em;
  min-height: 100vh;
}

/* App Containers */
header, main, section {
  background: #fff;
  border-radius: 1.2em;
  box-shadow: 0 2px 8px 0 #1a1a1a08, 0 0.5px 0.7px #d5d5d5;
}

/* Header */
header {
  border-bottom: 1.7px solid #ececec;
  margin-bottom: 1.5em;
  padding-top: .8em;
  padding-bottom: .8em;
  box-shadow: 0 3px 10px 0 #3b82f63a;
}

/* Headings */
h1, h2, h3 {
  font-family: 'Roboto', Arial, sans-serif;
  font-weight: 700;
  color: #2e384d;
  letter-spacing: .04em;
  margin-bottom: 0.25em;
}

/* Buttons */
button, input[type="button"], input[type="submit"] {
  font-family: inherit;
  background: linear-gradient(90deg, #e3e3fd 5%, #d0eaff 95%);
  color: #224268;
  border: none;
  border-radius: 2.2em;
  font-weight: 500;
  font-size: 1.06em;
  padding: 0.50em 1.5em;
  margin: 0.15em 0.2em;
  cursor: pointer;
  box-shadow: 0 2px 7px 0 #dbeafe4c;
  outline: none;
  transition: background 0.13s, color 0.09s, box-shadow 0.13s;
}
button:hover, input[type="button"]:hover, input[type="submit"]:hover {
  background: linear-gradient(90deg, #caf0f8 5%, #dee2fc 100%);
  color: #002447;
  box-shadow: 0 4px 12px 0 #a5c6ee5e, 0 0 0 1px #b6d0ff99;
}

/* Inputs, selects, textareas */
input, select, textarea {
  background: #f3f6fa;
  color: #283347;
  border: 1.6px solid #d2dae3;
  border-radius: 1em;
  padding: 0.54em 1em;
  font-size: 1em;
  margin-bottom: 0.18em;
  transition: border 0.11s, background 0.09s;
}
input:focus, select:focus, textarea:focus {
  border: 2.1px solid #7ab2fa;
  background: #fafdff;
  outline: none;
}

/* Tables */
.table, table {
  width: 100%;
  xbackground: #fff;
  border-collapse: separate;
  border-spacing: 0 0.38em;
  box-shadow: 0 2px 16px #e1e7f81c;
  font-size: 1.01em;
  margin-bottom: 1em;
}
.table th, table th {
  xbackground: #e8f1fd;
  color: #23284a;
  border: none;
  font-weight: 600;
  padding: 1em 0.7em;
  border-radius: 0.95em 0.95em 0 0;
  letter-spacing: .04em;
}
.table td, table td {
  xbackground: #fafaff;
  color: #223248;
  border: none;
  padding: 0.76em 1em;
  border-radius: 0.7em;
}
.row-future  { background: #9ff597 !important; color: #2563eb !important; }
.row-ongoing { background: #058612 !important; color: #1e5245 !important; }
.row-past    { background: #ffedaa !important; color: #746149 !important; }
.row-paid    { background: #20c95b !important; color: #18643d !important; }
.row-unpaid  { background: #ffd036 !important; color: #b66800 !important; }
*/

/* Links */
a, a:visited {
  color: #386adf;
  text-decoration: underline;
  transition: color 0.13s;
}
a:hover {
  color: #1846a5;
}

/* Modal content (simple-modal or dialogs) */
.simple-modal .modal-content, .modal-content, dialog {
  background: #f5f7fb;
  border-radius: 1.3em;
  border: 1.7px solid #d6e4fa;
  box-shadow: 0 6px 32px 0 #e8e9fe88;
  padding: 2.1em 2.2em 1.5em 2.2em;
  min-width: 320px;
  min-height: 130px;
  color: #253046;
  font-size: 1.06em;
}

/* Misc UX refinements */
::-webkit-scrollbar {
  width: 10px;
  background: #f0f6ff;
}
::-webkit-scrollbar-thumb {
  background: #e3eafe;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: #b1b7ce;
}

@media (max-width: 750px) {
  .modal-content { min-width: 95vw; }
  .table, table { font-size: 0.97em; }
  header, main, section { border-radius: 0.7em; }
}

input[type="checkbox"], input[type="radio"] {
  accent-color: #3b82f6;
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  padding: 0 !important;
  margin: 0;
  box-shadow: none;
  flex: 0 0 auto;
  transition: none;
  box-sizing: border-box;
}
input[type="checkbox"]:focus, input[type="radio"]:focus {
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
  border-width: 1px;
  background: initial;
}

/* Subtle transition for interactive states */
button, input:not([type="checkbox"]):not([type="radio"]), select, textarea, .table td, .table th {
  transition: background 0.13s, color 0.11s, box-shadow 0.13s, border 0.12s;
}


@keyframes spin-decelerate {
  0%   { transform: rotate(0deg); }
  100%  { transform: rotate(360deg); }   /* 4.5 turns very quickly */
  
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.logo-spin {
  opacity: 0;
  display: block;
  margin-left: auto;
  margin-right: auto;
  transform-origin: 50% 50%;
  animation: spin-decelerate 0.75s linear 1 forwards,
             fade-in 0.8s cubic-bezier(.5,0,.7,1) 0.1s forwards;
}

.auth-logo.logo-football-shot {
  position: relative;
  z-index: 20;
  pointer-events: none;
  animation: football-shot 1.35s cubic-bezier(.32,0,.96,.5) 1 both;
}

@keyframes football-shot {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: drop-shadow(0 3px 10px rgba(0,0,0,.08));
  }
  24% {
    opacity: 1;
    transform: translate3d(8vw, -1.4vh, 0) scale(1.8);
    filter: drop-shadow(-8px 12px 18px rgba(0,0,0,.18));
  }
  52% {
    opacity: 1;
    transform: translate3d(5.5vw, -.8vh, 0) scale(4);
    filter: drop-shadow(-20px 24px 34px rgba(0,0,0,.25));
  }
  82% {
    opacity: 1;
    transform: translate3d(-1.2vw, .6vh, 0) scale(8.3);
    filter: drop-shadow(-30px 30px 46px rgba(0,0,0,.28));
  }
  100% {
    opacity: 0;
    transform: translate3d(-1.8vw, 1vh, 0) scale(10.6);
    filter: drop-shadow(-30px 30px 46px rgba(0,0,0,.28));
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-logo.logo-football-shot {
    animation: fade-in .35s ease 1 both;
  }
}

/* Cohesive private app visual refresh. Public pages and projection/control screens do not opt in. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-out .28s ease both;
}

::view-transition-new(root) {
  animation: page-in .34s ease both;
}

@keyframes page-out {
  to {
    opacity: 0;
  }
}

@keyframes page-in {
  from {
    opacity: 0;
  }
}

html.app-private-root {
  min-height: 100%;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  background:
    linear-gradient(180deg, #e8f0fb 0%, #f5f8fc 48%, #eef4fb 100%);
}

body.app-private {
  --app-ink: #162033;
  --app-header: rgb(26, 77, 156);
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(26, 77, 156, .14), transparent 30rem),
    radial-gradient(circle at 88% 10%, rgba(59, 130, 246, .10), transparent 28rem),
    linear-gradient(180deg, #e8f0fb 0%, #f5f8fc 48%, #eef4fb 100%) !important;
  color: var(--app-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.app-private > header,
body.app-private header.app-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  min-height: 4rem !important;
  padding: .75rem 1rem !important;
  border-radius: 0 !important;
  background: var(--app-header) !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, .18) !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16) !important;
  backdrop-filter: blur(14px);
  color: #fff !important;
  margin-bottom: 0 !important;
}

body.app-private > header h1,
body.app-private header.app-header h1 {
  color: #fff !important;
  letter-spacing: 0;
  margin: 0 !important;
  line-height: 1.15 !important;
}

body.app-private > header > div,
body.app-private header.app-header > div {
  display: flex !important;
  align-items: center !important;
}

body.app-private > header > div:first-child > img[src$="img/logo-header.png"],
body.app-private header.app-header > div:first-child > img[src$="img/logo-header.png"] {
  width: 36px !important;
  height: 36px !important;
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
  object-fit: contain;
}

@media (max-width: 520px) {
  .auth-public-portal-link,
  .auth-public-portal-link:visited {
    top: .7rem;
    right: .7rem;
    min-height: 34px;
    padding: .36rem .58rem;
    font-size: .76rem;
  }
}

body.app-private > header > div:last-child,
body.app-private header.app-header > div:last-child {
  gap: .55rem !important;
  justify-content: flex-end !important;
}

body.app-private > header a,
body.app-private > header a:visited,
body.app-private header.app-header a,
body.app-private header.app-header a:visited {
  color: #fff !important;
}

body.app-private > header button:not(#debugDeleteAll),
body.app-private header.app-header button:not(#debugDeleteAll) {
  background: rgba(255, 255, 255, .12) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .26) !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 2.25rem !important;
  padding: .45rem .85rem !important;
  margin: 0 !important;
  border-radius: .55rem !important;
  font-size: .95rem !important;
  line-height: 1.1 !important;
  font-weight: 750 !important;
  white-space: nowrap !important;
}

body.app-private > header button:not(#debugDeleteAll):hover,
body.app-private header.app-header button:not(#debugDeleteAll):hover {
  background: rgba(255, 255, 255, .20) !important;
  color: #fff !important;
}

body.app-private #header-user {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .15rem .15rem .15rem .75rem;
  margin-left: .25rem;
  border-left: 1px solid rgba(255, 255, 255, .34);
  background: transparent;
  color: rgba(255, 255, 255, .86) !important;
  cursor: default;
  font-size: .92rem;
  font-weight: 650;
  user-select: text;
}

body.app-private > header + section {
  margin-top: 1rem !important;
}

body.app-private .app-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.45rem;
  padding: .45rem clamp(1rem, 3vw, 2rem);
  margin: 0 0 1rem;
  background: rgba(255, 255, 255, .62);
  border-bottom: 1px solid rgba(100, 116, 139, .16);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
  backdrop-filter: blur(10px);
  color: #64748b;
  font-size: .94rem;
  font-weight: 750;
  overflow-x: auto;
  white-space: nowrap;
}

body.app-private .app-breadcrumb-loading .app-breadcrumb-placeholder {
  visibility: hidden;
}

body.app-private .app-breadcrumb a,
body.app-private .app-breadcrumb .current {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  min-height: 1.75rem;
  color: #334155;
  text-decoration: none;
}

body.app-private .app-breadcrumb a:hover {
  color: #1d4ed8;
  text-decoration: none;
}

body.app-private .app-breadcrumb .current {
  color: #0f172a;
}

body.app-private .app-breadcrumb .separator {
  color: #94a3b8;
  font-weight: 900;
}

body.app-private .app-breadcrumb-home {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, .10);
  color: #1d4ed8;
  font-size: .95rem;
  line-height: 1;
}

body.app-private .detail-shell {
  width: min(calc(100% - 10px), 760px);
  margin: 0 auto 2rem;
  padding: 1.3rem;
  box-sizing: border-box;
}

body.app-private .detail-form {
  --detail-label-width: 11rem;
  display: grid;
  gap: 1rem;
  background: #fff;
  padding: 1rem;
  border-radius: 1rem;
}

.detail-tabs {
  display:flex;
  align-items:center;
  gap:.35rem;
  border-bottom:1px solid #cbd5e1;
}
.detail-tabs button {
  margin:0 0 -1px;
  padding:.55rem .85rem;
  border:1px solid transparent;
  border-bottom-color:#cbd5e1;
  border-radius:6px 6px 0 0;
  background:transparent;
  color:#475569;
  font-weight:700;
}
.detail-tabs button[aria-selected="true"] {
  border-color:#cbd5e1 #cbd5e1 #fff;
  background:#fff;
  color:#1a4d9c;
}
.detail-tab-panel[hidden] { display:none !important; }
.detail-alias-panel { min-width:0; }
.detail-alias-table-wrap { max-height:32rem; overflow:auto; border:1px solid #dbe3ef; border-radius:7px; background:#fff; }
.detail-alias-table { width:100%; border-collapse:collapse; }
.detail-alias-table th,.detail-alias-table td { padding:.55rem .65rem; border-bottom:1px solid #e5e7eb; text-align:left; }
.detail-alias-table th { position:sticky; top:0; z-index:1; background:#eef3fa; color:#334155; font-size:.82rem; }
.team-family-note { margin:.2rem 0 .8rem; color:#475569; font-size:.9rem; }
.team-family-note a { color:#1a4d9c; font-weight:700; }

body.app-private .detail-field,
body.app-private .detail-choice-field {
  display: grid;
  grid-template-columns: var(--detail-label-width) minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  margin: 0;
}

body.app-private .detail-field-label {
  color: #334155;
  font-weight: 700;
  line-height: 1.2;
}

body.app-private .detail-field input:not([type="checkbox"]):not([type="radio"]),
body.app-private .detail-field select,
body.app-private .detail-field textarea {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

body.app-private .detail-choice-field {
  align-items: start;
  border: 1px solid #dbe3ef;
  border-radius: .7rem;
  padding: .7rem .75rem;
}

body.app-private .detail-choice-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
}

body.app-private .detail-choice {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
}

@media (max-width: 620px) {
  body.app-private .detail-field,
  body.app-private .detail-choice-field {
    grid-template-columns: 1fr;
  }
}
