:root{
  --bg:#08111f; --card:#111c31; --card2:#17253f; --accent:#38bdf8;
  --ok:#22c55e; --warn:#f97316; --danger:#ef4444; --text:#eef4ff; --muted:#9fb2c8;
  --border:#223454;
}
*{box-sizing:border-box; font-family:Inter,Segoe UI,Arial,sans-serif}
body{margin:0; background:linear-gradient(135deg,#08111f,#111827); color:var(--text); min-height:100vh}
a{color:var(--accent); text-decoration:none}
h1,h2,h3{margin:0 0 10px}
small{color:var(--muted)}

/* Top nav */
.topnav{display:flex; align-items:center; justify-content:space-between; padding:14px 20px;
  background:rgba(17,28,49,.9); backdrop-filter:blur(6px); position:sticky; top:0; z-index:50;
  border-bottom:1px solid var(--border); flex-wrap:wrap; gap:10px}
.topnav .brand{font-weight:800; font-size:20px; display:flex; align-items:center; gap:8px}
.topnav nav{display:flex; gap:16px; flex-wrap:wrap}
.topnav nav a{color:var(--muted); font-weight:600; padding:6px 10px; border-radius:8px}
.topnav nav a.active, .topnav nav a:hover{color:var(--text); background:var(--card2)}
.topnav .user-chip{display:flex; align-items:center; gap:10px; font-size:14px; color:var(--muted); flex-wrap:wrap}

.wrap{max-width:1400px; margin:auto; padding:20px; display:grid; grid-template-columns:2fr 1fr; gap:18px}
.wrap.single{grid-template-columns:1fr}
.card{background:rgba(17,28,49,.95); border-radius:18px; padding:18px; box-shadow:0 10px 30px rgba(0,0,0,.35); margin-bottom:18px}

.task{display:flex; gap:12px; align-items:center; padding:12px; border-radius:12px; background:var(--card2); margin:8px 0; flex-wrap:wrap}
.time{width:130px; color:#fbbf24; font-weight:700; flex-shrink:0}

input[type=text], input[type=email], input[type=password], input[type=number], textarea, select{
  width:100%; padding:10px; border-radius:10px; border:1px solid var(--border); background:#223454; color:#fff; font-size:15px}
textarea{min-height:80px; resize:vertical}
label{font-size:13px; color:var(--muted); display:block; margin-bottom:4px}
button, .btn{padding:10px 16px; border:none; border-radius:10px; background:var(--accent); font-weight:700; cursor:pointer; color:#001018; font-size:14px}
button.secondary, .btn.secondary{background:var(--card2); color:var(--text); border:1px solid var(--border)}
button.danger, .btn.danger{background:var(--danger); color:#fff}
button:disabled{opacity:.5; cursor:not-allowed}
.btn-row{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}

.progress{height:14px; background:#24344d; border-radius:999px; overflow:hidden; margin-top:10px}
.bar{height:100%; width:0; background:linear-gradient(90deg,#22c55e,#38bdf8); transition:width .3s}

.kpi{display:grid; grid-template-columns:repeat(2,1fr); gap:10px}
.stat-row{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; text-align:center}
.stat{background:var(--card2); border-radius:12px; padding:14px}
.stat .num{font-size:28px; font-weight:800; color:var(--accent)}
.stat .lbl{font-size:12px; color:var(--muted)}

.motivation{background:linear-gradient(90deg,rgba(56,189,248,.15),rgba(34,197,94,.15)); border:1px solid var(--border); padding:14px 18px; border-radius:14px; font-weight:600; font-style:italic}

.badge{display:inline-block; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:700}
.badge.admin{background:#f97316; color:#1a0d00}
.badge.user{background:#38bdf8; color:#001018}
.badge.active{background:#22c55e; color:#001a08}
.badge.disabled{background:#ef4444; color:#2a0000}

table{width:100%; border-collapse:collapse; font-size:14px}
th,td{padding:10px; text-align:left; border-bottom:1px solid var(--border)}
th{color:var(--muted); font-size:12px; text-transform:uppercase}
tr:hover td{background:rgba(255,255,255,.02)}

.alert{padding:12px 16px; border-radius:10px; margin-bottom:14px; font-weight:600}
.alert.error{background:rgba(239,68,68,.15); border:1px solid var(--danger); color:#fecaca}
.alert.success{background:rgba(34,197,94,.15); border:1px solid var(--ok); color:#bbf7d0}

/* Calendar */
.cal-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; flex-wrap:wrap; gap:8px}
.cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:6px}
.cal-dow{text-align:center; font-size:12px; color:var(--muted); padding:4px}
.cal-cell{aspect-ratio:1; border-radius:10px; display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:13px; font-weight:700; cursor:default; position:relative; border:1px solid rgba(255,255,255,.05)}
.cal-cell.empty{background:transparent; border:none}
.cal-cell .pct{font-size:10px; font-weight:500; opacity:.85}
.cal-cell.today{outline:2px solid #fff}
.cal-legend{display:flex; gap:12px; flex-wrap:wrap; margin-top:12px; font-size:12px; color:var(--muted)}
.cal-legend span{display:inline-flex; align-items:center; gap:6px}
.swatch{width:12px; height:12px; border-radius:3px; display:inline-block}

.timer-display{font-size:48px; text-align:center; font-weight:800}

@media(max-width:900px){
  .wrap{grid-template-columns:1fr}
  .time{width:100px; font-size:12px}
  .topnav{flex-direction:column; align-items:flex-start}
}
@media(max-width:480px){
  .kpi{grid-template-columns:1fr}
  .cal-cell{font-size:11px}
}
