:root {
  --maroon-primary: #800020;
  --maroon-dark: #3a000e;
  --maroon-light: #a31336;
  --maroon-gradient: linear-gradient(135deg, #800020 0%, #3a000e 100%);
  --accent-crimson: #ff2a5f;
  --accent-gold: #fbbf24;
  --accent-emerald: #10b981;
  --accent-blue: #3b82f6;
  --bg-app: #f1f5f9;
  --card-white: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #ffffff;
  --border-color: #e2e8f0;
  --radius-sporty: 16px;
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
  margin: 0; padding: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  display: flex;
  background-color: var(--bg-app);
  color: var(--text-dark);
  min-height: 100vh;
  flex-direction: column;
}

/* HEADER MOBILE */
.mobile-header {
  display: none;
  background: var(--maroon-gradient);
  color: var(--text-light);
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-md);
}

.brand-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.app-logo-badge {
  background: var(--accent-gold);
  color: var(--maroon-dark);
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.app-title {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.menu-toggle-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* SIDEBAR LAYOUT */
.sidebar {
  width: 280px;
  background: var(--maroon-gradient);
  color: white;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.class-selector {
  background: rgba(255, 255, 255, 0.1);
  padding: 14px;
  border-radius: var(--radius-sporty);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.class-selector label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-gold);
  display: block;
  margin-bottom: 8px;
}

.class-selector input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  margin-bottom: 8px;
  font-weight: 700;
  text-align: center;
}

.btn-submit-code {
  width: 100%;
  padding: 8px;
  background: var(--accent-gold);
  color: var(--maroon-dark);
  border: none;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 12px 14px;
  border-radius: 10px;
  text-align: left;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.menu-btn:hover, .menu-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.btn-admin {
  margin-top: auto;
  background: var(--maroon-dark);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 12px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

/* CONTENT CONTAINER */
.content {
  margin-left: 280px;
  padding: 30px;
  flex: 1;
}

.sporty-hero {
  background: var(--maroon-gradient);
  color: white;
  padding: 40px 30px;
  border-radius: var(--radius-sporty);
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
}

.hero-badge {
  background: var(--accent-gold);
  color: var(--maroon-dark);
  font-weight: 800;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.input-kode-box {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  max-width: 450px;
}

.input-kode-field {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
}

.btn-submit-kode {
  background: var(--accent-gold);
  color: var(--maroon-dark);
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

/* CARDS & GRID */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-white);
  border-radius: var(--radius-sporty);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.badge {
  background: #e2e8f0;
  color: var(--text-dark);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.card-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 10px 0;
  color: var(--maroon-primary);
}

.btn-action {
  width: 100%;
  padding: 10px;
  background: var(--maroon-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* DASHBOARD & TABLES */
.admin-header {
  background: var(--maroon-gradient);
  color: white;
  padding: 20px;
  border-radius: var(--radius-sporty);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.admin-tab {
  padding: 10px 16px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.admin-tab.active {
  background: var(--maroon-primary);
  color: white;
}

.admin-form {
  background: white;
  padding: 24px;
  border-radius: var(--radius-sporty);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.data-table th, .data-table td {
  padding: 12px;
  border: 1px solid var(--border-color);
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: #f8fafc;
  font-weight: 800;
}

/* MODAL & POPUP */
.modal {
  position: fixed;
  top: 0; bottom: 0; left: 0; right: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: var(--radius-sporty);
  max-width: 500px;
  width: 100%;
  position: relative;
}

.modal-large {
  max-width: 850px;
  background: #0f172a;
  color: white;
}

.close {
  position: absolute;
  top: 15px; right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

input[type="text"], input[type="password"], input[type="url"], input[type="number"], select, textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .desktop-only { display: none; }
  .content { margin-left: 0; padding: 15px; }
  .sidebar-overlay.show {
    position: fixed; top: 0; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.5); z-index: 95;
  }
}

/* KERTAS UJIAN & PRINT STYLES */
@media print {
  .no-print, .sidebar, .mobile-header { display: none !important; }
  .content { margin-left: 0 !important; padding: 0 !important; }
  #kertas-ujian { display: block !important; }
}
* {
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background-color: #f1f5f9;
  display: flex;
  min-height: 100vh;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.mobile-header {
  display: none !important;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  .mobile-header {
    display: flex !important;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    z-index: 9999;
    transition: left 0.3s ease;
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
  }
  .sidebar-overlay.show {
    display: block;
  }
}

.menu-btn {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  color: #cbd5e1;
  border: none;
  border-radius: 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.menu-btn:hover, .menu-btn.active {
  background: #800000;
  color: #ffffff;
}

@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: white;
  }
  main {
    padding: 0 !important;
  }
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  display: flex;
  min-height: 100vh;
  background-color: #f8fafc;
  color: #1e293b;
}

.mobile-header {
  display: none;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  .mobile-header {
    display: flex;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    z-index: 99990;
    transition: left 0.3s ease;
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 99989;
  }
  .sidebar-overlay.show {
    display: block;
  }
}

.menu-btn {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  color: #cbd5e1;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.menu-btn:hover, .menu-btn.active {
  background: #800000;
  color: #ffffff;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: white;
  }
}
