:root{
  --bg:#0f172a;      /* tmavé pozadí topbaru */
  --fg:#e2e8f0;      /* světlý text */
  --muted:#94a3b8;
  --panel:#ffffff;
  --line:#e5e7eb;
  --accent:#2563eb;
}

html,body{margin:0;padding:0}
body.org{font:16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:#111}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; gap:.75rem;
  padding:.5rem .75rem; background:var(--bg); color:var(--fg);
}
.topbar .menu-toggle{font-size:1.25rem; background:transparent; border:0; color:var(--fg); cursor:pointer}
.topbar__brand{font-size:1rem}
.topbar .muted{color:var(--muted)}
.topbar__status{margin-left:auto; display:flex; gap:.5rem; align-items:center}
.badge{background:rgba(255,255,255,.1); padding:.15rem .5rem; border-radius:.5rem}
.topbar__actions{display:flex; gap:.5rem}
.btn{display:inline-block; padding:.4rem .7rem; border:1px solid rgba(255,255,255,.25); border-radius:.5rem; text-decoration:none; color:var(--fg)}
.btn.sm{font-size:.875rem}
.topbar A, .topbar A:visited {color: var(--fg);}

.layout{display:grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 48px)}
.sidebar{border-right:1px solid var(--line); background:#fafafa}
.content{padding:1rem; background:#fff}

.nav{list-style:none; margin:0; padding:.5rem}
.nav li a{display:block; padding:.5rem .75rem; text-decoration:none; color:#111; border-radius:.5rem}
.nav li.active a, .nav li a:hover{background:#eef2ff; color:#1e40af}
.nav-section {
  margin:.75rem .25rem .25rem;
  padding:.25rem .5rem;
  font-size:.75rem;
  font-weight:600;
  text-transform:uppercase;
  color:#64748b;       /* neutrální šedá */
  border-top:1px solid var(--line);
}
.nav-section:first-child {
  border-top:0;        /* první záhlaví bez čáry */
  margin-top:0;
}

.table{
  width:100%; border-collapse:separate; border-spacing:0;
  background:var(--panel); border:1px solid var(--line); border-radius:.5rem; overflow:hidden;
}
.table th, .table td{padding:.5rem .6rem; border-bottom:1px solid var(--line); font-size:.93rem}
.table th{position:sticky; top:0; background:#f8fafc; z-index:1; text-align:left}
.table tr:nth-child(even){background:#fcfcff}

.flash{margin:.5rem 0; padding:.6rem .8rem; border-left:4px solid var(--accent); background:#eff6ff}


.orgtable TD {
  padding: 0px 5px;
  vertical-align: top;
  }
.orgtable TD.bold {
  font-weight: bold;
  color: #090;
  }
.incorrect {
  background: #F99;
  }
.correct {
  background: #9F9;
  }
  .center {
      text-align: center;
  }
/* --- TABLE: baseline (mobile-first = karty) --- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table thead { display: none; }               /* na mobilu schovat hlavičku */
.table tr { display: block; background: #fff; border: 1px solid #e5e7eb; border-radius: .6rem; margin: .75rem 0; overflow: hidden; }
.table td { display: grid; grid-template-columns: 9.5rem 1fr; gap: .75rem; padding: .6rem .8rem; border-bottom: 1px dashed #e5e7eb; }
.table td:last-child { border-bottom: 0; }

/* štítky sloupců se doplní JS do attr(data-label) */
.table td::before {
  content: attr(data-label);
  font-weight: 600;
  color: #334155;
}

/* --- iEtAppa Odpovědi --- */
/* --- ================ --- */

table.odpovedi tbody td.answer-icon img { width: 47px; margin: 0; }
table.odpovedi tbody tr.correct   { border-left: 4px solid #16a34a; background:#f0fdf4; }
table.odpovedi tbody tr.incorrect { border-left: 4px solid #dc2626; background:#fef2f2; }

/* Mobilní karty pro tabulku odpovědí */
@media (max-width: 720px){
  table.odpovedi {
    width: 100%;
    border: 0;
    border-collapse: collapse;
  }

  table.odpovedi thead { 
    display: none;                /* hlavičku schováme vizuálně */
  }

  table.odpovedi tbody tr{
    display: block;               /* řádek se stane kartou */
    margin: .35rem 0;
    padding: .35rem .75rem;
    border: 1px solid #e5e7eb;
    border-radius: .6rem;
    background: #fff;
  }

  table.odpovedi tbody td{
    display: flex;                /* řádek = dvojice: štítek + hodnota */
    gap: .5rem;
    padding: .15rem 0;
    border: 0;
  }

  table.odpovedi tbody td.answer-icon { float: left; }
  table.odpovedi tbody td.answer-name { float: left; }
  table.odpovedi tbody td.answer-puzzle { display: none; }
  table.odpovedi tbody td.answer-code { float: right; font-weight: bold; }
  table.odpovedi tbody td.answer-date { clear: right; justify-content: right; font-size: 80%; color: #999}
  
  table.odpovedi tbody td.answer-icon img { width: 47px; margin-right: 5px; }
  
  /* Aby se dlouhé hodnoty chovaly hezky */
  table.odpovedi tbody td > * { 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap;
  }

  /* Volitelné zvýraznění správně/špatně – můžeš si přebarvit podle sebe */
}



  
/* --- IEtAppa Výsledky --- */
/* --- ================ --- */

.ietappa-results {
    border-collapse: collapse;
}
.ietappa-rowborder {
    border-bottom: 1px solid #EEE;
}
.ietappa-name {
    text-align: left;
}
.ietappa-email {
    text-align: left;
    color: #999;
    font-size: 60%;
    vertical-align: middle;
}
.ietappa-puzzlebox {
    font-size: 60%;
    color: #999;
}
.sq {
    width: 18px;
}



@media (max-width: 900px){
  .layout{grid-template-columns: 1fr}
  .sidebar{position:fixed; inset:48px auto 0 0; width:260px; transform:translateX(-100%); transition:transform .2s ease; box-shadow:2px 0 12px rgba(0,0,0,.15); z-index:9}
  .sidebar.open{transform:translateX(0)}
}

/* “Tabulka jako karty” pro úzké displeje */
@media (max-width: 640px){
  .table{border:0}
  .table thead{display:none}
  .table tr{display:block; border:1px solid var(--line); margin-bottom:.75rem; border-radius:.5rem}
  .table td{display:flex; justify-content:space-between; gap:1rem; border-bottom:1px dashed var(--line)}
  .table td::before{content:attr(data-label); font-weight:600; color:#334155}
  .table td:last-child{border-bottom:0}
}
