* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --mil-dark: #10150c;
  --mil-green: #1d2416;
  --mil-green2: #2a3620;
  --olive: #4a5d23;
  --olive-light: #6c8a34;
  --gold: #d4af37;
  --gold-dim: #b8922e;
  --khaki: #c2b280;
  --sand: #e8e0c8;
  --danger: #c0392b;
  --success: #58a946;
  --text: #eae4d0;
  --text-muted: #a89e7f;
  --border: #3a452a;
  --bg: #161d12;
  --card: #20281a;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(107, 138, 52, 0.18) 0, transparent 32%),
    radial-gradient(circle at 75% 65%, rgba(74, 93, 35, 0.22) 0, transparent 38%),
    radial-gradient(circle at 50% 90%, rgba(180, 150, 60, 0.08) 0, transparent 30%);
  background-attachment: fixed;
}

/* ------------------- LOGIN ------------------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background-image: url("/assets/banner.jpg");
  background-size: cover;
  background-position: center;
}
.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(11, 15, 8, 0.86), rgba(16, 22, 12, 0.72));
  z-index: 0;
}
.login-page::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(108, 138, 52, 0.25) 0, transparent 26%),
    radial-gradient(circle at 82% 28%, rgba(74, 93, 35, 0.3) 0, transparent 30%),
    radial-gradient(circle at 35% 78%, rgba(108, 138, 52, 0.2) 0, transparent 24%),
    radial-gradient(circle at 70% 85%, rgba(200, 170, 80, 0.12) 0, transparent 20%);
  z-index: 0;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 2;
  background: rgba(24, 31, 18, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 30px 70px rgba(0, 0, 0, 0.6);
  border-radius: 18px;
  padding: 42px 38px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: cardIn 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.insignia {
  position: relative;
  width: 226px;
  height: 226px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.insignia .logo-img {
  width: 208px;
  height: 208px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6));
  animation: emblemPulse 2.6s ease-in-out infinite;
}
@keyframes emblemPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.4)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.75)); }
}
.insignia::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.55);
  box-shadow: inset 0 0 24px rgba(212, 175, 55, 0.2);
}
.insignia::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 2px dashed rgba(212, 175, 55, 0.45);
  animation: spinSlow 14s linear infinite;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

.radar {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}
.radar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, rgba(212, 175, 55, 0.4), transparent 28%);
  animation: radarSweep 2.8s linear infinite;
}
@keyframes radarSweep { to { transform: rotate(360deg); } }

.login-card h1 {
  font-size: 26px;
  letter-spacing: 4px;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(180deg, #f5e6b8, #d4af37);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.welcome-title {
  font-size: clamp(21px, 4.6vw, 33px);
  line-height: 1.28;
  letter-spacing: 1px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 22px;
  background: linear-gradient(180deg, #f7e9b8, #d4af37 80%, #b8912b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 8px rgba(212, 175, 55, 0.35));
}
.login-card .club-type {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--khaki);
  margin: 2px 0 20px;
}
.login-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 22px; }

.form-group { text-align: left; margin-bottom: 15px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--khaki);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(10, 14, 8, 0.6);
  color: var(--text);
  transition: border 0.15s, box-shadow 0.15s, background 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(10, 14, 8, 0.85);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.form-group input::placeholder { color: #6f6a55; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.toggle-pass {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.toggle-pass:hover { color: var(--gold); background: rgba(255, 255, 255, 0.06); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: translateY(1px); }
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s;
}
.btn:hover::after { left: 130%; }

.btn-primary { background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border-color: #9a7b25; color: #1a1608; }
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 0 16px rgba(212, 175, 55, 0.35); }
.btn-success { background: linear-gradient(180deg, var(--success), #3f7d31); border-color: #2f5e24; color: #efffea; }
.btn-success:hover { filter: brightness(1.12); }
.btn-danger { background: linear-gradient(180deg, var(--danger), #8e2b20); border-color: #6f1f16; color: #fff; }
.btn-danger:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn-outline { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline:hover { background: rgba(212, 175, 55, 0.12); box-shadow: 0 0 10px rgba(212, 175, 55, 0.25); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; font-weight: 600; }
.btn-block { width: 100%; }

.alert-error {
  background: rgba(192, 57, 43, 0.18);
  color: #f37f70;
  border: 1px solid rgba(192, 57, 43, 0.5);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 15px;
  display: none;
}

/* ------------------- APP ------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  background: linear-gradient(180deg, #161d11 0%, #10150c 100%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  border-right: 1px solid rgba(212, 175, 55, 0.25);
  z-index: 20;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.brand-logo {
  width: 66px;
  height: 66px;
  object-fit: contain;
  border-radius: 16px;
  padding: 4px;
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.28), rgba(212, 175, 55, 0.06));
  border: 2px solid rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
  flex-shrink: 0;
  animation: logoGlow 3.2s ease-in-out infinite;
}
@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(212, 175, 55, 0.12); }
  50% { box-shadow: 0 0 28px rgba(212, 175, 55, 0.6), inset 0 0 16px rgba(212, 175, 55, 0.22); }
}
.sidebar-header h2 {
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.2;
}
.sidebar-header span { font-size: 11px; color: var(--text-muted); }

.nav { padding: 14px 10px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
  position: relative;
}
.nav-item:hover { background: rgba(212, 175, 55, 0.08); color: var(--text); }
.nav-item:hover svg {
  transform: scale(1.28) translateX(2px) rotate(-6deg);
  filter: drop-shadow(0 0 7px rgba(212, 175, 55, 0.8));
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.05));
  color: #f2e6b8;
  border-left: 3px solid var(--gold);
}
.nav-item.active svg { animation: iconPulse 2s ease-in-out infinite; }
@keyframes iconPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(212, 175, 55, 0)); }
  50% { transform: scale(1.16); filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.85)); }
}
.nav-item.active::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: blinkDot 1.6s ease-in-out infinite;
}
@keyframes blinkDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.nav-item svg { flex-shrink: 0; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s; }

.sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(212, 175, 55, 0.2); }
.user-info { font-size: 13px; margin-bottom: 8px; color: var(--text); font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: rgba(28, 36, 20, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 15;
  background-image: repeating-linear-gradient(45deg, rgba(212,175,55,0.03) 0 10px, transparent 10px 22px);
}
.topbar h1 {
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #f2e6b8;
}
.refresh-btn { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; border-color: rgba(212,175,55,0.3); font-size: 13px; }
.refresh-btn:hover { border-color: var(--gold); }
.refresh-btn:hover svg { animation: refreshSpin 0.9s linear infinite; }
@keyframes refreshSpin { to { transform: rotate(360deg); } }
.refresh-btn svg { transition: transform 0.3s; }

.clock-box {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.clock-box svg { color: var(--gold); flex-shrink: 0; }
.clock-box .clock-time { color: #f2e6b8; font-weight: 700; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
.clock-box .clock-date { color: var(--text-muted); }
.login-clock { justify-content: center; margin-top: 16px; }
.content { padding: 24px 28px; flex: 1; animation: pageIn 0.4s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------- CARDS / STATS ------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: linear-gradient(160deg, rgba(42, 54, 32, 0.85), rgba(26, 34, 19, 0.85));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
  animation: cardUp 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(212, 175, 55, 0.5); }
@keyframes cardUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--gold);
  opacity: 0.75;
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.stat-icon.blue { background: rgba(40, 90, 130, 0.35); color: #8ec9e8; }
.stat-icon.green { background: rgba(88, 169, 70, 0.25); color: #9ce08f; }
.stat-icon.red { background: rgba(192, 57, 43, 0.25); color: #f08a7c; }
.stat-icon.amber { background: rgba(212, 175, 55, 0.2); color: #e8d28a; }
.stat-icon.purple { background: rgba(120, 90, 160, 0.3); color: #c9a8f0; }
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; color: #f2e6b8; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.4px; }

/* ------------------- PANEL / TABLE ------------------- */
.panel {
  background: linear-gradient(160deg, rgba(40, 50, 28, 0.9), rgba(28, 36, 20, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
  animation: cardUp 0.4s ease;
}
.panel-header {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: repeating-linear-gradient(45deg, rgba(212,175,55,0.02) 0 8px, transparent 8px 18px);
}
.panel-header h3 { font-size: 15px; letter-spacing: 0.5px; text-transform: uppercase; color: #f2e6b8; }
.panel-body { padding: 16px 18px; }
.panel-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid rgba(58, 69, 42, 0.7); vertical-align: middle; }
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--khaki);
  background: rgba(10, 14, 8, 0.35);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(212, 175, 55, 0.05); }
td.actions { display: flex; gap: 6px; }

.table-wrap { overflow-x: auto; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--gold);
  font-size: 15px;
}
.student-cell { display: flex; align-items: center; gap: 10px; }
.student-cell .name { font-weight: 600; color: #f0ead6; }
.student-cell .sub { font-size: 12px; color: var(--text-muted); }

.name { font-weight: 600; }
.sub { font-size: 12px; color: var(--text-muted); }

/* ------------------- PROFIL KARTASI ------------------- */
.profile-card { display: flex; align-items: center; gap: 16px; padding: 18px; flex-wrap: wrap; }
.profile-avatar { flex-shrink: 0; }
.profile-info h3 { margin: 0 0 4px; }
.profile-info .sub { margin-bottom: 2px; }
.profile-actions { margin-left: auto; }

.health-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid rgba(212,175,55,0.12); }
.health-row:last-child { border-bottom: none; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-green { background: rgba(88, 169, 70, 0.2); color: #9ce08f; border: 1px solid rgba(88,169,70,0.4); }
.badge-red { background: rgba(192, 57, 43, 0.2); color: #f59588; border: 1px solid rgba(192,57,43,0.4); }
.badge-amber { background: rgba(212, 175, 55, 0.18); color: #e8d28a; border: 1px solid rgba(212,175,55,0.4); }
.badge-blue { background: rgba(40, 90, 130, 0.25); color: #9ccfe8; border: 1px solid rgba(69,140,190,0.4); }
.badge-purple { background: rgba(120, 90, 160, 0.25); color: #cdb0ec; border: 1px solid rgba(140,110,180,0.4); }

/* ------------------- MODAL ------------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 10, 6, 0.72);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(170deg, #262f1b, #1a2113);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.6px; color: #f2e6b8; }
.modal-close {
  background: transparent; border: none; font-size: 24px; cursor: pointer;
  color: var(--text-muted); line-height: 1; padding: 4px;
}
.modal-close:hover { color: #f59588; }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 15px 22px;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  display: flex; justify-content: flex-end; gap: 10px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.muted { color: var(--text-muted); font-size: 13px; }

.hint {
  background: rgba(212, 175, 55, 0.1);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  color: #dfd3a6;
  margin-bottom: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state svg { opacity: 0.4; margin-bottom: 12px; }
.empty-state h4 { color: var(--text); margin-bottom: 4px; }

/* ------------------- TOOLBAR / SWITCH ------------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input.date-pick, .toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(10, 14, 8, 0.6);
  color: var(--text);
}
.toolbar select option { background: #1a2113; }
.toolbar input.date-pick:focus, .toolbar select:focus { outline: none; border-color: var(--gold); }

.switch-cell { text-align: center; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--danger);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.slider:before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider:before { transform: translateX(20px); }

.pay-status { font-size: 13px; font-weight: 600; }
.pay-status.ok { color: #9ce08f; }
.pay-status.no { color: #f59588; }

/* ------------------- PARENT HERO ------------------- */
.parent-hero {
  border-radius: 16px;
  padding: 26px;
  background: linear-gradient(135deg, #2a3620, #141a10);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  animation: cardUp 0.5s ease;
}
.parent-hero::before {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22), transparent 70%);
}
.parent-hero .avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold);
  font-size: 32px;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.4);
}
.parent-hero h2 { font-size: 21px; letter-spacing: 0.5px; text-transform: uppercase; }
.parent-hero .meta { font-size: 14px; opacity: 0.85; margin-top: 4px; color: var(--khaki); }

.avg-circle {
  width: 92px; height: 92px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #f5e6b8, var(--gold));
  color: #1a1608;
  font-weight: 800; font-size: 24px;
  margin-left: auto;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.4);
}
.avg-circle span { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #3a3212; }

.empty-note { color: var(--text-muted); font-size: 14px; }

/* ------------------- PROGRESS ------------------- */
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress {
  flex: 1; height: 8px;
  background: rgba(10, 14, 8, 0.6);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.2);
}
.progress > div { height: 100%; border-radius: 999px; transition: width 0.6s ease; }

/* Marni temadagi small detail */
.tactical-strip {
  height: 4px;
  background: repeating-linear-gradient(90deg, #d4af37 0 14px, #1d2416 14px 28px);
}

/* ------------------- MODAL: title/actions ------------------- */
.modal-title {
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #f2e6b8;
  margin-bottom: 14px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.cred-card {
  background: rgba(212, 175, 55, 0.08);
  border: 1px dashed rgba(212, 175, 55, 0.45);
  border-radius: 12px;
  padding: 14px;
}
.cred-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.cred-row span { color: var(--text-muted); font-weight: 600; }
.cred-row code {
  background: #0c1009; border: 1px solid rgba(212, 175, 55, 0.3); color: #f2e6b8;
  padding: 6px 10px; border-radius: 8px; font-size: 14px;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid rgba(212, 175, 55, 0.35); border-radius: 999px;
  font-size: 13px; cursor: pointer; background: rgba(212, 175, 55, 0.06); color: var(--text);
}
.chip:has(input:checked) { background: rgba(212, 175, 55, 0.22); border-color: var(--gold); }
.chip input { accent-color: var(--gold); }
.badge-gold { background: linear-gradient(135deg, #f2e6b8, #d4af37); color: #1a2113; font-weight: 700; border: none; }
.score-input, .test-score {
  width: 84px; padding: 8px 10px; font-size: 16px; font-weight: 700; text-align: center;
  border-radius: 8px; border: 1px solid rgba(212, 175, 55, 0.35); background: #0c1009; color: var(--text);
}
.score-input:focus, .test-score:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18); }

/* ------------------- KONTAKT ------------------- */
.contact-links { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.contact-link {
  display: inline-flex; align-items: center; gap: 8px; color: var(--gold);
  font-size: 13px; text-decoration: none; font-weight: 600; padding: 3px 0;
}
.contact-link:hover { text-decoration: underline; }
.contact-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.contact-strip {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(212, 175, 55, 0.06);
  font-size: 14px;
}
.contact-strip .contact-link { font-size: 14px; }

/* ------------------- JURNAL (o'qituvchi) ------------------- */
.journal-wrap { overflow-x: auto; }
.journal { border-collapse: separate; border-spacing: 0; min-width: 640px; }
.journal .jname {
  position: sticky; left: 0; z-index: 2;
  background: #1a2113;
  border-right: 1px solid rgba(212, 175, 55, 0.35);
  padding: 8px 12px; font-size: 13px; min-width: 150px;
}
.journal th.jname { background: #202a16; }
.journal .jhead {
  padding: 6px 2px; font-size: 11px; color: var(--text-muted);
  border: 1px solid rgba(212, 175, 55, 0.15); min-width: 34px; text-align: center;
}
.journal .jhead .jday { font-size: 12px; color: var(--text); font-weight: 700; }
.journal td { border-bottom: 1px solid rgba(212, 175, 55, 0.12); padding: 4px 2px; text-align: center; }
.jcell {
  width: 32px; height: 32px; min-width: 32px; border-radius: 8px; border: none;
  cursor: pointer; font-weight: 700; font-size: 15px; background: #0c1009; color: var(--text-muted);
}
.jcell:hover { background: rgba(212, 175, 55, 0.18); }
.jcell.s5 { background: rgba(88, 169, 70, 0.85); color: #0b1f0b; }
.jcell.s4 { background: rgba(88, 169, 70, 0.55); color: #0b1f0b; }
.jcell.s3 { background: rgba(212, 175, 55, 0.6); color: #1a2113; }
.jcell.s2 { background: rgba(192, 57, 43, 0.55); color: #fff; }
.jcell.s1 { background: rgba(192, 57, 43, 0.82); color: #fff; }
.javg { padding: 8px; text-align: center; font-weight: 700; color: var(--gold); border-left: 1px solid rgba(212, 175, 55, 0.25); }
.javghead { border-left: 1px solid rgba(212, 175, 55, 0.35) !important; }

/* ------------------- KUNDALIK (ota-ona) ------------------- */
.diary-body { display: flex; flex-direction: column; gap: 8px; }
.diary-entry { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(212, 175, 55, 0.15); border-radius: 10px; }
.diary-subj { font-weight: 600; font-size: 14px; }
.diary-score { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 800; font-size: 15px; background: rgba(88, 169, 70, 0.25); color: #9ce08f; }
.diary-score.a { background: rgba(212, 175, 55, 0.25); color: #e8d28a; }
.diary-score.r { background: rgba(192, 57, 43, 0.25); color: #f59588; }

@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes radarSweep { to { transform: rotate(360deg); } }

button, .nav-item { -webkit-tap-highlight-color: transparent; }

@media (max-width: 900px) {
  /* Pastki (mobil) navigatsiya paneli */
  .app { display: block; }
  body { background-attachment: scroll; }
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    left: 0;
    top: auto;
    bottom: 0;
    flex-direction: row;
    align-items: stretch;
    border-right: none;
    border-top: 1px solid rgba(212, 175, 55, 0.45);
    background: rgba(13, 17, 10, 0.96);
    backdrop-filter: blur(10px);
    z-index: 60;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  }
  .sidebar-header { display: none; }
  .nav {
    flex-direction: row;
    overflow-x: auto;
    align-items: stretch;
    gap: 2px;
    padding: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 66px;
    padding: 7px 10px;
    font-size: 10px !important;
    text-align: center;
    border-left: none !important;
    border-radius: 10px;
  }
  .nav-item svg { width: 21px; height: 21px; }
  .nav-item span.text { display: block; }
  .nav-item.active { border-left: none; }
  .nav-item.active::after { display: none; }
  .nav-item.active svg { animation: none; }
  .sidebar-footer {
    border-top: none;
    padding: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
  }
  .sidebar-footer .user-info, .sidebar-footer .contact-links { display: none; }
  .sidebar-footer .nav-item { min-width: 58px; color: #f59588; }

  .main { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  /* Topbar */
  .topbar { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .topbar h1 { font-size: 13px; letter-spacing: 0.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .refresh-btn { padding: 10px 12px; }
  .clock-box { font-size: 12px; gap: 5px; }

  .content { padding: 14px 12px 26px; }
  .panel-header { padding: 12px 14px; }
  .panel-header h3 { font-size: 13px; letter-spacing: 0.3px; }
  .panel-body { padding: 12px 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .refresh-label { display: none; }
  .clock-date { display: none; }
  .login-card { padding: 30px 20px; }
  .contact-strip { display: flex; font-size: 13px; padding: 7px 12px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar input, .toolbar select, .toolbar button, input, select, textarea { font-size: 16px; }
  .btn { padding: 11px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-value { font-size: 20px; }
  .stat-icon { width: 40px; height: 40px; }
  .score-input, .test-score { width: 66px; }
  .modal { max-height: 88vh; }
  .modal-body { padding: 18px; }
  th, td { padding: 10px 10px; font-size: 13px; }
  .avatar { width: 36px; height: 36px; font-size: 13px; }
  .student-cell { gap: 8px; }
  .journal .jname { min-width: 118px; padding: 8px 8px; font-size: 12px; }
  .journal .jhead { min-width: 30px; padding: 6px 1px; font-size: 10px; }
  .jcell { width: 30px; height: 30px; min-width: 30px; font-size: 14px; }
  .parent-hero { flex-wrap: wrap; padding: 20px; gap: 14px; }
  .parent-hero .avatar { width: 68px; height: 68px; font-size: 26px; }
  .parent-hero h2 { font-size: 17px; }
  .diary-entry { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 480px) {
  .modal-overlay { padding: 8px; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 45%; }
  .nav-item { min-width: 60px; padding: 6px 8px; font-size: 9px !important; }
  .nav-item svg { width: 20px; height: 20px; }
  .stat-card { padding: 11px 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .topbar h1 { font-size: 12px; }
}