/**
 * Portal Kedisiplinan & Pelaporan Siswa - SMA SANTA MARIA PEKANBARU
 * Professional Mobile-First PWA Styling & Android Design System
 */

:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e3a8a;
  --primary-900: #0f172a;

  --accent-gold: #d97706;
  --accent-gold-light: #fef3c7;
  --accent-amber: #f59e0b;

  --success-50: #ecfdf5;
  --success-500: #10b981;
  --success-600: #059669;
  --success-700: #047857;

  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;

  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;

  --bg-app: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --bottom-nav-height: 64px;
  --top-appbar-height: 60px;
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: var(--font-family);
  font-size: 15px;
  color: var(--text-main);
  background-color: var(--bg-app);
  height: 100%;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  min-height: 100%;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

/* Container Structure */
.app-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-app);
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 16px) + 20px);
  overflow-x: hidden;
  box-sizing: border-box;
}

/* On Desktop / Tablet: Responsive centered wrapper with subtle app shell frame */
@media (min-width: 1024px) {
  body {
    background: radial-gradient(circle at 10% 20%, #0f172a 0%, #1e293b 90%);
  }
  .app-container {
    max-width: 1120px;
    margin: 20px auto;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    min-height: calc(100vh - 40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* =========================================================
   1. SPLASH SCREEN (Native PWA Android Feeling)
   ========================================================= */
#smap-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #0b1528 0%, #1e3a8a 50%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
  padding: 24px;
  text-align: center;
}

#smap-splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  animation: splashPulse 2s infinite ease-in-out;
}

.splash-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

.splash-badge-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.3) 0%, rgba(30, 58, 138, 0) 70%);
  z-index: -1;
  animation: splashRotate 6s linear infinite;
}

.splash-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 6px;
  max-width: 320px;
}

.splash-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 30px;
}

.splash-loader-bar {
  width: 160px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.splash-loader-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #fbbf24, #60a5fa);
  border-radius: var(--radius-full);
  animation: splashLoad 1.5s infinite ease-in-out;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes splashRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes splashLoad {
  0% { left: -40%; width: 30%; }
  50% { left: 30%; width: 60%; }
  100% { left: 100%; width: 30%; }
}

/* =========================================================
   2. TOP ANDROID APP BAR
   ========================================================= */
.top-appbar {
  height: var(--top-appbar-height);
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.top-appbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.top-appbar-logo {
  width: 38px;
  height: 38px;
  background: #ffffff;
  border-radius: 10px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.top-appbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.top-appbar-text {
  display: flex;
  flex-direction: column;
}

.top-appbar-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  letter-spacing: -0.01em;
}

.top-appbar-sub {
  font-size: 0.68rem;
  color: #93c5fd;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@media (max-width: 400px) {
  .top-appbar-title {
    max-width: 145px;
    font-size: 0.85rem;
  }
  .top-appbar-sub {
    font-size: 0.62rem;
  }
  .top-appbar-actions {
    gap: 4px;
  }
}

.top-appbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.icon-btn:hover, .icon-btn:active {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* =========================================================
   3. BOTTOM NAVIGATION BAR (Android Fixed Style)
   ========================================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 1024px) {
  .bottom-nav {
    max-width: 1120px;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 4px 0;
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.bottom-nav-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.bottom-nav-item.active {
  color: var(--primary-700);
  font-weight: 700;
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: translateY(-2px);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  background: var(--primary-700);
  border-radius: 0 0 3px 3px;
}

/* Special center highlight button for Lapor */
.bottom-nav-item.special-action {
  color: white;
}

.bottom-nav-item.special-action .special-circle {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.4);
  margin-top: -16px;
  border: 3px solid #ffffff;
  color: white;
  transition: transform 0.2s ease;
}

.bottom-nav-item.special-action:active .special-circle {
  transform: scale(0.92);
}

.bottom-nav-item.special-action span {
  color: var(--text-secondary);
  font-weight: 600;
}

/* =========================================================
   4. CONTENT & CARDS
   ========================================================= */
.app-content {
  flex: 1;
  padding: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .app-content {
    padding: 24px;
  }
}

/* Banner Hero */
.hero-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #0369a1 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 10px 20px -5px rgba(30, 58, 138, 0.3);
}

.hero-card::before {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
  backdrop-filter: blur(4px);
}

.hero-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 0.85rem;
  color: #bfdbfe;
  line-height: 1.45;
  margin-bottom: 18px;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
  }
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 480px) {
  .app-content {
    padding: 10px 8px;
  }
  .card {
    padding: 14px 12px;
  }
  .timeline-item {
    padding: 10px 10px;
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg {
  width: 20px;
  height: 20px;
  color: var(--primary-700);
}

/* Grid Layouts */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .grid-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-box {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.stat-box.primary .stat-icon-wrap { background: var(--primary-50); color: var(--primary-700); }
.stat-box.warning .stat-icon-wrap { background: var(--warning-50); color: var(--warning-600); }
.stat-box.danger .stat-icon-wrap { background: var(--danger-50); color: var(--danger-600); }
.stat-box.success .stat-icon-wrap { background: var(--success-50); color: var(--success-600); }

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* =========================================================
   5. BUTTONS (Touch Optimized min 48px)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  white-space: normal;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
}

.btn:active {
  transform: scale(0.97);
}

.portal-tile-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s ease;
  gap: 10px;
}

.portal-tile-btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-accent {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-main);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-alt);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap !important;
  flex-shrink: 0;
  box-sizing: border-box;
}

.badge svg {
  width: 13px !important;
  height: 13px !important;
  margin-right: 4px;
  flex-shrink: 0;
}

.badge-success { background: var(--success-50); color: var(--success-700); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background: var(--warning-50); color: var(--warning-600); border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-danger { background: var(--danger-50); color: var(--danger-700); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-primary { background: var(--primary-50); color: var(--primary-700); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-neutral { background: var(--surface-alt); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-emerald { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* =========================================================
   6. FORMS & INPUTS (Android Friendly)
   ========================================================= */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger-600);
}

.form-control, .form-select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-main);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =========================================================
   7. MODALS & ANDROID BOTTOM SHEETS
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  max-height: 88vh;
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .modal-dialog {
    border-radius: var(--radius-lg);
    transform: scale(0.95);
    box-shadow: var(--shadow-xl);
    max-height: 88vh;
    max-height: calc(100dvh - 48px);
  }
}

.modal-dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.modal-backdrop.show .modal-dialog {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .modal-backdrop.show .modal-dialog {
    transform: scale(1);
  }
}

.sheet-handle {
  width: 32px;
  height: 4px;
  background: #cbd5e1;
  border-radius: var(--radius-full);
  margin: 8px auto 2px auto;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .sheet-handle {
    display: none;
  }
}

.modal-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: #ffffff;
  flex-shrink: 0;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.modal-title svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary-700);
}

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.modal-footer {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border-light);
  background: var(--surface-alt);
  flex-shrink: 0;
}

/* =========================================================
   8. TOAST NOTIFICATIONS (Compact Android Pill)
   ========================================================= */
#toast-container {
  position: fixed;
  top: calc(var(--top-appbar-height) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: auto;
  max-width: 90vw;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  animation: toastSlideIn 0.25s forwards cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  line-height: 1.25;
  white-space: nowrap;
}

.toast svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.toast.info {
  background: rgba(15, 23, 42, 0.94);
  color: #f1f5f9;
  border-color: rgba(59, 130, 246, 0.4);
}
.toast.info svg {
  color: #60a5fa;
}

.toast.success {
  background: rgba(6, 78, 59, 0.95);
  color: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.4);
}
.toast.success svg {
  color: #34d399;
}

.toast.warning {
  background: rgba(69, 26, 3, 0.95);
  color: #fffbeb;
  border-color: rgba(245, 158, 11, 0.4);
}
.toast.warning svg {
  color: #fbbf24;
}

.toast.danger {
  background: rgba(127, 29, 29, 0.95);
  color: #fef2f2;
  border-color: rgba(239, 68, 68, 0.4);
}
.toast.danger svg {
  color: #f87171;
}

@keyframes toastSlideIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   9. STUDENT VIOLATION LIST / TIMELINE
   ========================================================= */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  word-break: break-word;
}

.timeline-item.ringan { border-left: 4px solid var(--success-600); }
.timeline-item.sedang { border-left: 4px solid var(--warning-600); }
.timeline-item.berat { border-left: 4px solid var(--danger-600); }

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.timeline-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  min-width: 0;
  flex: 1;
  word-break: break-word;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.timeline-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timeline-points {
  font-weight: 800;
  color: var(--danger-600);
  font-size: 0.9rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Side Drawer for Profile & Menu */
.side-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: var(--surface);
  z-index: 2500;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.side-drawer.open {
  left: 0;
}

.drawer-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  color: white;
  padding: 24px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s ease;
}

.drawer-link:hover, .drawer-link:active {
  background: var(--surface-alt);
  color: var(--primary-700);
}

.drawer-link svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.drawer-link.active {
  background: var(--primary-50);
  color: var(--primary-700);
}

.drawer-link.active svg {
  color: var(--primary-700);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2400;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.drawer-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Utility Helpers */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }

/* =========================================================
   10. AUTO UPDATE NOTIFICATION BANNER (Modern & Professional)
   ========================================================= */
#smap-update-banner {
  position: fixed;
  top: calc(var(--top-appbar-height) + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  width: calc(100% - 24px);
  max-width: 440px;
  background: rgba(15, 23, 42, 0.96);
  color: #ffffff;
  padding: 11px 14px;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

#smap-update-banner.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.update-icon-glow {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e40af 0%, #0284c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  position: relative;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
}

.update-pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0f172a;
  animation: pulseDot 1.6s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

.update-content {
  flex: 1;
  min-width: 0;
}

.update-title {
  font-weight: 800;
  font-size: 0.84rem;
  color: #ffffff;
  line-height: 1.2;
}

.update-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.update-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-update-apply {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.15s ease;
}

.btn-update-apply:active {
  transform: scale(0.95);
}

.btn-update-dismiss {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.btn-update-dismiss:hover {
  color: #ffffff;
}

/* =========================================================
   11. REAL-TIME INSTANT OFFLINE POPUP MODAL (Android Alert)
   ========================================================= */
#smap-offline-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
  box-sizing: border-box;
}

#smap-offline-overlay.show {
  opacity: 1;
  visibility: visible;
}

.offline-popup-card {
  width: 100%;
  max-width: 400px;
  background: radial-gradient(circle at 50% 0%, #1e3a8a 0%, #0f172a 75%);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  padding: 22px 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  text-align: center;
  color: #ffffff;
  transform: scale(0.92) translateY(15px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

#smap-offline-overlay.show .offline-popup-card {
  transform: scale(1) translateY(0);
}

.popup-graphic-wrap {
  width: 100%;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.popup-graphic-wrap img {
  width: 100%;
  max-height: 58px;
  object-fit: contain;
  display: block;
}

.popup-badge-offline {
  position: absolute;
  top: -8px;
  right: 10px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1.5px solid #ffffff;
}

.popup-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  animation: pulseAlert 1.2s infinite ease-in-out;
}

.popup-offline-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.25;
}

.popup-offline-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 18px;
}

.popup-tips {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.73rem;
  color: #94a3b8;
  text-align: left;
  margin-bottom: 18px;
}

.popup-tips-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.popup-tips-item:last-child {
  margin-bottom: 0;
}

.popup-tips-item svg {
  width: 13px;
  height: 13px;
  color: #60a5fa;
  flex-shrink: 0;
}

.btn-popup-reconnect {
  width: 100%;
  min-height: 44px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s ease;
}

.btn-popup-reconnect:active {
  transform: scale(0.96);
}

.btn-popup-dismiss {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.74rem;
  margin-top: 10px;
  cursor: pointer;
  padding: 4px;
  font-weight: 600;
}

.btn-popup-dismiss:hover {
  color: #ffffff;
}

/* =========================================================
   12. NOTIFICATION CENTER (Bell Badge & Modern List)
   ========================================================= */
.notif-badge-pill {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #172554;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
  line-height: 1;
}

.notif-item-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: all 0.15s ease;
  text-decoration: none;
  display: block;
  color: inherit;
  box-sizing: border-box;
}

.notif-item-card:hover, .notif-item-card:active {
  background: #f8fafc;
  transform: translateY(-1px);
}

.notif-item-card.unread {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left: 4px solid #2563eb;
}

.icon-btn.has-notif svg {
  animation: bellShake 3.5s infinite ease-in-out;
}

@keyframes bellShake {
  0%, 75%, 100% { transform: rotate(0); }
  80% { transform: rotate(14deg); }
  85% { transform: rotate(-14deg); }
  90% { transform: rotate(8deg); }
  95% { transform: rotate(-4deg); }
}

/* =========================================================
   13. BENTO APP GRID (Modern Native Android App Menu)
   ========================================================= */
.bento-app-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 14px 12px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.bento-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.bento-card-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bento-grid-8 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .bento-grid-8 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.bento-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .bento-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.bento-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.bento-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .bento-grid-6 {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 640px) {
  .bento-grid-5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .bento-grid-5 .bento-item:last-child {
    grid-column: span 2;
  }
  .bento-grid-6 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.bento-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 4px;
  min-height: 82px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-sizing: border-box;
  user-select: none;
}

.bento-item:active {
  transform: scale(0.94);
}

.bento-item.active {
  background: #1e3a8a;
  border-color: #1e3a8a;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.35);
}

.bento-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.bento-icon-box svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

/* Palette Icons */
.bento-icon-box.amber { background: #fef3c7; color: #d97706; }
.bento-icon-box.blue { background: #eff6ff; color: #2563eb; }
.bento-icon-box.emerald { background: #ecfdf5; color: #059669; }
.bento-icon-box.teal { background: #ccfbf1; color: #0d9488; }
.bento-icon-box.rose { background: #ffe4e6; color: #e11d48; }
.bento-icon-box.purple { background: #f3e8ff; color: #7c3aed; }
.bento-icon-box.indigo { background: #e0e7ff; color: #4338ca; }
.bento-icon-box.slate { background: #f1f5f9; color: #475569; }

.bento-item.active .bento-icon-box {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.bento-item-text {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  word-break: break-word;
  max-width: 100%;
  padding: 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
}

.bento-item.active .bento-item-text {
  color: #ffffff;
}

.bento-badge-pill {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
