:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#152033;
  --muted:#6f7b8f;
  --blue:#1976f3;
  --blue2:#0d63d9;
  --green:#13a66b;
  --red:#d84444;
  --border:#e3e9f2;
  --shadow:0 12px 35px rgba(28,46,77,.09);
}

*{box-sizing:border-box}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}

.topbar{
  min-height:68px;
  background:#fff;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 max(20px,calc((100vw - 1100px)/2));
  position:sticky;
  top:0;
  z-index:5;
}

.brand{
  font-size:20px;
  font-weight:850;
  text-decoration:none;
  color:#0e1d33;
}

.brand span{color:var(--blue)}

nav{
  display:flex;
  gap:18px;
  align-items:center;
}

nav a,.linkbtn{
  color:#41516a;
  text-decoration:none;
  border:0;
  background:none;
  font:inherit;
  cursor:pointer;
}

.inline{display:inline;margin:0}

.wrap{
  max-width:1100px;
  margin:34px auto;
  padding:0 18px 50px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:var(--shadow);
}

.auth,.narrow{
  max-width:460px;
  margin:50px auto;
  padding:32px;
}

.auth h1,.narrow h1{margin:8px 0}
.icon{font-size:34px}
.muted{color:var(--muted);margin-top:5px}

label{
  display:block;
  font-weight:650;
  margin:18px 0 7px;
}

input{
  width:100%;
  font:inherit;
  padding:13px 14px;
  border:1px solid #ccd5e2;
  border-radius:11px;
  outline:none;
  background:#fff;
}

input:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(25,118,243,.12);
}

button,.button,.fullbtn{font:inherit}

.primary{
  background:var(--blue);
  border:0;
  color:#fff;
  border-radius:11px;
  padding:13px 18px;
  font-weight:750;
  text-decoration:none;
  cursor:pointer;
}

.primary:hover{background:var(--blue2)}

.full{
  width:100%;
  margin-top:22px;
}

.fullbtn{
  display:block;
  text-align:center;
  margin-top:12px;
}

.secondary{
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  padding:9px 12px;
  color:#425169;
  text-decoration:none;
  cursor:pointer;
}

.flash{
  max-width:700px;
  margin:0 auto 16px;
  padding:12px 15px;
  border-radius:12px;
}

.flash.error{background:#fff0f0;color:#a52d2d}
.flash.success{background:#eafaf3;color:#08764a}

.pagehead{
  display:flex;
  align-items:end;
  justify-content:space-between;
  margin-bottom:20px;
}

.pagehead h1{margin:4px 0}
.split{gap:20px}

.back{
  color:var(--blue);
  text-decoration:none;
  font-weight:650;
}

.calendar{
  max-width:720px;
  margin:auto;
  padding:25px;
}

.cal-head{
  display:grid;
  grid-template-columns:45px 1fr 45px;
  align-items:center;
  text-align:center;
}

.cal-head h2{margin:0}

.round{
  display:grid;
  place-items:center;
  height:40px;
  width:40px;
  border-radius:50%;
  text-decoration:none;
  background:#eef4ff;
  color:var(--blue);
  font-size:28px;
}

.weekdays,.days{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
}

.weekdays{
  margin:24px 0 8px;
  color:var(--muted);
  text-align:center;
  font-size:13px;
  font-weight:700;
}

.day{
  aspect-ratio:1/1;
  display:grid;
  place-items:center;
  border-radius:14px;
  text-decoration:none;
  font-weight:700;
}

.past,.outside{
  color:#bac2ce;
  background:#f4f5f7;
}

.outside{opacity:.45}

.future{
  background:#edf5ff;
  color:var(--blue);
}

.future:hover{background:#dcecff}

.today{
  background:#16b67a;
  color:#fff;
  box-shadow:0 8px 20px rgba(22,182,122,.25);
}

.legend{
  display:flex;
  justify-content:center;
  gap:18px;
  margin-top:22px;
  color:var(--muted);
  font-size:13px;
}

.dot{
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  margin-right:5px;
}

.todaydot{background:#16b67a}
.futuredot{background:var(--blue)}
.pastdot{background:#cbd2dc}

.class-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(270px,1fr));
  gap:20px;
}

.class-card{
  background:#fff;
  border-radius:20px;
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
}

.class-img{
  width:100%;
  height:190px;
  object-fit:cover;
  background:#e8edf5;
}

.placeholder{
  display:grid;
  place-items:center;
  font-size:50px;
}

.class-body{padding:18px}
.class-body h2{margin:0 0 16px}

.sessions{
  display:flex;
  gap:11px;
  flex-wrap:wrap;
}

.session-choice{text-align:center}

.session-choice small{
  display:block;
  margin-top:6px;
  color:var(--muted);
}

.time-btn{
  display:block;
  padding:11px 15px;
  background:var(--blue);
  color:#fff;
  text-decoration:none;
  border-radius:11px;
  font-weight:800;
}

.time-btn.disabled{
  background:#dfe4eb;
  color:#8994a4;
}

.fulltext{color:var(--red)!important}

.summary{
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:18px;
  background:#f5f8fc;
  border-radius:14px;
  margin:20px 0;
}

.summary strong{font-size:21px}

.status-ok{
  background:#e9faf3;
  color:#08764a;
  padding:12px;
  border-radius:11px;
  margin:15px 0;
}

.tiny{
  font-size:12px;
  color:var(--muted);
  line-height:1.5;
}

.bigcheck{
  width:70px;
  height:70px;
  border-radius:50%;
  background:#16b67a;
  color:#fff;
  display:grid;
  place-items:center;
  font-size:40px;
  font-weight:900;
  margin:auto;
}

.success-card{text-align:center}

.reservation{
  background:#eef4ff;
  padding:12px;
  border-radius:10px;
}

.user-list{display:grid;gap:12px}

.user-row{
  padding:18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
}

.user-row div:first-child{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.user-row span{color:var(--muted)}

.user-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.badge{
  font-size:12px;
  padding:6px 9px;
  border-radius:20px;
}

.badge.on{
  background:#e8faf2;
  color:#08764a;
}

.badge.off{
  background:#f1f2f4;
  color:#768094;
}

.empty{
  padding:30px;
  text-align:center;
}

@media(max-width:650px){
  .topbar{
    height:auto;
    padding:12px 16px;
    align-items:flex-start;
  }

  .topbar nav{
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
    font-size:13px;
  }

  .wrap{margin-top:22px}
  .calendar{padding:16px}
  .day{border-radius:10px}
  .legend{gap:8px;flex-wrap:wrap}
  .class-grid{grid-template-columns:1fr}
  .class-img{height:180px}

  .pagehead.split{
    align-items:flex-start;
    flex-direction:column;
  }

  .user-row{
    align-items:flex-start;
    flex-direction:column;
  }

  .auth,.narrow{
    margin:24px auto;
    padding:24px;
  }
}

.notice{
  background:#fff6dd;
  border:1px solid #f1d47d;
  color:#755a0a;
  padding:14px;
  border-radius:12px;
  line-height:1.5;
}
.remember{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:500;
  margin-top:14px;
}
.remember input{
  width:auto;
  margin:0;
}
.badge.pending{background:#fff4d6;color:#7a5b00}
.badge.processing{background:#e9f2ff;color:#145bb7}
.badge.success{background:#e8faf2;color:#08764a}
.badge.failed{background:#fff0f0;color:#a52d2d}
.badge.cancelled{background:#f1f2f4;color:#768094}

.user-main{min-width:220px}
.user-actions{flex-wrap:wrap;justify-content:flex-end}
.danger-outline{
  background:#fff;
  border:1px solid #e49a9a;
  color:#b52e2e;
  border-radius:10px;
  padding:9px 12px;
  cursor:pointer;
  font-weight:700;
}
.danger-outline:hover{
  background:#fff1f1;
}
@media(max-width:650px){
  .user-actions{
    width:100%;
    justify-content:flex-start;
  }
  .user-actions form{
    width:100%;
  }
  .user-actions button{
    width:100%;
  }
}

.reservation-admin{
  padding:18px;
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(260px,2fr) auto;
  gap:18px;
  align-items:center;
}
.reservation-user,
.reservation-info{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.reservation-user span,
.reservation-info span,
.reservation-info small{
  color:var(--muted);
}
.reservation-state{
  display:flex;
  justify-content:flex-end;
}
@media(max-width:760px){
  .reservation-admin{
    grid-template-columns:1fr;
  }
  .reservation-state{
    justify-content:flex-start;
  }
}

.radio-layout{
  display:grid;
  grid-template-columns:minmax(280px,360px) 1fr;
  gap:20px;
  align-items:start;
}
.radio-player{
  padding:22px;
  position:sticky;
  top:88px;
}
.radio-now{
  display:flex;
  gap:16px;
  align-items:center;
  margin-bottom:18px;
}
.radio-logo{
  width:84px;
  height:84px;
  border-radius:20px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:900;
  text-align:center;
  padding:8px;
  box-shadow:var(--shadow);
}
.radio-logo span,
.radio-card-logo span{
  display:block;
  font-size:15px;
  line-height:1.1;
  word-break:break-word;
}
.radio-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
  flex-wrap:wrap;
}
.radio-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:16px;
}
.radio-card{
  padding:14px;
  display:flex;
  align-items:center;
  gap:14px;
  cursor:pointer;
  text-align:left;
  background:#fff;
}
.radio-card.active{
  outline:3px solid rgba(25,118,243,.22);
  transform:translateY(-1px);
}
.radio-card-logo{
  width:64px;
  height:64px;
  border-radius:16px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:900;
  text-align:center;
  padding:7px;
  flex:0 0 64px;
}
.radio-card-text{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.radio-card-text small{color:var(--muted)}
.theme-red .radio-card-logo,.theme-red.radio-logo{background:#df2d3a}
.theme-purple .radio-card-logo,.theme-purple.radio-logo{background:#6c3ef0}
.theme-dark .radio-card-logo,.theme-dark.radio-logo{background:#222831}
.theme-gold .radio-card-logo,.theme-gold.radio-logo{background:#d49b17}
.theme-green .radio-card-logo,.theme-green.radio-logo{background:#17a56b}
.theme-orange .radio-card-logo,.theme-orange.radio-logo{background:#e67d22}
.theme-pink .radio-card-logo,.theme-pink.radio-logo{background:#d8477e}
.theme-cyan .radio-card-logo,.theme-cyan.radio-logo{background:#1da9a6}
.theme-teal .radio-card-logo,.theme-teal.radio-logo{background:#108890}
.theme-blue .radio-card-logo,.theme-blue.radio-logo{background:#2666d6}
.theme-rock .radio-card-logo,.theme-rock.radio-logo{background:#4f5665}
@media(max-width:860px){
  .radio-layout{grid-template-columns:1fr}
  .radio-player{position:static}
}

.password-help{
  margin:10px 0 16px;
  padding:11px 13px;
  border-radius:10px;
  background:#f5f8fc;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

body.has-radio-player .wrap{
  padding-bottom:125px;
}
.global-radio-player{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:14px;
  width:min(760px,calc(100% - 24px));
  min-height:78px;
  z-index:1000;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(15px);
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:0 15px 45px rgba(20,35,60,.22);
  padding:10px 44px 10px 11px;
  display:grid;
  grid-template-columns:58px minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
}
.global-radio-player.hidden{
  display:none;
}
.global-radio-logo{
  width:58px;
  height:58px;
  border:0;
  border-radius:15px;
  display:grid;
  place-items:center;
  color:#fff;
  cursor:pointer;
  font-weight:900;
  padding:6px;
}
.global-radio-logo span{
  font-size:12px;
  text-align:center;
  line-height:1.05;
  overflow-wrap:anywhere;
}
.global-radio-info{
  min-width:0;
  display:flex;
  flex-direction:column;
}
.global-radio-info strong{
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.global-radio-info small{
  color:var(--muted);
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.global-radio-controls{
  display:flex;
  gap:7px;
  align-items:center;
}
.radio-control{
  width:42px;
  height:42px;
  border:1px solid var(--border);
  background:#f5f8fc;
  border-radius:50%;
  cursor:pointer;
  color:var(--text);
  font-size:17px;
  display:grid;
  place-items:center;
}
.radio-control-main{
  width:48px;
  height:48px;
  background:var(--blue);
  color:#fff;
  border-color:var(--blue);
  font-size:18px;
}
.radio-close{
  position:absolute;
  right:10px;
  top:7px;
  border:0;
  background:transparent;
  color:#8390a3;
  font-size:25px;
  line-height:1;
  cursor:pointer;
}
.radio-help{
  margin-top:20px;
  padding:18px;
}
.radio-help p{
  margin-bottom:0;
}
@media(max-width:600px){
  body.has-radio-player .wrap{
    padding-bottom:115px;
  }
  .global-radio-player{
    bottom:8px;
    width:calc(100% - 14px);
    min-height:72px;
    padding:8px 34px 8px 8px;
    grid-template-columns:52px minmax(0,1fr) auto;
    gap:8px;
    border-radius:17px;
  }
  .global-radio-logo{
    width:52px;
    height:52px;
    border-radius:13px;
  }
  .global-radio-info strong{
    font-size:14px;
  }
  .global-radio-info small{
    font-size:11px;
  }
  .global-radio-controls{
    gap:4px;
  }
  .radio-control{
    width:36px;
    height:36px;
    font-size:14px;
  }
  .radio-control-main{
    width:40px;
    height:40px;
    font-size:15px;
  }
}
@media(max-width:410px){
  .global-radio-player{
    grid-template-columns:45px minmax(0,1fr) auto;
  }
  .global-radio-logo{
    width:45px;
    height:45px;
  }
  .radio-control{
    width:32px;
    height:32px;
  }
  .radio-control-main{
    width:36px;
    height:36px;
  }
}
