
:root{
  --bg:#0b1220;
  --card:#121a2b;
  --muted:#93a4c7;
  --text:#e9eefc;
  --accent:#6ea8fe;
  --danger:#ff6b6b;
  --ok:#4dd4ac;
  --border:rgba(255,255,255,.08);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: linear-gradient(180deg, #081022, #070b15);
  color:var(--text);
}
a{ color:var(--accent); }
.container{
  max-width:1200px;
  margin:0 auto;
  padding:24px;
}
header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.brand{
  display:flex;
  align-items:baseline;
  gap:12px;
}
.brand h1{
  margin:0;
  font-size:20px;
  letter-spacing:.3px;
}
.badge{
  border:1px solid var(--border);
  padding:4px 10px;
  border-radius:999px;
  color:var(--muted);
  font-size:12px;
}

.panel{
  border:1px solid var(--border);
  background: rgba(18,26,43,.75);
  backdrop-filter: blur(8px);
  border-radius:16px;
  padding:16px;
}

.row{ display:flex; gap:12px; flex-wrap:wrap; }
.row > * { flex:1; min-width: 220px; }

input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(7,11,21,.6);
  color:var(--text);
  outline:none;
}
textarea{ min-height:80px; resize:vertical; }

button{
  border:1px solid var(--border);
  background: rgba(110,168,254,.18);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  transition: transform .05s ease, background .2s ease;
}
button:hover{ background: rgba(110,168,254,.26); }
button:active{ transform: translateY(1px); }
button.secondary{ background: rgba(255,255,255,.06); }
button.secondary:hover{ background: rgba(255,255,255,.10); }
button.danger{ background: rgba(255,107,107,.16); border-color: rgba(255,107,107,.35); }
button.danger:hover{ background: rgba(255,107,107,.24); }
button.ok{ background: rgba(77,212,172,.16); border-color: rgba(77,212,172,.35); }
button.ok:hover{ background: rgba(77,212,172,.22); }
.small{ padding:6px 10px; border-radius:10px; font-size:12px; }
hr.sep{ border:none; border-top:1px solid var(--border); margin:16px 0; }

.hidden{ display:none !important; }

.board{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}
@media(min-width: 900px){
  .board{ grid-template-columns: repeat(3, 1fr); }
}

.column{
  border:1px solid var(--border);
  background: rgba(7,11,21,.35);
  border-radius:16px;
  padding:12px;
  min-height: 420px;
}
.column h3{
  margin:0 0 10px 0;
  font-size:14px;
  color: var(--muted);
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.cards{ display:flex; flex-direction:column; gap:10px; }
.card{
  border:1px solid var(--border);
  background: rgba(18,26,43,.85);
  border-radius:14px;
  padding:10px;
}
.card .meta{
  display:flex; justify-content:space-between; align-items:center;
  gap:8px;
  color: var(--muted);
  font-size:12px;
  margin-bottom:6px;
}
.card .text{ white-space: pre-wrap; }
.card .actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }

.star{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  cursor:pointer;
  user-select:none;
}
.star.on{ background: rgba(255,215,0,.10); border-color: rgba(255,215,0,.22); }

.notice{
  color: var(--muted);
  font-size: 13px;
}

.kv{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  color: var(--muted);
  font-size: 13px;
}
.kv b{ color: var(--text); }

.footer-actions{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  gap:10px;
  align-items:center;
}
.footer-left{ justify-self:start; }
.footer-center{ justify-self:center; }
.footer-right{
  justify-self:end;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* Phase centered + bigger */
.phase-big{
  font-size: 16px;
  color: var(--muted);
}
.phase-big b{
  font-size: 18px;
  color: var(--text);
}

/* Responsive: stack on narrow screens */
@media (max-width: 780px){
  .footer-actions{
    grid-template-columns: 1fr;
  }
  .footer-left, .footer-center, .footer-right{
    justify-self: start;
  }
  .footer-right{
    justify-content:flex-start;
  }
}


/* Actions list (pod sebe) */
.actions-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  white-space: normal;
}
.action-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(18,26,43,.60);
}
.action-row .text{
  flex:1;
}
.action-row .meta{
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.action-row input[type="checkbox"]{
  width:18px;
  height:18px;
  margin-top:2px;
  accent-color: var(--ok);
  cursor:pointer;
}
.action-row .done{
  text-decoration: line-through;
  opacity: .8;
}

/* Date input icon visibility on dark background */
input[type="date"]{
  color-scheme: light;
}
input[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(1);
  opacity: 0.85;
}


/* Action groups */
.action-group{
  margin-top: 6px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .2px;
  text-transform: uppercase;
}
.action-divider{
  height: 1px;
  background: var(--border);
  margin: 8px 0 2px 0;
}


/* Retro title (nazev boardu) */
.retro-title{
  font-size: 22px;
  font-weight: 700;
  margin: 6px 0 14px 0;
  color: var(--text);
}
.retro-title .meta{
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}

.muted{ color: var(--muted); font-weight: 500; }


/* Header right layout: code flush right */
.header-right{
  flex:1;
  display:flex;
  align-items:center;
  gap:14px;
  justify-content:flex-end;
}
.header-meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.header-code{ }
.code-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(18,26,43,.55);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.code-pill b{ color: var(--text); }


/* Click-to-copy */
.code-pill{
  cursor:pointer;
  user-select:none;
}
.code-pill:hover{
  border-color: rgba(255,255,255,.22);
  background: rgba(18,26,43,.75);
}
.copy-hint{
  margin-left: 8px;
  font-size: 11px;
  opacity: .7;
}

/* Participants chips */
.participants-row{
  display:flex;
  gap:10px;
  align-items:center;
  margin: 6px 0 14px 0;
  flex-wrap:wrap;
}
.participants-label{
  color: var(--muted);
  font-size: 12px;
}
.chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18,26,43,.45);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}
.chip--me{
  border-color: rgba(120,200,255,.35);
}
.chip--owner{
  border-color: rgba(255,215,120,.35);
}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(12,18,30,.9);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}


/* Tabs (Retro / Refinement) */
.board-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 6px 0 10px 0;
}
.tabs{
  display:inline-flex;
  gap:8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(18,26,43,.35);
}
.tab{
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 800;
  font-size: 13px;
}
.tab:hover{
  background: rgba(255,255,255,.05);
  color: var(--text);
}
.tab.active{
  background: rgba(255,255,255,.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.10);
}
.board-tools{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.tab-panel.hidden{ display:none; }

@media (max-width: 860px){
  .board-topbar{ flex-direction:column; align-items:flex-start; }
  .board-tools{ justify-content:flex-start; }
}

/* Refinement layout */
.h2{
  margin:0 0 10px 0;
  font-size:16px;
}
.refinement-grid{
  display:grid;
  grid-template-columns: 1.05fr 1fr;
  gap:14px;
}
@media (max-width: 980px){
  .refinement-grid{ grid-template-columns: 1fr; }
}
.panel2{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(18,26,43,.22);
}
.ref-item-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.ref-item{
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(18,26,43,.22);
  padding: 10px 12px;
  cursor:pointer;
}
.ref-item:hover{ background: rgba(255,255,255,.04); }
.ref-item.active{
  border-color: rgba(120,200,255,.35);
  background: rgba(18,26,43,.35);
}
.ref-item-title{
  font-weight: 900;
  color: var(--text);
}
.ref-item-meta{
  margin-top:6px;
  font-size:12px;
  color: var(--muted);
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.badge{
  display:inline-flex;
  align-items:center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18,26,43,.35);
  font-size: 11px;
  color: var(--text);
}
.badge.ok{ border-color: rgba(90,255,170,.25); }
.badge.warn{ border-color: rgba(255,215,120,.25); }

.ref-selected-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.ref-selected-title{
  font-weight: 950;
  font-size: 14px;
}
.ref-selected-meta{
  margin-top:4px;
  font-size:12px;
  color: var(--muted);
}
.ref-selected-details{
  margin-top:10px;
  color: var(--text);
  opacity: .92;
  white-space: pre-wrap;
}
.ref-owner-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.ref-status{
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 10px;
}
.ref-status-line{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:10px;
}
.ref-results{
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 10px;
}
.ref-final{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 10px;
}
.ref-final input{ width: 140px; }

/* Planning poker deck */
.poker-grid{
  display:grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap:10px;
}
@media (max-width: 980px){
  .poker-grid{ grid-template-columns: repeat(4, minmax(70px, 1fr)); }
}
.poker-card{
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(18,26,43,.30);
  padding: 18px 10px;
  text-align:center;
  font-weight: 1000;
  font-size: 22px;
  cursor:pointer;
  user-select:none;
}
.poker-card:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.18);
}
.poker-card.selected{
  border-color: rgba(120,200,255,.45);
  background: rgba(18,26,43,.50);
}
.poker-card.disabled{
  opacity: .5;
  cursor: not-allowed;
}


/* Home: quick open Refinement */
.ref-quick{
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(18,26,43,.22);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.ref-quick-title{
  font-weight: 950;
  color: var(--text);
  font-size: 14px;
}
.ref-quick-desc{
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.ref-quick-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
@media (max-width: 860px){
  .ref-quick{ flex-direction:column; align-items:flex-start; }
  .ref-quick-actions{ justify-content:flex-start; }
}


/* Home layout */
.home-h2{ margin:0 0 10px 0; font-size:16px; }
.home-h3{ margin:0 0 8px 0; font-size:14px; color: var(--muted); }
.home-name-row{ margin-bottom: 12px; }
.home-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.home-card{
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(18,26,43,.22);
}
.home-card-head{ display:flex; flex-direction:column; gap:4px; margin-bottom: 10px; }
.home-card-title{ font-size:16px; font-weight: 950; color: var(--text); }
.home-card-sub{ font-size:12px; color: var(--muted); line-height:1.35; }
.home-card-body{ }
.home-sep{
  border:0;
  border-top:1px solid rgba(255,255,255,.08);
  margin: 14px 0;
}
.sp-10{ height: 10px; }

@media (max-width: 900px){
  .home-grid{ grid-template-columns: 1fr; }
}

/* Board header (no tabs) */
.board-head{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.board-head-left{ min-width:0; }
.board-head-center{ display:flex; justify-content:center; }
.board-head-right{ display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.board-view-pill{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight: 900;
  letter-spacing: .2px;
}

@media (max-width: 900px){
  .board-head{ grid-template-columns: 1fr; }
  .board-head-center{ justify-content:flex-start; order: -1; }
  .board-head-right{ justify-content:flex-start; }
}

/* Refinement results chart */
.ref-results-grid{
  margin-top: 8px;
  display:grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
  align-items: start;
}
.ref-chart{
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 10px;
  background: rgba(18,26,43,.18);
}
.ref-pie{ display:block; margin: 0 auto 10px auto; }
.ref-legend{ display:flex; flex-direction:column; gap:6px; }
.legend-row{ display:flex; align-items:center; gap:8px; font-size:12px; color: var(--muted); }
.legend-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset;
}

@media (max-width: 1000px){
  .ref-results-grid{ grid-template-columns: 1fr; }
}


/* Admin */
.admin-card{ margin-top: 14px; }
.admin-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.admin-row{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(18,26,43,.18);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.admin-row .meta{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width: 240px;
}
.admin-row .meta .t{ font-weight: 950; }
.admin-row .meta .s{ color: var(--muted); font-size: 12px; }
.admin-row .actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.admin-detail{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(18,26,43,.18);
}
.admin-detail pre{
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}


/* Clickable title */
#homeTitle{
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
#homeTitle:hover{
  text-decoration: underline;
}
