/* === Paleta + layout proměnné === */
:root{
  --bg:#F7F7F4; --surface:#FFFFFF; --text:#1F2937; --text-strong:#111111;
  --muted:#475569; --line:#f6f7fa;
  --brand:#E67817; --brand-600:#D1640C; --brand-100:#FFF1DE;
  --accent:#14833B; --accent-600:#0F6B2E; --accent-100:#E9F7EE;
  --amber:#080704; --amber-100:#FFF7D6; --amber-200:#FFE9A6;
  --danger:#D92D20; --danger-100:#FFE5E1; --line-200:#a0a2a9;

  --page-pad:18px;   /* vnitřní odsazení stránky */
  --filter-w:0px;    /* šířka pravého panelu (0 = žádný sloupec) */
  --gap:12px;        /* mezera mezi obsahem a filtrem */

  /* === Brand parametry (NOVÉ) === */
  --brand-logo: 40px;        /* velikost loga (šířka i výška) */
  --brand-font-size: 20px;   /* velikost textu vedle loga */
  --brand-font-weight: 900;  /* tloušťka písma brandu */

  --btn-font-size: 12px;     /* uprav dle chuti */
  --btn-font-weight: 800;    /* 700–900 = tučnější */

  color-scheme: light;
}

/* === Základ === */
html, body{ background:var(--bg) !important; color:var(--text) !important; }
*, *::before, *::after{ box-sizing:border-box; }

/* Trénink add/change: celá šířka + spodní tlačítka jako na návrhu */
body.app-core.model-trening.change-form{ width:100% !important; max-width:100% !important; min-width:0 !important; box-sizing:border-box !important; }
body.app-core.model-trening.change-form .submit-row .deletelink{ color:#b91c1c !important; }
body.app-core.model-trening.change-form .submit-row .deletelink:hover{ color:#dc2626 !important; }

/* Trénink – mobil: bubliny širší a vycentrované (struktura: .form-row → div → .flex-container → label + input) */
@media (max-width:768px){
  body.app-core.model-trening.change-form #content-main{ padding-left:16px !important; padding-right:16px !important; box-sizing:border-box !important; }
  body.app-core.model-trening.change-form .module.aligned{ padding-left:16px !important; padding-right:16px !important; box-sizing:border-box !important; }
  body.app-core.model-trening.change-form .module.aligned .form-row{
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    padding-left:16px !important;
    padding-right:16px !important;
    box-sizing:border-box !important;
  }
  body.app-core.model-trening.change-form .module.aligned .form-row > div,
  body.app-core.model-trening.change-form .module.aligned .form-row .flex-container{
    width:100% !important;
    max-width:320px !important;
    margin-left:auto !important;
    margin-right:auto !important;
    box-sizing:border-box !important;
  }
  body.app-core.model-trening.change-form .module.aligned .form-row input:not([type="submit"]):not([type="button"]),
  body.app-core.model-trening.change-form .module.aligned .form-row select,
  body.app-core.model-trening.change-form .module.aligned .form-row textarea{ width:100% !important; max-width:100% !important; box-sizing:border-box !important; display:block !important; }
  body.app-core.model-trening.change-form .module.aligned .form-row input:not([type="submit"]):not([type="button"]),
  body.app-core.model-trening.change-form .module.aligned .form-row select,
  body.app-core.model-trening.change-form .module.aligned .form-row textarea{ padding-left:12px !important; padding-right:12px !important; }
  body.app-core.model-trening.change-form .module.aligned .form-row select{ padding-right:14px !important; }
  body.app-core.model-trening.change-form .form-row.field-datum input{ padding-left:12px !important; padding-right:12px !important; }
}

/* === Full-width kontejnery === */
#container, .container, .content, .wrapper, .main, .inner,
#content, #content-main, .colM{
  max-width:none !important; width:100% !important; margin:0 !important; float:none !important;
}
#content{ padding-left:var(--page-pad) !important; padding-right:var(--page-pad) !important; }
div.breadcrumbs{ padding-left:var(--page-pad) !important; padding-right:var(--page-pad) !important; }

/* === CHANGELIST: obsah + případný filtr === */
body.change-list #content{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) var(--filter-w) !important;
  gap:var(--gap) !important;
  align-items:start !important;
}
#content > #content-main{ grid-column:1 !important; min-width:0 !important; }
#changelist, .change-list, #changelist-form, .module, .results, table{ width:100% !important; }
#content > #changelist-filter, #content > .filters{
  grid-column:2 !important;
  width:100% !important; max-width:var(--filter-w) !important;
  float:none !important; position:sticky !important; top:96px !important; align-self:start !important;
}
@media (max-width:1100px){
  body.change-list #content{ grid-template-columns:1fr !important; }
  #content > #changelist-filter, #content > .filters{ grid-column:1 !important; position:static !important; max-width:100% !important; }
}

/* odkazy v obsahu */
#content a, #content-main a, .module a, .results a, table a{
  color:var(--text-strong) !important; text-decoration:underline;
}
#content a:hover, #content-main a:hover, .module a:hover, .results a:hover, table a:hover{ text-decoration:none; }

/* kill dark-mode přepínače */
.theme-toggle, .dark-mode-toggle, [class*="theme-toggle"],
[aria-label*="Dark"], [aria-label*="Světl"], a[href*="theme="]{ display:none !important; }
@media (prefers-color-scheme: dark){
  :root, html, body, #header, #content{ background:var(--bg) !important; color:var(--text) !important; }
}

/* =================================================================== */
/* =========================== HLAVIČKA ============================== */
/* =================================================================== */

#header{
  position:relative;                          /* ukotvení pro utility odkazy */
  background:var(--surface) !important;
  border-bottom:3px solid var(--brand) !important;
  color:var(--text) !important;
  overflow:visible !important;
}


/* === Brand: velikost loga + text v jedné rovině (NOVÉ) === */
#branding .brand{
  display:flex;
  align-items:center;      /* zarovnání loga a textu */
  gap:10px;
  text-decoration:none;
}
#branding .brand .brand-logo{
  width:var(--brand-logo);
  height:var(--brand-logo);
  display:block;
  object-fit:contain;
}
#branding .brand .brand-title{
  font-size:var(--brand-font-size);
  font-weight:var(--brand-font-weight);
  line-height:1;
  letter-spacing:.2px;
  margin:0;
  color:var(--text);
}
@media (max-width:640px){
  :root{
    --brand-logo:28px;
    --brand-font-size:20px;
  }
}

/* TOP NAV: menu vlevo; prostor vpravo pro utility odkazy */
.ts-topnav, .topnav{
  position:relative;
  background:var(--surface) !important;
  display:flex; align-items:center; gap:2px;
  justify-content:flex-start !important;
  padding:0 var(--page-pad) !important;
  padding-right:calc(var(--page-pad) + 890px) !important; /* rezerva vpravo */
  overflow-x:auto !important; overflow-y:visible !important;
  flex-wrap:nowrap !important;      /* posun při nedostatku místa */
  scrollbar-width:thin;
}
.ts-topnav a, .topnav a{
  flex:0 0 auto;                       /* nepřetékají, drží šířku */
  white-space:nowrap;
  color:var(--text) !important;
  font-weight:900;
  padding:.75rem 1rem;
  border-radius:100px;
  border:1px solid transparent;
  position:relative;
  text-decoration:none !important;
  transition:background .15s ease, border-color .15s ease, box-shadow .15s ease;
  font-size:13px;                      /* jednotná velikost záložek */
}

.ts-topnav a:hover, .topnav a:hover{ background:var(--brand-100); border-color:var(--brand-100); }
.ts-topnav a.is-active, .topnav a.active{
  background:#E67817; border:1px solid var(--brand);
  box-shadow:inset 0 -3px 0 var(--brand);
  color:var(--text) !important;
}
.ts-topnav a:focus-visible, .topnav a:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }

/* === Utility odkazy (ZMĚNIT HESLO / ODHlÁSIT SE) vpravo v pruhu === */
#user-tools{
  position:absolute !important;
  right:calc(var(--page-pad) - 8px) !important; /* víc vpravo k okraji */
  top:0 !important;                       /* zarovnání na horní lištu */
  height:100%;
  display:flex !important;
  align-items:center; gap:2px;             /* menší mezera mezi odkazy */
  padding:0 !important; margin:0 !important;
  background:transparent !important; border:0 !important;
  font-size:0 !important;                  /* skryje případný text „VÍTEJTE…“ */
  z-index:5;
}

/* schovej „Zobrazení webu“ – je první odkaz v #user-tools */
#user-tools a:first-of-type{ display:none !important; }

#user-tools a,
#user-tools a.button,
#user-tools button,
#user-tools input[type=submit]{
  font-size:13px !important;          /* menší než záložky */
  color:var(--text) !important;          /* černé, dobře čitelné */
  font-weight:900;
  text-decoration:none !important;
  padding:.55rem .75rem;                 /* menší vnitřní okraje */
  border-radius:100px;
  border:1px solid transparent;          /* kvůli hover efektu jako u menu */
  background:transparent !important;     /* ať nevypadá jako tlačítko */
  white-space:nowrap;
}
/* HOVER: pouze tlačítka zčervenají (přepiš tvůj původní HOVER blok tímto) */
#user-tools button:hover,
#user-tools input[type=submit]:hover,
#user-tools a.button:hover{
background: red !important;
border-color: red !important;
/* případně i text:
color: white !important;
*/
}

/* FOCUS (klávesnice) – můžeš nechat jak máš */
#user-tools a:focus-visible,
#user-tools button:focus-visible,
#user-tools input[type=submit]:focus-visible{
  outline: 2px solid var(--brand) !important;
  outline-offset: 2px !important;
}

/* drobečky */
div.breadcrumbs{
  background:var(--surface) !important; border-bottom:1px solid var(--line) !important; color:var(--muted) !important;
}
div.breadcrumbs a{
  color:var(--text) !important; text-decoration:none !important;
  border-radius:6px; padding:2px 4px;
}
div.breadcrumbs a:hover{ background:var(--amber-100); }




/* =================================================================== */
/* ========================  OBSAH / BOXY  =========================== */
/* =================================================================== */

#nav-sidebar, .toggle-nav-sidebar, #content-related, .colMS{ display:none !important; }

#changelist-filter, .filters{
  background:var(--surface) !important; border:0px solid var(--line) !important; border-radius:10px !important; color:var(--text) !important;
}
#changelist-filter h2, #changelist-filter a, #changelist-filter li,
#changelist-filter .filter-title, #changelist-filter .filter{ color:var(--text) !important; }
#changelist-filter a:hover{ text-decoration:none; }

/* boxy (submit-row má vlastní styl níže – jako Trénink change_form) */
.module, .panel, .card{
  background:var(--surface) !important; border:10px solid var(--line) !important; border-radius:30px !important; box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.module caption, .grp-module h2, .module h2{
  background:var(--amber-100) !important; color:var(--text) !important; border-bottom:0px solid var(--line) !important;
}

/* payment box */
.payments-card {
  background:var(--surface) !important; border:10px solid var(--surface) !important; border-radius:0px !important;
}

/* horní pásy/akce */
#changelist, .change-list{ background:transparent !important; }
.change-list #toolbar, #changelist #toolbar, #toolbar, #changelist .actions{
  background:var(--surface) !important; color:var(--text) !important; border:0px solid var(--line) !important; border-radius:30px !important;
}

/* paginator */
.paginator{ background:transparent !important; border:0 !important; box-shadow:none !important; border-radius:0 !important; padding-left:0 !important; padding-right:0 !important; }

/* tabulky */
table{ background:var(--surface) !important; border-color:var(--line) !important; width:100% !important; table-layout:auto !important; }
th, td{ color:var(--text) !important; }
thead th{ background:var(--amber-100) !important; color:var(--text) !important; border-bottom:2px solid var(--amber) !important; }
#result_list tbody tr:nth-child(odd){ background:#FFFFFF !important; }
#result_list tbody tr:nth-child(even){ background:#fefefe !important; }
#result_list tbody tr.selected, tr.row-selected{ outline:2px solid var(--accent) !important; background:var(--accent-100) !important; }

/* platby tabulka */
table.payments thead th{ background:var(--amber-200) !important; border-bottom:0px solid var(--brand) !important; }
table.payments tbody tr:nth-child(even){ background:#FFF9EC !important; }

/* formuláře */
input, select, textarea{
  background:var(--surface) !important;
  border:1px solid var(--line-200) !important;  /* tvá standardní šedá */
  color:var(--text) !important;
  border-radius:8px !important;
}
/* === Jednotný oranžový focus border (jako u Změny hesla) – platí všude === */
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
button:focus,
button:focus-visible,
input[type=submit]:focus,
input[type=submit]:focus-visible,
.button:focus,
.button:focus-visible{
  outline: 2px solid var(--brand) !important;
  outline-offset: 2px !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(230,120,23,.15) !important;
}

/* Pole s dlouhým obsahem (readonly hash, salt, dlouhé texty) – posouvání do strany v celém adminu */
#content .aligned .readonly,
#content .aligned td.readonly,
#content .form-row.readonly{
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
}
#content .readonly p,
#content .readonly div:not([class]){
  min-width: min-content !important;
  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

/* --- NOVÉ: jemné oddělovače řádků a černé labely ve formulářích --- */
/* (platí pro všechny add/edit stránky; historie/ledgeru se to netýká) */
body.change-form .aligned table,
body.change-form .aligned tbody,
body.change-form .aligned tr,
body.change-form .aligned th,
body.change-form .aligned td{
  border: none !important;
  border-bottom: 1px solid #e5e7eb !important;  /* velmi jemná šedá linka */
  box-shadow: none !important;
  background: transparent !important;
}

/* některé inlines mají místo <tr> jen .form-row */
body.change-form .form-row{
  border: none !important;
  border-bottom: 1px solid #e5e7eb !important;
  box-shadow: none !important;
}

/* labely (Jméno, Email, Rodina…) černě a trochu výrazněji */
body.change-form .aligned th,
body.change-form label,
body.change-form .readonly label{
  color:#000 !important;
  font-weight:600;
}

/* příjemné odsazení buněk */
body.change-form .aligned th,
body.change-form .aligned td{
  padding:10px 12px !important;
}

/* ======================================================================== */
/* ZMĚNA HESLA – ŠÍŘKA BUBLIN (polí Současné heslo, Nové heslo, Potvrzení)  */
/* ======================================================================== */
/* Soubor: static/admin/custom.css                                         */
/*                                                                         */
/* Jak zúžit bubliny: změň hodnoty max-width níže (v px).                   */
/* Platí pro: .flex-container (řádky s inputy), úvodní odstavec, tlačítko. */
/* Bílé pole zůstává plné šířky; bubliny jsou užší a zarovnané vlevo.       */
/* ======================================================================== */
#content-main:has(form.password-change-form){
  box-sizing: border-box !important;
  padding: 28px !important;
}
#content form.password-change-form{
  max-width: 100% !important;
  box-sizing: border-box !important;
}
#content form.password-change-form > div{
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
#content form.password-change-form .module.aligned,
#content form.password-change-form .form-row,
#content form.password-change-form .flex-container{
  overflow: visible !important;
}
#content form.password-change-form .module.aligned{
  max-width: 100% !important;
  min-width: 0 !important;
  border-width: 1px !important;
  border-color: rgba(0,0,0,.08) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04) !important;
  padding: 24px !important;
}
#content form.password-change-form .form-row{
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
/* --- ŠÍŘKA BUBLIN: změň max-width (px). Vycentrované. --- */
#content form.password-change-form .flex-container{
  max-width: 340px !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
#content form.password-change-form > div > p{
  max-width: 340px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  text-align: center !important;
}
#content form.password-change-form .submit-row{
  max-width: 340px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  border-width: 0 !important;
  box-shadow: none !important;
}
#content form.password-change-form input[type="password"],
#content form.password-change-form input[type="text"]{
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
/* Aby oranžový focus ring (outline + box-shadow) nebyl vlevo oříznutý */
#content form.password-change-form .flex-container input{
  outline-offset: 2px !important;
}
@media (max-width: 768px){
  #content form.password-change-form .flex-container,
  #content form.password-change-form > div > p,
  #content form.password-change-form .submit-row{
    max-width: 300px !important;
  }
}
@media (max-width: 480px){
  #content form.password-change-form .flex-container,
  #content form.password-change-form > div > p,
  #content form.password-change-form .submit-row{
    max-width: 260px !important;
  }
}
@media (max-width: 420px){
  #content form.password-change-form .flex-container,
  #content form.password-change-form > div > p,
  #content form.password-change-form .submit-row{
    max-width: 220px !important;
  }
}
/* Bubliny (.help) – menší písmo, odsazení od okraje bílého pole */
#content form.password-change-form .help,
#content form.password-change-form .flex-container .help{
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 6px 16px 14px 0 !important;
  margin: 4px 0 0 0 !important;
  overflow: visible !important;
  font-size: 0.84em !important;
  line-height: 1.35 !important;
}
/* Seznam pravidel hesla uvnitř .help (Django tam vkládá <ul><li>…) */
#content form.password-change-form .help ul,
#content form.password-change-form .help ul li{
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100% !important;
  white-space: normal !important;
  margin-bottom: 4px !important;
  font-size: inherit !important;
  line-height: 1.35 !important;
}
#content form.password-change-form .help ul{
  padding: 4px 0 18px 1.2em !important;
  margin: 0 !important;
  list-style-position: outside !important;
}
/* Řádek s .help – odsazení od borderu bílého pole */
#content form.password-change-form .form-row:has(.help){
  padding-right: 18px !important;
  padding-bottom: 20px !important;
  margin-bottom: 8px !important;
}
@media (max-width: 768px){
  #content form.password-change-form .help,
  #content form.password-change-form .flex-container .help{
    font-size: 0.78em !important;
    line-height: 1.38 !important;
    padding: 6px 14px 12px 0 !important;
  }
  #content form.password-change-form .help ul{
    padding: 4px 0 16px 1.1em !important;
  }
  #content form.password-change-form .form-row:has(.help){
    padding-right: 14px !important;
    padding-bottom: 18px !important;
  }
}
@media (max-width: 480px){
  #content form.password-change-form .help,
  #content form.password-change-form .flex-container .help{
    font-size: 0.74em !important;
    line-height: 1.4 !important;
    padding: 6px 12px 10px 0 !important;
  }
  #content form.password-change-form .help ul{
    padding: 4px 0 14px 1em !important;
  }
  #content form.password-change-form .form-row:has(.help){
    padding-right: 12px !important;
    padding-bottom: 16px !important;
  }
}

/* === Změna hesla na mobilu: vertikální layout, bílé pole plné šířky, užší jen bubliny === */
@media (max-width: 640px){
  #content-main:has(form.password-change-form){
    overflow: visible !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 20px !important;
  }
  #content form.password-change-form .module.aligned{
    padding: 18px !important;
    overflow: visible !important;
  }
  #content form.password-change-form{
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }
  #content form.password-change-form .form-row,
  #content form.password-change-form .flex-container{
    overflow: visible !important;
  }
  /* Mobil (do 640px): bubliny užší – změň číslo pro jinou šířku */
  #content form.password-change-form .flex-container,
  #content form.password-change-form > div > p,
  #content form.password-change-form .submit-row{
    max-width: 260px !important;
  }
  #content form.password-change-form .form-row{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 16px !important;
  }
  #content form.password-change-form .flex-container{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 260px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 6px !important;
  }
  #content form.password-change-form .flex-container label{
    display: block !important;
    margin-bottom: 2px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #content form.password-change-form .flex-container .help{
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 0 !important;
  }
  #content form.password-change-form .flex-container input{
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  #content form.password-change-form .submit-row{
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 16px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  #content form.password-change-form .submit-row input{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  #content form.password-change-form > div > p{
    max-width: 260px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
}

/* ======================================================================== */
/* ÚPRAVA UŽIVATELE (/admin/auth/user/<id>/change/) – bílá pole zneviditelněna */
/* ======================================================================== */
body.app-auth.model-user.change-form #content,
body.app-auth.model-user.change-form #content-main{
  overflow: visible !important;
  box-sizing: border-box !important;
}
body.app-auth.model-user.change-form #content-main{
  padding: 28px !important;
}
body.app-auth.model-user.change-form #content{
  padding-left: var(--page-pad) !important;
  padding-right: var(--page-pad) !important;
}
/* Bílá pole (module, panel, card) – zrušení pozadí, borderu a stínu */
body.app-auth.model-user.change-form .module,
body.app-auth.model-user.change-form .panel,
body.app-auth.model-user.change-form .card{
  background: var(--bg) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}
/* Nadpisy sekcí (Heslo, Osobní údaje, Oprávnění…) – bez žlutého pole */
body.app-auth.model-user.change-form .module caption,
body.app-auth.model-user.change-form .module h2,
body.app-auth.model-user.change-form .panel h2,
body.app-auth.model-user.change-form .card h2{
  background: transparent !important;
  border: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
body.app-auth.model-user.change-form #content,
body.app-auth.model-user.change-form #content-main,
body.app-auth.model-user.change-form .module,
body.app-auth.model-user.change-form .form-row,
body.app-auth.model-user.change-form .aligned,
body.app-auth.model-user.change-form .aligned th,
body.app-auth.model-user.change-form .aligned td,
body.app-auth.model-user.change-form label,
body.app-auth.model-user.change-form p,
body.app-auth.model-user.change-form .help{
  text-align: left !important;
}
body.app-auth.model-user.change-form .submit-row{
  border-width: 0 !important;
  box-shadow: none !important;
  padding: 12px 0 !important;
}
body.app-auth.model-user.change-form .module,
body.app-auth.model-user.change-form .panel,
body.app-auth.model-user.change-form .card{
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
}
body.app-auth.model-user.change-form .aligned,
body.app-auth.model-user.change-form .aligned table,
body.app-auth.model-user.change-form .form-row{
  overflow: visible !important;
}
body.app-auth.model-user.change-form .aligned th,
body.app-auth.model-user.change-form .aligned td{
  max-width: 100% !important;
  min-width: 0 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}
/* Buňka s dlouhým readonly (heslo hash/salt) – posouvání jen uvnitř bílého pole */
body.app-auth.model-user.change-form .aligned .readonly,
body.app-auth.model-user.change-form .aligned td.readonly{
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
  min-width: 0 !important;
  font-size: 0.85em !important;
  line-height: 1.35 !important;
}
body.app-auth.model-user.change-form .aligned .readonly p,
body.app-auth.model-user.change-form .aligned .readonly div,
body.app-auth.model-user.change-form .aligned td.readonly p,
body.app-auth.model-user.change-form .aligned td.readonly div{
  min-width: min-content !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
body.app-auth.model-user.change-form .help,
body.app-auth.model-user.change-form p.help,
body.app-auth.model-user.change-form .helptext,
body.app-auth.model-user.change-form [class*="help"]{
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100% !important;
  font-size: 0.85em !important;
  line-height: 1.3 !important;
}
body.app-auth.model-user.change-form label{
  font-size: 0.9em !important;
}
body.app-auth.model-user.change-form .aligned input,
body.app-auth.model-user.change-form .aligned select,
body.app-auth.model-user.change-form .aligned textarea{
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  font-size: 0.95em !important;
}
body.app-auth.model-user.change-form .readonly,
body.app-auth.model-user.change-form .form-row.readonly{
  max-width: 100% !important;
}
/* U ostatního readonly textu (ne hash) zalamování */
body.app-auth.model-user.change-form .aligned th .readonly,
body.app-auth.model-user.change-form .readonly label{
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}
/* Mobil: veškerý padding je UVNITŘ bílých polí; obsah se musí vejít a nic nepřetékat */
/* Pro 390px a méně platí i selektor podle formuláře (form[action*="auth/user"]), aby to vždy sedělo */
@media (max-width: 768px){
  body.app-auth.model-user.change-form #content,
  body.app-auth.model-user.change-form #content-main,
  #content-main:has(form[action*="auth/user"]){
    padding-left: 12px !important;
    padding-right: 12px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  body.app-auth.model-user.change-form #content-main,
  #content-main:has(form[action*="auth/user"]){
    min-width: 0 !important;
  }
  /* Bílá pole – větší vertikální padding, aby se obsah vejít i svisle */
  body.app-auth.model-user.change-form .module,
  body.app-auth.model-user.change-form .panel,
  body.app-auth.model-user.change-form .card,
  #content-main:has(form[action*="auth/user"]) .module,
  #content-main:has(form[action*="auth/user"]) .panel,
  #content-main:has(form[action*="auth/user"]) .card{
    padding: 28px 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  body.app-auth.model-user.change-form .aligned tr,
  body.app-auth.model-user.change-form .form-row,
  #content-main:has(form[action*="auth/user"]) .aligned tr,
  #content-main:has(form[action*="auth/user"]) .form-row{
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    min-width: 0 !important;
  }
  #content-main:has(form[action*="auth/user"]) .form-row > div,
  body.app-auth.model-user.change-form .form-row > div{
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body.app-auth.model-user.change-form .aligned th,
  body.app-auth.model-user.change-form .aligned td,
  #content-main:has(form[action*="auth/user"]) .aligned th,
  #content-main:has(form[action*="auth/user"]) .aligned td{
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  /* Tabulka – fixed layout, sloupce omezené, aby hash nepřetékal */
  body.app-auth.model-user.change-form .module .aligned,
  body.app-auth.model-user.change-form .module table,
  body.app-auth.model-user.change-form .panel .aligned,
  body.app-auth.model-user.change-form .card .aligned,
  #content-main:has(form[action*="auth/user"]) .module .aligned,
  #content-main:has(form[action*="auth/user"]) .module table,
  #content-main:has(form[action*="auth/user"]) .aligned{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
  }
  body.app-auth.model-user.change-form .aligned th,
  body.app-auth.model-user.change-form .aligned td,
  #content-main:has(form[action*="auth/user"]) .aligned th,
  #content-main:has(form[action*="auth/user"]) .aligned td{
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 16px !important;
    overflow-x: hidden !important;
  }
  body.app-auth.model-user.change-form .aligned th,
  #content-main:has(form[action*="auth/user"]) .aligned th{
    padding-left: 0 !important;
  }
  body.app-auth.model-user.change-form .module h2,
  body.app-auth.model-user.change-form .panel h2,
  body.app-auth.model-user.change-form .card h2,
  #content-main:has(form[action*="auth/user"]) .module h2{
    margin-top: 0 !important;
    margin-bottom: 16px !important;
    padding-bottom: 8px !important;
  }
  /* Readonly (heslo, hash, salt) – zalamovat, nikdy nepřetékat */
  body.app-auth.model-user.change-form .module .readonly,
  body.app-auth.model-user.change-form .module td.readonly,
  body.app-auth.model-user.change-form .aligned .readonly,
  body.app-auth.model-user.change-form .aligned td.readonly,
  #content-main:has(form[action*="auth/user"]) .readonly,
  #content-main:has(form[action*="auth/user"]) td.readonly,
  #content-main:has(form[action*="auth/user"]) .module .readonly,
  #content-main:has(form[action*="auth/user"]) .aligned td.readonly{
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }
  body.app-auth.model-user.change-form .module .readonly p,
  body.app-auth.model-user.change-form .module .readonly div,
  body.app-auth.model-user.change-form .module td.readonly p,
  body.app-auth.model-user.change-form .module td.readonly div,
  body.app-auth.model-user.change-form .aligned .readonly p,
  body.app-auth.model-user.change-form .aligned .readonly div,
  body.app-auth.model-user.change-form .aligned td.readonly p,
  body.app-auth.model-user.change-form .aligned td.readonly div,
  #content-main:has(form[action*="auth/user"]) .readonly p,
  #content-main:has(form[action*="auth/user"]) .readonly div,
  #content-main:has(form[action*="auth/user"]) td.readonly p,
  #content-main:has(form[action*="auth/user"]) td.readonly div{
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body.app-auth.model-user.change-form .module .help,
  body.app-auth.model-user.change-form .module p.help,
  body.app-auth.model-user.change-form .aligned input,
  body.app-auth.model-user.change-form .aligned select,
  body.app-auth.model-user.change-form .aligned textarea,
  #content-main:has(form[action*="auth/user"]) .help,
  #content-main:has(form[action*="auth/user"]) .aligned input,
  #content-main:has(form[action*="auth/user"]) .aligned select,
  #content-main:has(form[action*="auth/user"]) .aligned textarea{
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Help text („Požadováno. 150 znaků…“) – zmenšený font, zalamování, box-sizing */
  #content-main:has(form[action*="auth/user"]) .help,
  #content-main:has(form[action*="auth/user"]) p.help,
  #content-main:has(form[action*="auth/user"]) .form-row .help,
  body.app-auth.model-user.change-form .help,
  body.app-auth.model-user.change-form p.help,
  body.app-auth.model-user.change-form .form-row .help{
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    font-size: 0.85rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Readonly (algoritmus, hash) – explicitní white-space pro zalamování */
  #content-main:has(form[action*="auth/user"]) .readonly p,
  #content-main:has(form[action*="auth/user"]) .readonly div,
  #content-main:has(form[action*="auth/user"]) td.readonly p,
  #content-main:has(form[action*="auth/user"]) td.readonly div,
  body.app-auth.model-user.change-form .aligned .readonly p,
  body.app-auth.model-user.change-form .aligned .readonly div,
  body.app-auth.model-user.change-form .aligned td.readonly p,
  body.app-auth.model-user.change-form .aligned td.readonly div{
    white-space: normal !important;
  }
  /* Tlačítka (Resetovat heslo) – vejít se do kontejneru, padding místo fixní šířky */
  #content-main:has(form[action*="auth/user"]) .module input[type="submit"],
  #content-main:has(form[action*="auth/user"]) .module button,
  #content-main:has(form[action*="auth/user"]) .module .button,
  body.app-auth.model-user.change-form .module input[type="submit"],
  body.app-auth.model-user.change-form .module button,
  body.app-auth.model-user.change-form .module .button{
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* 390px a méně – tvrdé omezení, nic nesmí jít mimo bílé pole zprava */
@media (max-width: 390px){
  #content:has(form[action*="auth/user"]),
  body.app-auth.model-user.change-form #content{
    padding-left: 10px !important;
    padding-right: 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  #content-main:has(form[action*="auth/user"]),
  body.app-auth.model-user.change-form #content-main{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  #content-main:has(form[action*="auth/user"]) .module,
  #content-main:has(form[action*="auth/user"]) .panel,
  #content-main:has(form[action*="auth/user"]) .card,
  body.app-auth.model-user.change-form .module,
  body.app-auth.model-user.change-form .panel,
  body.app-auth.model-user.change-form .card{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    padding: 24px 20px !important;
    box-sizing: border-box !important;
  }
  /* Tabulka – pevné podíly sloupců, aby data sloupec nepřetékal */
  #content-main:has(form[action*="auth/user"]) table,
  #content-main:has(form[action*="auth/user"]) .aligned,
  body.app-auth.model-user.change-form .module table,
  body.app-auth.model-user.change-form .aligned{
    table-layout: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #content-main:has(form[action*="auth/user"]) th,
  body.app-auth.model-user.change-form .aligned th{
    width: 38% !important;
    max-width: 38% !important;
    box-sizing: border-box !important;
  }
  #content-main:has(form[action*="auth/user"]) td,
  body.app-auth.model-user.change-form .aligned td{
    width: 62% !important;
    max-width: 62% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  /* Inputy a selecty – musí se vejít do buňky (přepíše Django forms.css) */
  #content-main:has(form[action*="auth/user"]) input,
  #content-main:has(form[action*="auth/user"]) select,
  #content-main:has(form[action*="auth/user"]) textarea,
  #content-main:has(form[action*="auth/user"]) .vTextField,
  body.app-auth.model-user.change-form .aligned input,
  body.app-auth.model-user.change-form .aligned select,
  body.app-auth.model-user.change-form .aligned textarea{
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  /* Help text – menší font, zalamování, white-space (podle analýzy) */
  #content-main:has(form[action*="auth/user"]) .help,
  #content-main:has(form[action*="auth/user"]) p.help,
  #content-main:has(form[action*="auth/user"]) .form-row p,
  #content-main:has(form[action*="auth/user"]) .form-row .help,
  body.app-auth.model-user.change-form .help,
  body.app-auth.model-user.change-form p.help,
  body.app-auth.model-user.change-form .form-row p,
  body.app-auth.model-user.change-form .form-row .help{
    max-width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    font-size: 0.8rem !important;
    box-sizing: border-box !important;
  }
  /* Readonly (algoritmus, hash) – white-space: normal + break-all */
  #content-main:has(form[action*="auth/user"]) .readonly p,
  #content-main:has(form[action*="auth/user"]) .readonly div,
  #content-main:has(form[action*="auth/user"]) td p,
  #content-main:has(form[action*="auth/user"]) td div,
  body.app-auth.model-user.change-form .aligned td.readonly p,
  body.app-auth.model-user.change-form .aligned td.readonly div,
  body.app-auth.model-user.change-form .aligned td p,
  body.app-auth.model-user.change-form .aligned td div{
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  /* Tlačítka (Resetovat heslo) – max-width 100%, aby nepřetékala */
  #content-main:has(form[action*="auth/user"]) input[type="submit"],
  #content-main:has(form[action*="auth/user"]) button,
  #content-main:has(form[action*="auth/user"]) .button,
  body.app-auth.model-user.change-form input[type="submit"],
  body.app-auth.model-user.change-form button,
  body.app-auth.model-user.change-form .button{
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* ======================================================================== */
/* HRÁČ (core/hrac) – změna – stejná kritéria jako uživatel (help, readonly, tlačítka, form-row) */
/* Odsazení: popisky a pole víc vlevo, bílé pole nižší (menší vertikální padding) */
/* ======================================================================== */
body.app-core.model-hrac.change-form #content,
body.app-core.model-hrac.change-form #content-main,
#content-main:has(form[action*="core/hrac/"]){
  box-sizing: border-box !important;
}
body.app-core.model-hrac.change-form .module,
body.app-core.model-hrac.change-form .panel,
body.app-core.model-hrac.change-form .card,
#content-main:has(form[action*="core/hrac/"]) .module,
#content-main:has(form[action*="core/hrac/"]) .panel,
#content-main:has(form[action*="core/hrac/"]) .card{
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 14px 24px 14px 16px !important;
}
body.app-core.model-hrac.change-form .module.aligned .form-row > label,
body.app-core.model-hrac.change-form .aligned th,
#content-main:has(form[action*="core/hrac/"]) .module.aligned .form-row > label,
#content-main:has(form[action*="core/hrac/"]) .aligned th{
  padding: 6px 12px 6px 0 !important;
  text-align: left !important;
}
body.app-core.model-hrac.change-form .aligned td,
body.app-core.model-hrac.change-form .module.aligned .form-row > div,
#content-main:has(form[action*="core/hrac/"]) .aligned td,
#content-main:has(form[action*="core/hrac/"]) .module.aligned .form-row > div{
  padding: 6px 0 6px 12px !important;
}
body.app-core.model-hrac.change-form .actions-row,
#content-main:has(form[action*="core/hrac/"]) .actions-row{
  padding-left: 0 !important;
  padding-right: 0 !important;
}
body.app-core.model-hrac.change-form .form-row,
#content-main:has(form[action*="core/hrac/"]) .form-row{
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.app-core.model-hrac.change-form .form-row > div,
#content-main:has(form[action*="core/hrac/"]) .form-row > div{
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.app-core.model-hrac.change-form .help,
body.app-core.model-hrac.change-form p.help,
body.app-core.model-hrac.change-form .helptext,
body.app-core.model-hrac.change-form [class*="help"],
#content-main:has(form[action*="core/hrac/"]) .help,
#content-main:has(form[action*="core/hrac/"]) p.help,
#content-main:has(form[action*="core/hrac/"]) .form-row .help{
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.app-core.model-hrac.change-form .readonly,
body.app-core.model-hrac.change-form .form-row.readonly,
#content-main:has(form[action*="core/hrac/"]) .readonly,
#content-main:has(form[action*="core/hrac/"]) .form-row.readonly{
  max-width: 100% !important;
  min-width: 0 !important;
}
body.app-core.model-hrac.change-form .aligned .readonly p,
body.app-core.model-hrac.change-form .aligned .readonly div,
body.app-core.model-hrac.change-form .aligned td.readonly p,
body.app-core.model-hrac.change-form .aligned td.readonly div,
#content-main:has(form[action*="core/hrac/"]) .readonly p,
#content-main:has(form[action*="core/hrac/"]) .readonly div,
#content-main:has(form[action*="core/hrac/"]) td.readonly p,
#content-main:has(form[action*="core/hrac/"]) td.readonly div{
  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}
body.app-core.model-hrac.change-form .module input[type="submit"],
body.app-core.model-hrac.change-form .module button,
body.app-core.model-hrac.change-form .module .button,
body.app-core.model-hrac.change-form .actions-row input,
body.app-core.model-hrac.change-form .actions-row button,
body.app-core.model-hrac.change-form .actions-row .button,
body.app-core.model-hrac.change-form .actions-row a.button,
#content-main:has(form[action*="core/hrac/"]) .module input[type="submit"],
#content-main:has(form[action*="core/hrac/"]) .module button,
#content-main:has(form[action*="core/hrac/"]) .module .button,
#content-main:has(form[action*="core/hrac/"]) .actions-row input,
#content-main:has(form[action*="core/hrac/"]) .actions-row button,
#content-main:has(form[action*="core/hrac/"]) .actions-row .button,
#content-main:has(form[action*="core/hrac/"]) .actions-row a.button{
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px){
  body.app-core.model-hrac.change-form #content,
  body.app-core.model-hrac.change-form #content-main,
  #content-main:has(form[action*="core/hrac/"]){
    padding-left: 12px !important;
    padding-right: 12px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  body.app-core.model-hrac.change-form .form-row,
  #content-main:has(form[action*="core/hrac/"]) .form-row{
    min-width: 0 !important;
  }
  body.app-core.model-hrac.change-form .form-row > div,
  #content-main:has(form[action*="core/hrac/"]) .form-row > div{
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body.app-core.model-hrac.change-form .help,
  body.app-core.model-hrac.change-form p.help,
  body.app-core.model-hrac.change-form .form-row .help,
  #content-main:has(form[action*="core/hrac/"]) .help,
  #content-main:has(form[action*="core/hrac/"]) p.help,
  #content-main:has(form[action*="core/hrac/"]) .form-row .help{
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    font-size: 0.85rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 390px){
  body.app-core.model-hrac.change-form #content,
  body.app-core.model-hrac.change-form #content-main,
  #content-main:has(form[action*="core/hrac/"]){
    padding-left: 10px !important;
    padding-right: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  body.app-core.model-hrac.change-form .help,
  body.app-core.model-hrac.change-form p.help,
  body.app-core.model-hrac.change-form .form-row .help,
  body.app-core.model-hrac.change-form .form-row p,
  #content-main:has(form[action*="core/hrac/"]) .help,
  #content-main:has(form[action*="core/hrac/"]) p.help,
  #content-main:has(form[action*="core/hrac/"]) .form-row .help,
  #content-main:has(form[action*="core/hrac/"]) .form-row p{
    max-width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    font-size: 0.8rem !important;
    box-sizing: border-box !important;
  }
  body.app-core.model-hrac.change-form .module input[type="submit"],
  body.app-core.model-hrac.change-form .module button,
  body.app-core.model-hrac.change-form .module .button,
  body.app-core.model-hrac.change-form .actions-row input,
  body.app-core.model-hrac.change-form .actions-row button,
  body.app-core.model-hrac.change-form .actions-row .button,
  body.app-core.model-hrac.change-form .actions-row a.button,
  #content-main:has(form[action*="core/hrac/"]) .module input[type="submit"],
  #content-main:has(form[action*="core/hrac/"]) .module button,
  #content-main:has(form[action*="core/hrac/"]) .module .button,
  #content-main:has(form[action*="core/hrac/"]) .actions-row input,
  #content-main:has(form[action*="core/hrac/"]) .actions-row button,
  #content-main:has(form[action*="core/hrac/"]) .actions-row .button,
  #content-main:has(form[action*="core/hrac/"]) .actions-row a.button{
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* ======================================================================== */
/* CORE – všechny formuláře (Vyúčtování, Platba, Výplata trenérovi, Ceník…)  */
/* Stejné odsazení bublin a zarovnání jako u hráče / změny hesla            */
/* ======================================================================== */
body.app-core.change-form .module,
body.app-core.change-form .panel,
body.app-core.change-form .card,
body.app-core.add-form .module,
body.app-core.add-form .panel,
body.app-core.add-form .card{
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 14px 24px 14px 16px !important;
}
body.app-core.change-form .module.aligned .form-row > label,
body.app-core.change-form .aligned th,
body.app-core.add-form .module.aligned .form-row > label,
body.app-core.add-form .aligned th{
  padding: 6px 12px 6px 0 !important;
  text-align: left !important;
}
body.app-core.change-form .aligned td,
body.app-core.change-form .module.aligned .form-row > div,
body.app-core.add-form .aligned td,
body.app-core.add-form .module.aligned .form-row > div{
  padding: 6px 0 6px 12px !important;
}
body.app-core.change-form .form-row,
body.app-core.add-form .form-row{
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.app-core.change-form .form-row > div,
body.app-core.add-form .form-row > div{
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.app-core.change-form .module input[type="submit"],
body.app-core.change-form .module button,
body.app-core.change-form .module .button,
body.app-core.add-form .module input[type="submit"],
body.app-core.add-form .module button,
body.app-core.add-form .module .button{
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Historie tréninků a plateb (hráč) – horizontální scroll tabulky, filtr uvnitř bloku */
.ledger-card{
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.ledger-title,
.ledger-card .ledger-title{
  border: none !important;
  box-shadow: none !important;
}
.ledger-wrap{
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-height: 480px !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.ledger-wrap table.ledger{ min-width: 600px !important; table-layout: auto !important; }
.ledger-filter{
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
  margin: 6px 0 10px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.ledger-filter label,
.ledger-filter input,
.ledger-filter .button,
.ledger-filter a.button{
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.ledger-filter{
  border: none !important;
  border-color: #fff !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.ledger-filter input[type="date"],
.ledger-filter input[type="text"]{
  border: 1px solid var(--line-200, #a0a2a9) !important;
  border-radius: 6px !important;
}

@media (max-width: 640px){
  body.app-auth.model-user.change-form .module,
  body.app-auth.model-user.change-form .panel,
  body.app-auth.model-user.change-form .card{
    padding: 24px 20px !important;  /* vertikálně 24, horizontálně 20 */
  }
  body.app-auth.model-user.change-form .aligned th,
  body.app-auth.model-user.change-form .aligned td{
    padding-right: 12px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }
  body.app-auth.model-user.change-form .aligned tr,
  body.app-auth.model-user.change-form .form-row{
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
  body.app-auth.model-user.change-form .module h2,
  body.app-auth.model-user.change-form .panel h2,
  body.app-auth.model-user.change-form .card h2{
    margin-bottom: 18px !important;
  }
  body.app-auth.model-user.change-form .help,
  body.app-auth.model-user.change-form p.help,
  body.app-auth.model-user.change-form .helptext{
    font-size: 0.85em !important;
  }
}
/* Velmi úzké viewporty (360px, 300px) – ještě víc vertikálního místa */
@media (max-width: 360px){
  body.app-auth.model-user.change-form .module,
  body.app-auth.model-user.change-form .panel,
  body.app-auth.model-user.change-form .card{
    padding: 26px 16px !important;
  }
  body.app-auth.model-user.change-form .aligned th,
  body.app-auth.model-user.change-form .aligned td{
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    padding-right: 12px !important;
  }
  body.app-auth.model-user.change-form .aligned tr,
  body.app-auth.model-user.change-form .form-row{
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  body.app-auth.model-user.change-form .module h2,
  body.app-auth.model-user.change-form .panel h2,
  body.app-auth.model-user.change-form .card h2{
    margin-bottom: 20px !important;
  }
}
@media (max-width: 300px){
  body.app-auth.model-user.change-form #content,
  body.app-auth.model-user.change-form #content-main{
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  body.app-auth.model-user.change-form .module,
  body.app-auth.model-user.change-form .panel,
  body.app-auth.model-user.change-form .card{
    padding: 24px 14px !important;
  }
  body.app-auth.model-user.change-form .aligned th,
  body.app-auth.model-user.change-form .aligned td{
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    padding-right: 10px !important;
  }
  body.app-auth.model-user.change-form .aligned tr,
  body.app-auth.model-user.change-form .form-row{
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }
  body.app-auth.model-user.change-form .module h2,
  body.app-auth.model-user.change-form .panel h2,
  body.app-auth.model-user.change-form .card h2{
    margin-bottom: 22px !important;
  }
  body.app-auth.model-user.change-form .help,
  body.app-auth.model-user.change-form p.help,
  body.app-auth.model-user.change-form .helptext{
    font-size: 0.82em !important;
  }
}

/* Filter horizontal (Skupiny, Oprávnění u uživatele) – instrukce a boxy nepřetékají */
#content .selector{ max-width: 100% !important; min-width: 0 !important; }
#content .selector .help,
#content .selector p{ word-wrap: break-word !important; overflow-wrap: break-word !important; max-width: 100% !important; }
#content .selector-available,
#content .selector-chosen{ max-width: 100% !important; min-width: 0 !important; }
#content .selector select{ max-width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
@media (max-width: 768px){
  #content .selector{ overflow: visible !important; display: block !important; }
  #content .selector-available,
  #content .selector-chosen{ float: none !important; width: 100% !important; max-width: 100% !important; margin-bottom: 12px !important; }
}


/* tlačítka (globálně) */
.button, input[type=submit], .submit-row input, a.button{
  background:var(--brand) !important; border:3px solid var(--brand-600) !important; color:#fff !important;
  border-radius:100px !important; padding:7px 12px !important; text-decoration:none !important;

  /* typografie přidaná */
  font-family: var(--btn-font-family) !important;
  font-size: var(--btn-font-size) !important;
  font-weight: var(--btn-font-weight) !important;
  line-height: 1 !important;
  letter-spacing: .2px;
}
.button:hover, input[type=submit]:hover, a.button:hover{ filter:brightness(1.05); }
a.button.secondary, .btn-secondary{ background:#FFFFFF !important; color:var(--text) !important; border:1px solid var(--line) !important; }
a.button.secondary:hover{ background:#F7F7F7 !important; }

/* ============================= */
/* ZAROVNÁNÍ HLEDAT + POSUN AKCÍ */
/* ============================= */

/* univerzální výška ovládacích prvků (možno změnit) */
:root{ --ctl-h: 28px; }

/* toolbar se search formulářem do jedné řádky/středu – nepřetéká z bubliny */
.change-list #toolbar, #changelist #toolbar{
  display:flex !important;
  align-items:center !important;
  gap:.5rem !important;
  flex-wrap:wrap !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow-x:hidden !important;
  box-sizing:border-box !important;
}

/* celý formulář changelistu nesmí přesáhnout šířku bubliny */
#changelist-form{
  max-width:100% !important;
  min-width:0 !important;
  overflow-x:hidden !important;
}

/* Operace: menší text + žádné ořezávání ve selectu */
.change-list .actions label {
  font-size: 14px !important;
}

.change-list .actions select{
  font-size: 14px !important;
  line-height: 1.2 !important;
  padding: 6px 12px !important;
  height: auto !important;
  min-height: var(--ctl-h) !important;
  max-width: 100% !important;
}


/* samotný search formulář */
#changelist-search{
  display:flex !important;
  align-items:center !important;
  gap:.5rem !important;
  margin:0 !important;
}
#changelist-search label{ margin:0 !important; }

/* input „Hledat“ – stejná výška jako tlačítko */
#changelist-search #searchbar,
#changelist-search input[type="text"]{
  padding:7px 12px !important;
  border-radius:100px !important;
  min-height:var(--ctl-h) !important;
  line-height:1 !important;
}

/* submit „Hledat“ – jistota stejné výšky */
#changelist-search input[type="submit"]{
  min-height:var(--ctl-h) !important;
}

/* blok Operace/Provést – stejná flexibilita jako search: celá šířka, nikdy oříznutí */
.change-list .actions{
  display:flex !important;
  align-items:center !important;
  gap:.5rem !important;
  flex-wrap:wrap !important;
  position:relative;
  top:-6px;                               /* zvednutí (doladíš podle oka) */
  margin:0 0 10px 0 !important;           /* mezera pod akcemi */
  flex:1 1 100% !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

/* select Operace – pružně vyplní prostor jako search input, nikdy nepřetéká */
.change-list .actions select{
  padding:7px 10px !important;
  border-radius:100px !important;
  min-height:var(--ctl-h) !important;
  line-height:1 !important;
  flex:1 1 auto !important;
  min-width:0 !important;
  max-width:100% !important;
  width:100% !important;
  box-sizing:border-box !important;
}
.change-list .actions .button,
.change-list .actions input[type=submit]{
  min-height:var(--ctl-h) !important;
  flex:0 0 auto !important;
}

/* Object tools (CENÍK: PŘIDAT, HRÁČ: PŘIDAT, …) – oranžová jako Hledat */
.object-tools, .object-tools li{ background:transparent !important; border:0 !important; box-shadow:none !important; }
.object-tools a, .object-tools li a, .addlink{
  background:var(--brand) !important;
  border:5px solid var(--brand-600) !important;
  color:#fff !important;
  border-radius:100px !important;
  padding:7px 12px !important;
  text-decoration:none !important;
  display:inline-flex; align-items:center; gap:.4rem;

  /* typografie přidaná */
  font-family: var(--btn-font-family) !important;
  font-size: var(--btn-font-size) !important;
  font-weight: var(--btn-font-weight) !important;
  line-height: 1 !important;
  letter-spacing: .2px;
}
.object-tools a:hover, .object-tools li a:hover{ filter:brightness(1.05); }
.object-tools a::before, .object-tools li a::before{ filter:invert(1) brightness(2); }

/* aby i „Odstranit“ měl stejnou typografii (pokud ho používáš) */
.submit-row a.deletelink{
  font-family: var(--btn-font-family) !important;
  font-size: var(--btn-font-size) !important;
  font-weight: var(--btn-font-weight) !important;
  line-height: 1 !important;
  letter-spacing: .2px;
}

/* messages – celé vidět, nezalomí se */
#content ul.messagelist,
#content-main ul.messagelist{
  max-width: 100% !important;
  overflow: visible !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}
ul.messagelist li{ border-radius:8px; max-width: 100%; word-wrap: break-word; overflow-wrap: break-word; }
ul.messagelist li.success{ background:var(--accent-100) !important; color:var(--accent-600) !important; border:1px solid var(--accent) !important; }
ul.messagelist li.error{ background:var(--danger-100) !important; color:var(--danger) !important; border:1px solid var(--danger) !important; }
ul.messagelist li.warning{ background:var(--amber-100) !important; color:#6B4E00 !important; border:1px solid var(--amber) !important; }

/* úklid */
.change-list .results, .results, .module table, .payments-card,
.grp-changelist-results, .grp-module, .grp-module .module,
#changelist-form, #changelist-form .results{ background:var(--surface) !important; color:var(--text) !important; }


/* historie/ledger boxy */
.history-wrapper, .history-card, .history-panel,
.ledger-wrapper, .ledger-card, .ledger-panel,
[class*="history"], [class*="ledger"]{
  background:var(--surface) !important; border:1px solid var(--line) !important;
  border-radius:12px !important; box-shadow:0 1px 2px rgba(0,0,0,.05) !important;
}
/* bez borderu kolem řádku Období a kolem obalu tabulky */
.ledger-filter,
.ledger-wrap,
.ledger-card .ledger-filter,
.ledger-card .ledger-wrap{
  border: none !important;
  box-shadow: none !important;
}
#content-main .module, #content-main .panel{ background:var(--surface) !important; }

/* === Řádek Uložit – všude stejný vzhled jako v Trénink change_form (bílá karta + oranžové kapsle) === */
.submit-row{
  display:flex !important;
  align-items:center !important;
  flex-wrap:wrap !important;
  gap:.5rem !important;
  background:#fff !important;
  border:1px solid #e5e7eb !important;
  border-radius:10px !important;
  box-shadow:0 1px 2px rgba(0,0,0,.04) !important;
  padding:16px !important;
  overflow:visible !important;
}
.submit-row input[type="submit"]:not([value*="Odstranit"]),
.submit-row button[type="submit"]:not([name="_continue"]),
.submit-row a.button{
  background:var(--brand) !important;
  border:2px solid #c96510 !important;
  color:#fff !important;
  font-weight:700 !important;
  border-radius:999px !important;
  padding:10px 20px !important;
  font-family:var(--btn-font-family) !important;
  font-size:var(--btn-font-size) !important;
  line-height:1 !important;
  cursor:pointer !important;
}
.submit-row input[type="submit"]:not([value*="Odstranit"]):hover,
.submit-row button[type="submit"]:not([name="_continue"]):hover,
.submit-row a.button:hover{
  filter:brightness(1.05) !important;
}
.submit-row .deletelink-box{ margin-left:auto; order:2; }

.submit-row a.deletelink{
  float:none !important;
  margin-left:auto;
  display:inline-flex !important;
  align-items:center;
  gap:.4rem;
  padding:10px 12px !important;
  border-radius:100px !important;
  background:var(--danger) !important;
  border:5px solid var(--danger) !important;
  color:#fff !important;
  text-decoration:none !important;
}
.submit-row a.deletelink:hover{ filter:brightness(1.05); }

/* === Jednotný searchbar na všech changelist stránkách (jako v Platbách) === */
:root{ --searchbar-w: 280px; }  /* šířka pole; když chceš, změň číslo */

#changelist-search{
  display:flex !important;
  align-items:center !important;
  gap:.5rem !important;
  flex-wrap:wrap !important;
  margin:0 !important;
}
#changelist-search label{ margin:0 !important; }

#changelist-search #searchbar,
#changelist-search input[type="text"]{
  flex:0 0 var(--searchbar-w) !important;
  width:var(--searchbar-w) !important;
  max-width:var(--searchbar-w) !important;
  min-height:var(--ctl-h) !important;   /* stejné jako ostatní prvky */
  height:auto !important;
  padding:7px 12px !important;
  border-radius:100px !important;
}

#changelist-search input[type="submit"]{
  min-height:var(--ctl-h) !important;
}

@media (max-width:700px){
  #changelist-search #searchbar,
  #changelist-search input[type="text"]{
    flex:1 1 100% !important;
    width:100% !important;
    max-width:100% !important;
  }
  /* Operace: stejná flexibilita jako search – vždy celá šířka, nic se neořízne */
  .change-list .actions{
    flex:1 1 100% !important;
    width:100% !important;
    max-width:100% !important;
  }
  .change-list .actions select{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }
}




/* === Trenéři – souhrn ==================================== */

/* šířky sloupců (trochu víc místa) */
.tbl-treneri col.col-trener     { width: 26%; }
.tbl-treneri col.col-pocet      { width: 12%; }
.tbl-treneri col.col-hodiny     { width: 12%; }
.tbl-treneri col.col-dluzno     { width: 14%; }
.tbl-treneri col.col-zaplaceno  { width: 14%; }
.tbl-treneri col.col-kvyplaceni { width: 14%; }
.tbl-treneri col.col-akce       { width: 8%;  }

/* čísla na střed jen v této tabulce */
.tbl-treneri th.center,
.tbl-treneri td.center { text-align: center; }

/* první sloupec bez přehnaného odsazení, zarovnání na střed řádků */
.tbl-treneri th, .tbl-treneri td { vertical-align: middle; }
.tbl-treneri th:first-child,
.tbl-treneri td:first-child { padding-left: 14px !important; }

/* akční sloupec – tlačítko nezalamovat a zarovnat doprava */
.tbl-treneri td.akce { text-align: right; }
.tbl-treneri .btn-pay { white-space: nowrap; display: inline-block; }

/* jemnější horní linka první datové řádky */
.tbl-treneri tbody tr:first-child td { border-top: 1px solid #eee !important; }

/* Trenéři – fixní šířka tabulky a horizontální scroll (jako ostatní changelisty) */
.treneri-table-wrapper {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  width: 100% !important;
}
.tbl-treneri {
  min-width: 680px !important;
  width: 100% !important;
}

/* Trenér detail – tabulky a box „Nová sazba od…“ */
.trener-detail-table-wrapper{
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  width: 100% !important;
}
.trener-detail-table-wrapper table{
  min-width: 680px !important;
  width: 100% !important;
  table-layout: fixed !important;
}

.trener-rate-box{
  max-width: 420px;
}

@media (max-width: 768px){
  .trener-rate-box{
    max-width: 100%;
  }
  .trener-rate-box .module{
    width: 100%;
    box-sizing: border-box;
  }
}

/* ===== Trenéři – souhrn: řádek se součty pod tabulkou ===== */
.tbl-treneri tfoot tr.totals td {
  font-weight: 700;              /* výraznější písmo */
  font-size: 1.05rem;            /* o něco větší než zbytek tabulky */
  background: #ffffff;           /* jemné zvýraznění řádku */
  border-top: 2px solid #daba72 !important;  /* silná oddělovací čára */
  padding-top: 12px;
  padding-bottom: 12px;
}

/* text "Součty:" doprava, aby to působilo jako popisek řádku */
.tbl-treneri tfoot tr.totals td.label {
  text-align: right;
  color: #333;
}

/* čísla v součtovém řádku zarovnaná na střed, stejně jako ve sloupcích */
.tbl-treneri tfoot tr.totals td.center,
.tbl-treneri tfoot tr.totals td.num { 
  text-align: center;
}

/* ===== Souhrn hráče (pod tabulkou) ===== */
.player-summary{
  margin: 14px 0 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  background: #ffffff;
  border: 1px solid #e5e7eb;           /* jemná linka jako zbytek adminu */
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}

.player-summary .ps-item{
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(#fafafa, #fff);
  border: 1px solid #eef2f7;
  border-radius: 10px;
}

/* drobná tečka vlevo – barvy jen decentně odlišené */
.player-summary .ps-item::before{
  content: "";
  width: 10px; height: 10px;
  border-radius: 999px;
  background: #d1d5db;
  flex: 0 0 10px;
  box-shadow: 0 0 0 2px #fff inset;
}
.player-summary .ps-item:nth-child(1)::before{ background:#60a5fa; } /* tréninky */
.player-summary .ps-item:nth-child(2)::before{ background:#fbbf24; } /* součet cen */
.player-summary .ps-item:nth-child(3)::before{ background:#34d399; } /* součet zaplaceno */
.player-summary .ps-item:nth-child(4)::before{ background:#a78bfa; } /* aktuální kredit */

.player-summary .ps-label{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7280;                       /* šedá jako v adminu */
  font-weight: 700;
}

.player-summary .ps-value{
  margin-left: auto;                    /* čísla k pravému okraji “pill” */
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  color: #111827;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

/* Kredit – barvy podle znaménka */
.player-summary .ps-item.ps-credit .ps-value{
  transition: color .15s ease;
}
.player-summary .ps-item.ps-credit.is-positive .ps-value{ color:#16a34a; } /* green-600 */
.player-summary .ps-item.ps-credit.is-negative .ps-value{ color:#dc2626; } /* red-600 */

/* Tečka vlevo u kreditu bude taky podle znaménka (přebije dřívější nth-child) */
.player-summary .ps-item.ps-credit::before{ background:#a3e635; }          /* 0 jako neutrální lime */
.player-summary .ps-item.ps-credit.is-positive::before{ background:#22c55e; } /* green-500 */
.player-summary .ps-item.ps-credit.is-negative::before{ background:#ef4444; } /* red-500 */


/* responsivní drobnosti */
@media (max-width: 640px){
  .player-summary{ padding: 12px; gap: 10px; }
  .player-summary .ps-item{ padding: 10px 12px; }
  .player-summary .ps-value{ font-size: 18px; }
}


/* === ADMIN: sjednocený vzhled stránkování (paginator) ===================== */

/* Kontejner – bílá „karta“ jako zbytek UI */
.change-list .paginator{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin:12px 0 0;
  padding:8px 10px;
  background:#fff;
  border:1px solid #e5e7eb;        /* stejná linka jako tabulky */
  border-radius:10px;
}

/* Čísla stránek jako malé „pill“ buttony */
.change-list .paginator a,
.change-list .paginator .this-page{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:34px;
  padding:0 10px;
  border-radius:8px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#111827;
  text-decoration:none;
  font-weight:600;
  line-height:1;
}

/* Hover efekt jako u oranžových tlačítek */
.change-list .paginator a:hover{
  background:#fff7ed;              /* lehce oranžové pozadí */
  border-color:#f59e0b;
  color:#7c2d12;
}

/* Aktivní stránka – plná oranžová */
.change-list .paginator .this-page{
  background:#E67817;
  border-color:#f59e0b;
  color:#fff;
}

/* „První/Poslední/Předchozí/Další“ – drobná odlišnost (volitelné) */
.change-list .paginator a.prev,
.change-list .paginator a.next,
.change-list .paginator a.end,
.change-list .paginator a.start{
  padding:0 12px;
  border-radius:9999px;
}

/* Text „X záznamů“ + „Zobrazit vše“ zarovnání a styl */
.change-list .paginator .showall,
.change-list .paginator .paginator-info{
  margin-left:auto;
  font-weight:600;
  color:#374151;
}

/* Odkaz „Zobrazit vše“ jako nenápadný čip */
.change-list .paginator .showall a{
  display:inline-flex;
  align-items:center;
  height:34px;
  padding:0 12px;
  border-radius:9999px;
  border:1px solid #e5e7eb;
  background:#f3f4f6;
  text-decoration:none;
  margin-left:8px;
  color:#111827;
}
.change-list .paginator .showall a:hover{
  background:#e5e7eb;
}

/* Responsive: ať se to hezky zalamuje na menších šířkách */
@media (max-width: 700px){
  .change-list .paginator{ gap:6px; }
  .change-list .paginator .showall,
  .change-list .paginator .paginator-info{ margin-left:0; }
}


/* ================================
   Django Admin Select2 (autocomplete)
   ================================ */

/* Vzhled samotného pole (input „combobox“) */
.select2-container--admin-autocomplete .select2-selection--single{
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
}
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered{
  line-height: 34px;                 /* srovná vertikální zarovnání textu */
  padding-left: 10px;
}
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow{
  height: 34px;
}
.select2-container--admin-autocomplete.select2-container--focus
.select2-selection--single{
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(230,120,23,.15) !important;
  outline: 2px solid var(--brand) !important;
  outline-offset: 2px !important;
}

/* Dropdown bublina (appenduje se do <body>) */
.select2-container--admin-autocomplete .select2-dropdown{
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  overflow: hidden;                   /* aby zaoblení drželo i uvnitř */
}

/* Vyhledávací input uvnitř dropdownu */
.select2-container--admin-autocomplete .select2-search__field{
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
}
.select2-container--admin-autocomplete .select2-search__field:focus{
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(230,120,23,.15) !important;
  outline: 2px solid var(--brand) !important;
  outline-offset: 2px !important;
}

/* Položky v seznamu – hover */
.select2-container--admin-autocomplete .select2-results__option{
  border-radius: 8px;
  padding: 8px 10px;
}
.select2-container--admin-autocomplete .select2-results__option--highlighted:not([aria-selected]){
  background: #fff7ed;                /* krémový hover */
  color: #111827;
}

/* >>> Aktivní/označená položka – ORANŽOVĚ <<< */
.select2-results__option--highlighted[aria-selected],
.select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected]{
  background: #f59e0b !important;     /* brand orange */
  color: #ffffff !important;          /* bílý text */
}

/* Vybraná položka (když je označená, ale neaktivní) */
.select2-container--admin-autocomplete .select2-results__option[aria-selected="true"]{
  background: #ffedd5;                /* světle oranžová */
  color: #92400e;
}
/* ===== Tlačítka „Uložit“ bez capslocku (text-transform: none) ===== */
.submit-row input[type="submit"],
.submit-row button[type="submit"],
.add-day-btn-save,
.add-day-btn-save-addanother {
  text-transform: none !important;
}

/* ===== Tlačítko „Uložit: Přidat Další“ – stejný vzhled jako v add_form (oranžové, bílé písmo) v celém systému ===== */
.submit-row input[name="_addanother"],
.submit-row button[name="_addanother"],
#toolbar input[name="_addanother"],
#toolbar button[name="_addanother"],
.grp-submit-row input[name="_addanother"],
.grp-submit-row button[name="_addanother"] {
  background: var(--brand) !important;
  border: 3px solid var(--brand-600) !important;
  color: #fff !important;
  border-radius: 100px !important;
  padding: 7px 12px !important;
  text-decoration: none !important;
  font-family: var(--btn-font-family) !important;
  font-size: var(--btn-font-size) !important;
  font-weight: var(--btn-font-weight) !important;
  line-height: 1 !important;
  letter-spacing: .2px !important;
  cursor: pointer !important;
}
.submit-row input[name="_addanother"]:hover,
.submit-row button[name="_addanother"]:hover,
#toolbar input[name="_addanother"]:hover,
#toolbar button[name="_addanother"]:hover,
.grp-submit-row input[name="_addanother"]:hover,
.grp-submit-row button[name="_addanother"]:hover {
  filter: brightness(1.05) !important;
}

/* Text „Uložit: Přidat Další“ (přepsat tam, kde Django vykreslí jiný text – u button skryjeme původní a zobrazíme ::after) */
.submit-row button[name="_addanother"]:not(.add-day-btn-save-addanother) {
  font-size: 0 !important;
  position: relative !important;
}
.submit-row button[name="_addanother"]:not(.add-day-btn-save-addanother)::after {
  content: "Uložit: Přidat Další" !important;
  font-size: var(--btn-font-size) !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  color: #fff !important;
}

/* ===== Add-form (Trénink: přidat) – řádek Uložit a tlačítka stejné jako .submit-row v custom.css ===== */
.add-day-submit-row {
  background: var(--surface) !important;
  border: 10px solid var(--line) !important;
  border-radius: 30px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.03) !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: .5rem !important;
  padding: 7px 12px !important;
  margin-top: 12px !important;
  overflow: visible !important;
}
.add-day-btn-save,
.add-day-btn-save-addanother {
  background: var(--brand) !important;
  border: 3px solid var(--brand-600) !important;
  color: #fff !important;
  border-radius: 100px !important;
  padding: 7px 12px !important;
  text-decoration: none !important;
  font-family: var(--btn-font-family) !important;
  font-size: var(--btn-font-size) !important;
  font-weight: var(--btn-font-weight) !important;
  line-height: 1 !important;
  letter-spacing: .2px !important;
  cursor: pointer !important;
}
.add-day-btn-save:hover,
.add-day-btn-save-addanother:hover {
  filter: brightness(1.05) !important;
}

/* ===== HIDE: 'Uložit a pokračovat v úpravách' (name="_continue") na všech admin stránkách ===== */
.submit-row input[name="_continue"],
.submit-row button[name="_continue"],
#toolbar input[name="_continue"],
#toolbar button[name="_continue"],
.object-tools input[name="_continue"],
.object-tools button[name="_continue"],
.grp-submit-row input[name="_continue"],
.grp-submit-row button[name="_continue"]{
  display: none !important;
}

/* ===== FIX 1: Hlavička tabulek – žádný hover, drž krémovou ===== */
#result_list thead th,
.module table thead th,
.results thead th {
  background: var(--amber-100) !important;
  color: var(--text) !important;
}

/* jakýkoliv hover na thead zrušit (když přijde z default admin CSS) */
#result_list thead tr:hover th,
.module table thead tr:hover th,
.results thead tr:hover th,
table thead tr:hover th {
  background: var(--amber-100) !important;
  color: var(--text) !important;
}

/* hover jen na tělo tabulky, ne na thead */
#result_list tbody tr:hover td,
.module table tbody tr:hover td,
.results tbody tr:hover td {
  background: #fff8e6 !important; /* jemný krémový */
}

/* ===== FIX 2: Kalendář v „Přidat trénink“ ===== */
.calendarbox,
.clockbox {
  z-index: 10000 !important; /* ať je nad sticky věcmi */
}

/* pevné pozadí hlavičky kalendáře/caption */
.calendarbox table thead th,
.calendarbox table caption {
  background: var(--amber-100) !important;
  color: var(--text) !important;
}

/* zruš jakékoliv globální tr:hover uvnitř kalendáře */
.calendarbox table tr:hover th,
.calendarbox table tr:hover td {
  background: initial !important;
  color: inherit !important;
}

/* příjemný hover jen na konkrétní dny */
.calendarbox .calendar tbody td:hover {
  background: #fff8e6 !important;
}

/* Ikona kalendáře u pole Datum – světle oranžová pilulka + oranžová ikona */
.datetimeshortcuts a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff3df;              /* světle oranžové pozadí */
  color: #E67817 !important;        /* text „Dnes“ oranžový */
  text-decoration: none !important;
}
.datetimeshortcuts a:hover {
  background: #ffe4bf;              /* o něco sytější při hoveru */
}
.datetimeshortcuts a img {
  filter: hue-rotate(-10deg) saturate(140%) brightness(1.1); /* zabarví ikonku lehce do oranžova */
}

/* Desktop: kalendář držet v rámci viewportu (plovoucí box uprostřed) */
@media (min-width: 1024px) {
  .calendarbox {
    position: fixed !important;
    top: 96px !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: 640px !important;                          /* ještě širší kalendář */
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100vh - 140px) !important;
    overflow: auto !important;
    margin: 0 !important;
  }
}

/* === FINAL PATCH: světlo pro tabulky, Select2 a kalendář === */

/* vynutit světlé schéma i proti auto-dark */
html, body, .change-list, .results, table, .select2-container, .calendarbox { 
  color-scheme: light !important; 
}

/* TABULKY (hlavička + řádky + hover) */
table thead th{
  background: var(--amber-100) !important;
  color: var(--text) !important;
  background-image: none !important;
  box-shadow:none !important; filter:none !important;
}
table thead th::before, table thead th::after{ background:transparent !important; box-shadow:none !important; }

table tbody tr, table tbody td{ background:#fff !important; color:var(--text) !important; }
table tbody tr:nth-child(even){ background:#fffaf0 !important; }
table tbody tr:hover > td{ background:#fff3df !important; color:var(--text) !important; }

/* SELECT2 (dropdown, vyhledávací input, položky) */
.select2-container--admin-autocomplete .select2-selection--single{
  background:#fff !important; color:#111 !important; border:1px solid #E5E7EB !important; border-radius:8px !important;
}
.select2-container .select2-dropdown{
  background:#fff !important; color:#111 !important; border:1px solid #e5e7eb !important;
}
.select2-search--dropdown .select2-search__field{
  background:#fff !important; color:#111 !important; -webkit-text-fill-color:#111 !important;
  border:1px solid #e5e7eb !important; border-radius:8px !important;
}
.select2-results__option{ background:#fff !important; color:#111 !important; }
.select2-results__option--highlighted:not([aria-selected]){ background:#fff7ed !important; color:#111 !important; }
.select2-results__option--highlighted[aria-selected]{ background:#f59e0b !important; color:#fff !important; }

/* trénink – tabulka Hráči: šedý border jako u ostatních bílých polí */
body.app-core.model-trening #dochazka_set-group,
body.app-core.model-trening #dochazky-group,
body.app-core.model-trening .x-dochazka-inline{
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04) !important;
  outline: none !important;
  border-radius: 10px !important;
}
body.app-core.model-trening #dochazka_set-group .module,
body.app-core.model-trening #dochazky-group .module,
body.app-core.model-trening #dochazka_set-group fieldset,
body.app-core.model-trening #dochazky-group fieldset,
body.app-core.model-trening #dochazka_set-group .inline-group,
body.app-core.model-trening #dochazky-group .inline-group,
body.app-core.model-trening #dochazka_set-group .tabular,
body.app-core.model-trening #dochazky-group .tabular,
body.app-core.model-trening .x-dochazka-inline .module,
body.app-core.model-trening .x-dochazka-inline fieldset,
body.app-core.model-trening .x-dochazka-inline .inline-group,
body.app-core.model-trening .x-dochazka-inline .tabular{
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* DOCHÁZKA – <select> v první buňce světlý + menší bubliny (jako dříve) */
#dochazka_set-group td:first-child select,
#dochazky-group td:first-child select,
.x-dochazka-inline td:first-child select,
.inline-group .related-widget-wrapper select{
  background:#fff !important; color:#111 !important; -webkit-text-fill-color:#111 !important;
  border:1px solid #E5E7EB !important; border-radius:8px !important; appearance:auto !important;
  height:36px !important; min-height:36px !important; padding:6px 10px !important; font-size:14px !important;
}
#dochazka_set-group td:first-child .related-widget-wrapper,
#dochazky-group td:first-child .related-widget-wrapper,
.x-dochazka-inline td:first-child .related-widget-wrapper{
  min-height:36px !important;
}
#dochazka_set-group .select2-container .select2-selection--single,
#dochazky-group .select2-container .select2-selection--single,
.x-dochazka-inline .select2-container .select2-selection--single{
  min-height:36px !important; height:36px !important;
}

/* Trénink add/change – menší bubliny (inputy, selecty) v celém formuláři */
body.app-core.model-trening.change-form .module.aligned .form-row input:not([type="submit"]):not([type="button"]),
body.app-core.model-trening.change-form .module.aligned .form-row select,
body.app-core.model-trening.change-form .module.aligned .form-row textarea{
  height:36px !important; min-height:36px !important; padding:6px 10px !important;
}
body.app-core.model-trening.change-form .module.aligned .form-row textarea{
  height:64px !important; min-height:64px !important;
}

/* Trénink add/change – jednotný oranžový focus pro VŠECHNY bubliny (Datum, Čas, Poznámka, Trenér, …) */
body.app-core.model-trening.change-form #content-main .module.aligned input:not([type="submit"]):not([type="button"]):focus,
body.app-core.model-trening.change-form #content-main .module.aligned input:not([type="submit"]):not([type="button"]):focus-visible,
body.app-core.model-trening.change-form #content-main .module.aligned select:focus,
body.app-core.model-trening.change-form #content-main .module.aligned select:focus-visible,
body.app-core.model-trening.change-form #content-main .module.aligned textarea:focus,
body.app-core.model-trening.change-form #content-main .module.aligned textarea:focus-visible {
  outline: 2px solid var(--brand) !important;
  outline-offset: 2px !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(230, 120, 23, 0.15) !important;
}

/* KALENDÁŘ (widget) */
.calendarbox table, .calendarbox .calendar td, .calendarbox .calendar th{
  background:#fff !important; color:var(--text) !important; box-shadow:none !important; filter:none !important;
}
.calendarbox table thead th, .calendarbox table caption{
  background:var(--amber-100) !important; color:var(--text) !important;
}
.calendarbox .calendar tbody td:hover{ background:#fff8e6 !important; }

/* Pojistka proti force-dark z prohlížeče */
html, body, #result_list, .results, table {
  color-scheme: light !important;
  filter: none !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal !important;
}
#result_list tbody th[scope="row"] { position: static !important; }
#result_list td::before, #result_list td::after,
#result_list th::before, #result_list th::after { content: none !important; }
#result_list tbody tr:hover > td { background: #fff3df !important; }

/* =================================================================== */
/* === GLOBÁLNÍ FIX v2: Hover efekt pro všechny tabulky (agresivní) === */
/* =================================================================== */

/* 1. STATICKÝ STAV HLAVIČKY: Vynutí krémové pozadí a správnou barvu textu. */
table thead th,
table thead th a {
    background: var(--amber-100) !important;
    color: var(--text) !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    text-decoration: none !important;
}

/* 2. HOVER STAV HLAVIČKY: Zůstaň krémová, nic neměň! */
/* Toto je klíčová část, která aktivně bojuje proti nechtěnému černému hoveru. */
table thead tr:hover th,
table thead tr:hover th a {
    background: var(--amber-100) !important;
    color: var(--text) !important;
}

/* === GLOBÁLNÍ FIX: Hover efekt pro CELÝ řádek tabulky (včetně <th>) === */
table tbody tr:hover td,
table tbody tr:hover th {
  background: #fff3df !important; /* Váš stávající jemně oranžový hover */
  color: var(--text) !important;
}
/* =================================================================== */
/* === MOBILNÍ OPRAVY (přebijí vše ostatní) === */
/* =================================================================== */

@media (max-width: 820px) {

  /* Skryje název "Tenis systém Čimice" */
  #branding .brand .brand-title {
      display: none !important;
  }

  /* Skryje celý blok s odkazy vpravo */
  #user-tools {
      display: none !important;
  }
}

/* =================================================================== */
/* === GLOBÁLNÍ: aby oranžový focus ring nebyl oříznutý ============= */
/* =================================================================== */

/* Hlavní bílé bloky a řádky formulářů nesmí ořezávat outline/box-shadow */
#content,
#content-main,
.module,
.panel,
.card,
.aligned,
.aligned .form-row,
body.change-form .aligned .form-row,
body.add-form .aligned .form-row {
  overflow: visible !important;
}
