:root{
  --bg:#0b1220;
  --panel:#0f1b33;
  --card:#111f3d;
  --muted:#9aa6c1;
  --text:#e7ecf6;
  --accent:#4f8cff;
  --accent2:#22c55e;
  --danger:#ef4444;
  --border:rgba(255,255,255,.08);
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(79,140,255,.25), transparent 55%),
              radial-gradient(900px 700px at 90% 20%, rgba(34,197,94,.18), transparent 55%),
              linear-gradient(180deg, var(--bg), #050914 70%);
  color:var(--text);
}

a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}
small{color:var(--muted)}
code{background:rgba(255,255,255,.06); padding:.15rem .35rem; border-radius:8px}

.topbar{
  position:sticky; top:0; z-index:10;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.55);
  border-bottom:1px solid var(--border);
}
.navwrap{
  max-width:1100px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
}
.brand{display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.2px}
.brand .dot{width:10px;height:10px;border-radius:999px;background:var(--accent); box-shadow:0 0 18px rgba(79,140,255,.65)}
.navlinks{display:flex; gap:14px; align-items:center; flex-wrap:wrap}
.navlinks a{
  color:rgba(231,236,246,.9);
  padding:8px 10px;
  border-radius:10px;
  border:1px solid transparent;
}
.navlinks a.active, .navlinks a:hover{
  border-color:var(--border);
  background:rgba(255,255,255,.04);
  text-decoration:none;
}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{background:rgba(255,255,255,.08)}
.btn.primary{background: linear-gradient(135deg, rgba(79,140,255,.95), rgba(79,140,255,.65)); border-color: rgba(79,140,255,.55)}
.btn.primary:hover{filter:brightness(1.05)}
.btn.good{background: linear-gradient(135deg, rgba(34,197,94,.95), rgba(34,197,94,.60)); border-color: rgba(34,197,94,.55)}
.btn.danger{background: linear-gradient(135deg, rgba(239,68,68,.95), rgba(239,68,68,.60)); border-color: rgba(239,68,68,.55)}
.btn.link{border-color:transparent; background:transparent; color:rgba(231,236,246,.9); padding:8px 8px}
.btn.link:hover{text-decoration:underline; background:transparent}

.container{max-width:1100px; margin:24px auto; padding:0 18px}
.hero{
  display:grid; grid-template-columns: 1.1fr .9fr;
  gap:18px; align-items:stretch;
}
@media (max-width: 900px){
  .hero{grid-template-columns:1fr}
}
.panel{
  background: rgba(15,27,51,.72);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
}
.panel h1{margin:0 0 10px 0; font-size:32px}
.panel h2{margin:0 0 10px 0; font-size:22px}
.panel p{margin:10px 0; color:rgba(231,236,246,.86); line-height:1.5}
.kpis{
  display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:14px
}
@media (max-width: 700px){ .kpis{grid-template-columns:1fr} }
.kpi{
  background: rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
}
.kpi .label{color:var(--muted); font-size:12px}
.kpi .value{font-size:18px; font-weight:700; margin-top:6px}

.formgrid{
  display:grid; gap:10px; margin-top:8px
}
label{font-size:12px; color:var(--muted)}
input,select,textarea{
  width:100%;
  padding:12px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline:none;
}
textarea{min-height:90px; resize:vertical}
input:focus,select:focus,textarea:focus{border-color: rgba(79,140,255,.55); box-shadow:0 0 0 4px rgba(79,140,255,.12)}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.row > *{flex:1}
.row .btn{flex:0 0 auto}

.breadcrumbs{
  display:flex; gap:8px; align-items:center;
  color:var(--muted);
  font-size:13px;
  margin: 10px 0 16px;
}
.crumb{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  padding:6px 10px;
  border-radius:999px;
}
.sep{opacity:.6}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:14px}
@media (max-width: 900px){ .grid2{grid-template-columns:1fr} }

.cards{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px}
@media (max-width: 900px){ .cards{grid-template-columns:1fr} }
.card{
  background: rgba(17,31,61,.80);
  border:1px solid var(--border);
  border-radius: 16px;
  padding:14px;
}
.card h3{margin:0 0 8px 0}
.card .meta{color:var(--muted); font-size:12px}
.card .actions{display:flex; gap:8px; margin-top:12px; flex-wrap:wrap}
.badge{
  display:inline-flex; gap:6px; align-items:center;
  font-size:12px; color:rgba(231,236,246,.9);
  padding:5px 10px; border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
}
.badge.good{border-color: rgba(34,197,94,.45)}
.badge.warn{border-color: rgba(239,68,68,.45)}
.toast{
  position:fixed; right:18px; bottom:18px; z-index:50;
  background: rgba(17,31,61,.92);
  border:1px solid var(--border);
  border-radius: 14px;
  padding:12px 14px;
  min-width: 260px;
  box-shadow: var(--shadow);
  display:none;
}
.toast.show{display:block}
.toast .t{font-weight:700; margin-bottom:4px}
.toast .m{color:rgba(231,236,246,.85); font-size:13px}

/* =========================
   Calendar Page (Month/Week/Day)
   Sleek modern styling to match theme
   ========================= */

.hidden{display:none}

/* Calendar layout wrappers */
.cal-month, .cal-week, .cal-day{
  display:block;
}

/* Month/Week grid */
.cal-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap:12px;
  margin-top:12px;
}

.cal-cell{
  appearance:none;
  border:1px solid var(--border);
  border-radius: 16px;
  padding:12px 12px;
  background:
    radial-gradient(220px 120px at 30% 20%, rgba(79,140,255,.10), transparent 60%),
    rgba(255,255,255,.04);
  color: var(--text);
  text-align:left;
  cursor:pointer;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.cal-cell:hover{
  transform: translateY(-1px);
  background:
    radial-gradient(220px 120px at 30% 20%, rgba(79,140,255,.14), transparent 60%),
    rgba(255,255,255,.06);
}
.cal-cell.active{
  border-color: rgba(79,140,255,.55);
  box-shadow: 0 0 0 4px rgba(79,140,255,.12);
}

/* Make date text inside cells look nice */
.cal-cell::after{
  content:"";
  display:block;
  height:8px;
}

/* Day view panels spacing */
.cal-day .panel{
  margin-top:12px;
}

/* Note text area a bit taller on calendar */
#dayNote{
  min-height: 110px;
}

/* =========================
   Timeline (Day view)
   ========================= */

.cal-timeline{
  margin-top:12px;
}

/* Timeline wrapper: left hour gutter + block layer */
.cal-timeline .timelineWrap{
  position: relative;
  height: 780px; /* 24h view; slightly taller for readability */
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
  background:
    radial-gradient(800px 400px at 30% 10%, rgba(79,140,255,.10), transparent 60%),
    rgba(0,0,0,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

/* Hour gutter */
.cal-timeline .hours{
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width: 96px;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}

/* Each hour label row */
.cal-timeline .hour{
  height: calc(780px / 24);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  color: rgba(231,236,246,.82);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Grid lines in main area */
.cal-timeline .blockLayer{
  position:absolute;
  left: 96px;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 10px;              
  box-sizing: border-box;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,.05) 0px,
      rgba(255,255,255,.05) 1px,
      transparent 1px,
      transparent calc(780px / 24)
    );
}

/* Time block */
.cal-timeline .block{
  position:absolute;
  left: 0;                   
  right: auto;
  box-sizing: border-box;
  ...
}
.cal-timeline .block:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
}

/* Block text */
.cal-timeline .blockTitle{
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .2px;
}
.cal-timeline .blockMeta{
  font-size: 12px;
  opacity: .92;
  margin-top: 3px;
}

/* Make inputs row wrap nicely on mobile */
@media (max-width: 700px){
  .cal-grid{grid-template-columns:1fr}
  .cal-timeline .timelineWrap{height: 720px;}
  .cal-timeline .hours{width: 86px;}
  .cal-timeline .blockLayer{left: 86px;}
}

/* Optional: button grouping on calendar header */
.cal-actions .btn{
  min-width: 86px;
}

/* Small helper styling for calendar page breadcrumbs + header */
#calendarRoot .panel h3{
  margin-top:0;
}

.card video, .card img{
  display:block;
}


.barwrap .barbg{
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  overflow: hidden;
}
.barwrap .barfill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34,197,94,.95), rgba(79,140,255,.75));
  transition: width .25s ease;
}

select {
  background-color: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}

select option {
  background-color: var(--panel);
  color: var(--text);
}

select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Games UI ---------- */

.ttt-grid{
  display:grid;
  grid-template-columns: repeat(3, 80px);
  gap:10px;
  margin:16px 0;
}
.ttt-cell{
  height:80px;
  font-size:36px;
  font-weight:800;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color:var(--text);
}
.ttt-cell:hover{ background: rgba(255,255,255,.12); }

.hidden{ display:none; }

/* fix dropdowns */
select, option{
  background: var(--panel);
  color: var(--text);
}

