/* =========================
   BASE / RESET
========================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: Arial, sans-serif; }

/* =========================
   BACKGROUND + MAIN WRAP
========================= */
.page {
  min-height: 100vh;
  background: url('img/bg1.jpg') center center no-repeat;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
}

.container {
  width: 920px;
  max-width: 100%;
  min-height: 600px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 20px;
  padding: 34px;
  color: #ffffff;
}

/* =========================
   MAIN TITLES
========================= */
h1 { text-align: center; margin-bottom: 16px; font-size: 32px; }

.main-title{ text-align:center; margin-bottom:6px; }
.main-subtitle{ text-align:center; opacity:.85; margin-bottom:14px; }

/* =========================
   HERO HEADER (INDEX)
========================= */
.hero{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  margin-bottom: 14px;
}

.hero-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.10);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  opacity: .95;
  margin-bottom: 10px;
}

.hero-title{
  font-weight: 900;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.6px;
  text-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.hero-subtitle{
  margin-top: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .25px;
  opacity: .88;
}

.hero::after{
  content:"";
  width: 220px;
  height: 1px;
  background: rgba(255,255,255,0.18);
  margin-top: 14px;
}

/* =========================
   ADMIN BUTTON CENTER (INDEX)
========================= */
.admin-center-box{
  display:flex;
  justify-content:center;
  margin-bottom:26px;
}
.admin-center-btn{
  padding: 10px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.35);
  color:#fff;
  text-decoration:none;
  font-weight:800;
  font-size:14px;
  letter-spacing:.2px;
  transition:.25s ease;
}
.admin-center-btn:hover{
  background: rgba(255,255,255,0.18);
  transform: translateY(-2px);
}

/* =========================
   CIRCLES (CARDS) — базовый вид
========================= */
.circles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.circle-card {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px;
  min-height: 135px;
  text-decoration: none;
  color: #ffffff;
  transition: 0.25s ease;
}
.circle-card:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-5px);
}
.circle-card h2 {
  font-size: 20px;
  margin-bottom: 10px;
}
.circle-card p {
  opacity: 0.88;
  margin-bottom: 6px;
  font-size: 14px;
}

/* groups time on card */
.group-times{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.18);
  display:flex;
  flex-direction:column;
  gap:6px;
}
.group-time-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-weight: 800;
  font-size: 13px;
}
.muted{ opacity:.7; }

/* =========================
   TOPBAR (circle/admin pages)
========================= */
.topbar{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:14px;
}
.back-link{
  color:#fff;
  text-decoration:none;
  opacity:.9;
  font-weight: 700;
}
.back-link:hover{ opacity:1; text-decoration:underline; }

.page-title{
  margin:0;
  font-size:26px;
  text-align:left;
  flex:1;
}

.top-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.role-badge{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.12);
  font-weight: 900;
  font-size: 12px;
}

.link-btn{
  display:inline-block;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.10);
  color:#fff;
  text-decoration:none;
  font-weight: 900;
  font-size: 12px;
  transition: .2s ease;
}
.link-btn:hover{
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

/* =========================
   NOTE BOX
========================= */
.note{
  background: rgba(255,255,255,0.12);
  padding: 14px 16px;
  border-radius: 14px;
  margin-top: 10px;
}

/* =========================
   FILTER BAR (class/group/search)
========================= */
.filterbar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin: 12px 0 16px 0;
}

.filter-label{
  font-weight: 900;
  opacity: .9;
}

.filter-select{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(0,0,0,0.25);
  color:#fff;
  font-weight: 800;
  outline:none;
  min-width: 160px;
}

.filter-input{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(0,0,0,0.25);
  color:#fff;
  font-weight: 800;
  outline:none;
  min-width: 200px;
}
.filter-input::placeholder{
  color: rgba(255,255,255,0.60);
  font-weight: 700;
}

.filter-btn{
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.12);
  color:#fff;
  font-weight: 900;
  cursor:pointer;
  transition: .2s ease;
}
.filter-btn:hover{
  background: rgba(255,255,255,0.20);
}

.filter-info{
  margin-left:auto;
  opacity:.85;
  font-weight: 800;
}

/* =========================
   MONTH TABS
========================= */
.months-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 10px 0 14px 0;
}

.month-tab{
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.10);
  color:#fff;
  padding: 8px 14px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 900;
  transition: .2s ease;
}
.month-tab:hover{ background: rgba(255,255,255,0.18); }
.month-tab.active{
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.45);
}

.month-panel{ display:none; }
.month-panel.active{ display:block; }

/* =========================
   TABLE WRAP + JOURNAL
========================= */
.table-wrap{
  width: 100%;
  overflow:auto;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  padding: 10px;
}

.journal{
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow:hidden;
}

.journal th, .journal td{
  border-bottom: 1px solid rgba(255,255,255,0.14);
  padding: 10px 10px;
  vertical-align: middle;
}

.journal thead th{
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(6px);
  z-index: 2;
  text-align:center;
  font-weight: 900;
}

.col-student{
  text-align:left !important;
  min-width: 300px;
}

.student-cell{
  text-align:left;
}

.student-name{
  font-weight: 900;
}

.student-class{
  opacity:.8;
  font-size: 12px;
  margin-top: 2px;
}

.col-date{ width: 70px; }

.mark-cell{
  text-align:center;
  font-size: 18px;
}

/* guest cell view */
.cell-view{
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:center;
}
.cell-mark{
  font-size: 18px;
  line-height: 1;
}
.cell-status-row{
  display:flex;
  gap:6px;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  opacity:.95;
}
.cell-status-text{
  font-weight: 900;
  font-size: 11px;
  opacity:.9;
}

/* teacher edit selects inside cells */
.mini-select{
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(0,0,0,0.25);
  color:#fff;
  font-weight: 900;
  outline:none;
  width: 100%;
  margin-bottom: 6px;
}
.cell-edit .mini-select:last-of-type{ margin-bottom: 0; }

/* save state */
.save-state{
  height: 16px;
  font-size: 12px;
  margin-top: 4px;
  opacity:.95;
  text-align:center;
}
.save-state.saving{ opacity:.85; }
.save-state.ok{ opacity:1; }
.save-state.err{ opacity:1; }

/* =========================
   STUDENT HEAD + GROUP SELECT/BADGE
========================= */
.student-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.student-group-edit{
  display:flex;
  align-items:center;
  gap:8px;
}

.student-group-badge{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.10);
  font-weight: 900;
  font-size: 12px;
  opacity: .95;
  white-space: nowrap;
}

.group-state{
  width: 18px;
  text-align:center;
  opacity:.95;
}

.student-group-edit .mini-select{
  min-width: 170px;
  margin-bottom: 0;
}

/* =========================
   ONLY ATTENDANCE MODE (guest)
========================= */
.only-attendance .cell-mark{ display:none; }
.only-attendance .cell-view{ gap: 0; }

/* =========================
   LEGEND
========================= */
.legend{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  margin-top: 10px;
  opacity:.95;
}
.legend .muted{ opacity:.75; }

/* =========================
   AUTH (LOGIN PAGES)
========================= */
.auth{
  width: 100%;
  display:flex;
  justify-content:center;
  align-items:center;
  min-height: 520px;
}

.auth-card{
  width: 420px;
  max-width: 100%;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.auth-head{
  text-align:center;
  margin-bottom: 16px;
}
.auth-badge{
  display:inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.10);
  font-weight: 900;
  margin-bottom: 10px;
}
.auth-subtitle{
  opacity:.85;
  margin-bottom: 10px;
  font-weight: 700;
}
.auth-title{
  font-size: 22px;
  margin-bottom: 6px;
}

.auth-alert{
  background: rgba(255,0,0,0.12);
  border: 1px solid rgba(255,0,0,0.25);
  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-weight: 800;
}

.auth-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.auth-label span{
  display:block;
  font-weight: 900;
  margin-bottom: 6px;
  color:#fff;
}

.auth-input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(0,0,0,0.25);
  color:#fff;
  font-weight: 900;
  outline:none;
}

.auth-btn{
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.12);
  color:#fff;
  font-weight: 900;
  cursor:pointer;
  transition: .2s ease;
}
.auth-btn:hover{
  background: rgba(255,255,255,0.20);
  transform: translateY(-1px);
}

.auth-footer{
  margin-top: 12px;
  text-align:center;
}
.auth-link{
  color:#fff;
  opacity:.85;
  text-decoration:none;
  font-weight: 800;
}
.auth-link:hover{ opacity:1; text-decoration:underline; }

/* =========================
   ADMIN FORMS
========================= */
.admin-form{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.admin-form .auth-input{
  min-width: 220px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 980px){
  .container{ padding: 24px; width: 860px; }
  .circles{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px){
  .page{ padding: 18px; }
  .container{ padding: 18px; }
  .circles{ grid-template-columns: 1fr; }
  .journal{ min-width: 780px; }
  .filter-info{ margin-left:0; width:100%; }
  .topbar{ flex-wrap:wrap; }
  .hero-title{ font-size: 34px; }
  .hero-subtitle{ font-size: 13px; }
  .hero::after{ width: 180px; }
}

/* =====================================================
   ГЛАВНАЯ СТРАНИЦА: правим только главную, остальное не трогаем
   1) Фон без "темных зон" (никаких оверлеев)
   2) Боковые картинки видно за счет padding + более узкого контейнера
   3) Текст карточек центрируем только на главной
===================================================== */

/* Больше воздуха по бокам на главной */
.page.home{
  padding-left: 80px;
  padding-right: 80px;
}

/* Контейнер только на главной чуть уже */
.page.home > .container{
  width: 820px;
  max-width: 820px;
}

/* Центрируем контент карточек только на главной */
.page.home .circle-card{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}

/* Заголовок меньше только на главной */
.page.home .circle-card h2{
  font-size: 16px;
  margin-bottom: 6px;
  font-weight: 800;
}

/* Текст меньше только на главной */
.page.home .circle-card p{
  font-size: 12px;
  margin-bottom: 4px;
  text-align: center;
}

/* Группы по центру только на главной */
.page.home .group-times{ align-items:center; }
.page.home .group-time-row{
  justify-content:center;
  gap:6px;
  font-size:11px;
}
