@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Amiri:wght@400;700&display=swap');

/* ===== iOS PREMIUM LIGHT DESIGN SYSTEM ===== */
:root {
  /* Vibrant Apple iOS Light Palette */
  --primary: #34c759;        /* iOS Green */
  --primary-light: #30d158;  /* iOS Bright Green */
  --primary-lighter: #eafaf1; /* iOS Soft Green background */
  --primary-dark: #248a3d;   /* iOS Dark Green */
  --primary-glow: rgba(52, 199, 89, 0.12);

  --accent: #ff9500;         /* iOS Orange */
  --accent-light: #fff4e5;   /* iOS Soft Orange */
  --accent-dark: #d07c00;

  --info: #007aff;           /* iOS Blue */
  --info-light: #e5f1ff;     /* iOS Soft Blue */
  --info-dark: #005ec3;

  --danger: #ff3b30;         /* iOS Red */
  --danger-light: #ffebe5;   /* iOS Soft Red */
  --danger-dark: #c92a20;

  --warning: #ffcc00;        /* iOS Yellow */
  --warning-light: #fffbeb;

  --purple: #af52de;         /* iOS Purple */
  --purple-light: #f7e5ff;
  --purple-dark: #893ab8;

  /* iOS Gradients for Icon Tiles */
  --grad-blue: linear-gradient(135deg, #5ac8fa, #007aff);
  --grad-green: linear-gradient(135deg, #4cd964, #34c759);
  --grad-orange: linear-gradient(135deg, #ffcc00, #ff9500);
  --grad-red: linear-gradient(135deg, #ff5e3a, #ff3b30);
  --grad-purple: linear-gradient(135deg, #d573f5, #af52de);
  --grad-teal: linear-gradient(135deg, #52e5e7, #13c2c2);
  --grad-gray: linear-gradient(135deg, #c7c7cc, #8e8e93);

  /* iOS Backgrounds & Surfaces (Light Theme) */
  --bg: #f2f2f7;             /* iOS Grouped Background Color */
  --bg-secondary: #ffffff;   /* Pure White */
  --surface: #ffffff;
  --surface-hover: #fcfcfd;
  --border: rgba(0, 0, 0, 0.045);
  --border-2: rgba(0, 0, 0, 0.08);
  --border-focus: #007aff;
  --border-neutral: rgba(0, 0, 0, 0.08);

  /* Typography */
  --text-primary: #000000;
  --text-secondary: #3c3c43;
  --text-muted: #8e8e93;

  /* iOS Style Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 12px 36px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);

  /* Apple Superellipse Corners */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  /* Navigation Dimension */
  --nav-height: 64px;
  --sidebar-width: 270px;

  /* Standard Transitions */
  --transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.12s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Plus Jakarta Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
}
button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  outline: none;
}
a {
  text-decoration: none;
  color: inherit;
}
img { max-width: 100%; }
input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ===== iOS ICON TILE ===== */
.ios-icon-tile {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.ios-icon-tile.blue { background: var(--grad-blue); }
.ios-icon-tile.green { background: var(--grad-green); }
.ios-icon-tile.orange { background: var(--grad-orange); }
.ios-icon-tile.red { background: var(--grad-red); }
.ios-icon-tile.purple { background: var(--grad-purple); }
.ios-icon-tile.teal { background: var(--grad-teal); }
.ios-icon-tile.gray { background: var(--grad-gray); }

.ios-icon-tile svg, .ios-icon-tile i {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.2;
}

/* ===== LUCIDE ICON GLOBAL STYLE ===== */
.lucide-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: inline-block;
  vertical-align: middle;
  transition: var(--transition);
}

/* ===== LAYOUT WRAPPER ===== */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}
.main-content {
  flex: 1;
  min-width: 0;
  padding: 24px 20px;
  animation: fadeInUp 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
@media (min-width: 1024px) {
  .main-content {
    padding: 32px 40px;
  }
}

/* Page View Visibility with Smooth Blur Animation */
.page-view {
  display: none;
}
.page-view.active {
  display: block;
  animation: pageBlurIn 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes pageBlurIn {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(6px) scale(0.995);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}


@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== NAVBAR (iOS GLASS HEADER) ===== */
.navbar {
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  justify-content: space-between;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}
.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-green);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.15rem;
  box-shadow: 0 3px 8px rgba(52, 199, 89, 0.2);
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.user-avatar {
  width: 26px;
  height: 26px;
  background: var(--grad-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.78rem;
}
.hamburger {
  display: none;
  width: 38px;
  height: 38px;
  background: rgba(0,0,0,0.04);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-primary);
  transition: var(--transition);
}
.hamburger:hover {
  background: rgba(0,0,0,0.08);
}
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
}

/* ===== SIDEBAR (iOS SETTINGS LIST STYLE) ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 0.5px solid rgba(0, 0, 0, 0.08);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  transition: var(--transition-slow);
  flex-shrink: 0;
}
.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: var(--transition);
  margin-bottom: 2px;
  gap: 12px;
}
.nav-item:hover {
  background: rgba(0, 0, 0, 0.035);
}
.nav-item.active {
  background: rgba(52, 199, 89, 0.1);
  color: var(--primary-dark);
  font-weight: 600;
}
.nav-item.active .ios-icon-tile {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.nav-item.active .nav-badge {
  background: var(--accent);
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: var(--nav-height);
    z-index: 99;
    width: 270px;
    height: calc(100vh - var(--nav-height));
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-height);
    background: rgba(0, 0, 0, 0.15);
    z-index: 98;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .sidebar-overlay.open {
    display: block;
  }
}

/* ===== CARDS (iOS WIDGET STYLE) ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 0.5px solid rgba(0, 0, 0, 0.05);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 0, 0, 0.08);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .lucide-icon, .card-title svg {
  color: var(--primary);
}

/* Stat Cards */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 0.5px solid rgba(0, 0, 0, 0.05);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.stat-info {
  flex: 1;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 2px;
}
.stat-change {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 6px;
  display: inline-block;
}
.stat-change.up { background: var(--primary-lighter); color: var(--primary-dark); }
.stat-change.down { background: var(--danger-light); color: var(--danger-dark); }

/* Color overrides for Stat Cards using iOS tiles */
.stat-card.green .stat-icon { background: var(--grad-green); color: white; }
.stat-card.amber .stat-icon { background: var(--grad-orange); color: white; }
.stat-card.blue .stat-icon { background: var(--grad-blue); color: white; }
.stat-card.red .stat-icon { background: var(--grad-red); color: white; }
.stat-card.purple .stat-icon { background: var(--grad-purple); color: white; }

/* ===== PRAYER CARD (iOS LOCKSCREEN WIDGET) ===== */
.prayer-card {
  background: linear-gradient(135deg, #10b981, #047857);
  background-image: linear-gradient(135deg, #34c759 0%, #248a3d 100%);
  border-radius: var(--radius-xl);
  padding: 28px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(52, 199, 89, 0.25);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
}
.prayer-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 70%);
  pointer-events: none;
}
.prayer-card .prayer-name {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.prayer-card .prayer-label {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 4px 0;
  letter-spacing: -0.02em;
}
.prayer-card .prayer-time {
  font-size: 0.9rem;
  opacity: 0.85;
}
.prayer-card .prayer-countdown {
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 16px 0 8px;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.prayer-card .prayer-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  border: 0.5px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}
.prayer-card .prayer-status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 6px #34c759;
}

/* Prayer row list (Grouped List Style) */
.prayer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prayer-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: #f2f2f7;
  border: 0.5px solid rgba(0, 0, 0, 0.03);
  transition: var(--transition);
  gap: 12px;
}
.prayer-row.active {
  border-color: rgba(52, 199, 89, 0.2);
  background: var(--primary-lighter);
  box-shadow: var(--shadow-sm);
}
.prayer-row.passed {
  opacity: 0.5;
}
.prayer-row .p-icon {
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prayer-row .p-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.prayer-row .p-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.prayer-row .p-range {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
}
.prayer-row .p-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
}

/* ===== STREAK CARD (iOS HEALTH WIDGET STYLE) ===== */
.streak-card {
  background: linear-gradient(135deg, #ff9500, #ff5e3a);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  color: white;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 20px rgba(255, 149, 0, 0.2);
  position: relative;
  overflow: hidden;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
}
.streak-card::before {
  content: '⚡';
  position: absolute;
  right: -5px; bottom: -15px;
  font-size: 5.5rem;
  opacity: 0.15;
  pointer-events: none;
}
.streak-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
}

/* ===== TABLE (iOS GROUPED LIST TABLE) ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 0.5px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
  background: white;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead {
  background: #f2f2f7;
}
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}
tbody tr {
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
  transition: var(--transition-fast);
}
tbody tr:last-child {
  border-bottom: none;
}
tbody tr:hover {
  background: #fbfbfb;
}
tbody td {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
tbody td strong {
  color: var(--text-primary);
  font-weight: 600;
}
.check-cell {
  text-align: center;
}
.check-yes {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}
.check-no {
  color: var(--text-muted);
  opacity: 0.35;
}

/* ===== iOS SEGMENTED CONTROL (UISegmentedControl) ===== */
.role-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: rgba(120, 120, 128, 0.12);
  border-radius: 9px;
  padding: 2px;
  margin-bottom: 20px;
  position: relative;
}
.role-selector.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.role-btn {
  border: none;
  background: none;
  padding: 8px 4px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  outline: none;
}
.role-btn:hover {
  color: var(--text-primary);
}
.role-btn.selected {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}
.role-btn .role-icon {
  font-size: 1.25rem;
}
.role-btn .role-name {
  font-size: 0.78rem;
  font-weight: 600;
}

/* ===== FORMS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-label span {
  color: var(--danger);
  margin-left: 2px;
}
.form-control {
  padding: 10px 14px;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background: #f2f2f7;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
  width: 100%;
}
.form-control:focus {
  background: #ffffff;
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}
.form-control::placeholder {
  color: var(--text-muted);
}
.form-row {
  display: grid;
  gap: 16px;
}
.form-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 500px) {
  .form-row.cols-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ===== BUTTONS (iOS CLEAN & HIGHLIGHT) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-fast);
  border: none;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.96);
  opacity: 0.9;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(52, 199, 89, 0.15);
}
.btn-primary:hover {
  background: var(--primary-light);
}
.btn-secondary {
  background: rgba(120, 120, 128, 0.12);
  color: var(--info);
}
.btn-secondary:hover {
  background: rgba(120, 120, 128, 0.18);
}
.btn-danger {
  background: var(--danger-light);
  color: var(--danger-dark);
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}
.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 6px rgba(255, 149, 0, 0.15);
}
.btn-accent:hover {
  background: #ffa126;
}
.btn-outline {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.15);
}
.btn-full {
  width: 100%;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}
.btn-lg {
  padding: 14px 24px;
  border-radius: 14px;
}

.btn .lucide-icon, .btn svg {
  margin-right: 6px;
  width: 16px;
  height: 16px;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-green { background: var(--primary-lighter); color: var(--primary-dark); }
.badge-amber { background: var(--accent-light); color: var(--accent-dark); }
.badge-red { background: var(--danger-light); color: var(--danger-dark); }
.badge-blue { background: var(--info-light); color: var(--info-dark); }
.badge-purple { background: var(--purple-light); color: var(--purple-dark); }
.badge-gray { background: #e5e5ea; color: #5c5c60; }

/* ===== SECTION HEADER ===== */
.section-header {
  margin-bottom: 24px;
}
.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.025em;
}
.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== ALERTS ===== */
.alert {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
}
.alert-info { background: var(--info-light); color: var(--info-dark); }
.alert-warning { background: var(--accent-light); color: var(--accent-dark); }
.alert-danger { background: var(--danger-light); color: var(--danger-dark); }
.alert-icon { font-size: 1.15rem; line-height: 1; }

/* ===== LIST ITEMS ===== */
.report-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: white;
  border: 0.5px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.report-item:hover {
  border-color: rgba(0,0,0,0.1);
  box-shadow: var(--shadow);
}
.stu-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  flex-shrink: 0;
}

/* ===== MODALS (iOS BOTTOM SHEET ON MOBILE, CARD ON DESKTOP) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: white;
  border-radius: var(--radius-xl);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.94) translateY(10px);
  transition: var(--transition);
  max-height: 85vh;
  overflow-y: auto;
  border: 0.5px solid rgba(0, 0, 0, 0.05);
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 12px;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  transition: var(--transition-fast);
}
.modal-close:hover {
  background: #d1d1d6;
  color: var(--text-primary);
}

@media (max-width: 576px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
    max-height: 90vh;
  }
  .modal-overlay.open .modal {
    transform: translateY(0);
  }
}

/* ===== PROFILE HERO (iOS INSPIRED PROFILE CARD) ===== */
.profile-hero {
  background: linear-gradient(135deg, #10b981 0%, #059669 60%, #0d9488 100%);
  background-image: linear-gradient(135deg, #34c759 0%, #248a3d 100%);
  border-radius: var(--radius-xl);
  padding: 24px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(52, 199, 89, 0.15);
  margin-bottom: 20px;
}
.profile-hero::before {
  content: '☪';
  position: absolute;
  right: 15px; bottom: -15px;
  font-size: 7.5rem;
  opacity: 0.08;
  line-height: 1;
  pointer-events: none;
}
.profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.profile-hero h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 2px;
}
.profile-hero p {
  opacity: 0.85;
  font-size: 0.88rem;
}

/* ===== WEEKLY HEATMAP (STUDENT ACTIVITY WIDGET) ===== */
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
}
.weekly-day {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.weekly-cell {
  aspect-ratio: 1;
  border-radius: 7px;
  background: #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  transition: var(--transition);
  color: var(--text-secondary);
}
.weekly-cell.full { background: var(--primary); color: white; box-shadow: 0 1px 4px rgba(52, 199, 89, 0.2); }
.weekly-cell.partial { background: var(--accent-light); color: var(--accent-dark); }
.weekly-cell.none { background: var(--danger-light); color: var(--danger); }

/* ===== BOTTOM NAVIGATION (iOS TAB BAR) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .main-content { padding-bottom: 80px; }
  .sidebar { display: none !important; }
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  flex: 1;
  height: 100%;
  transition: var(--transition-fast);
}
.bottom-nav-item .lucide-icon, .bottom-nav-item svg {
  width: 22px !important;
  height: 22px !important;
  margin-bottom: 3px;
  stroke-width: 2.2;
}
.bottom-nav-item.active {
  color: var(--primary-dark);
}
.bottom-nav-item.active .lucide-icon, .bottom-nav-item.active svg {
  stroke: var(--primary);
  transform: scale(1.08);
}

/* ===== GRID SYSTEM ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

/* ===== SPACING ===== */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.hidden { display: none !important; }
.w-full { width: 100%; }

/* ===== iOS NOTIFICATION BANNER TOASTS ===== */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 350px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1), toast-out 0.3s cubic-bezier(0.16, 1, 0.3, 1) 2.7s forwards;
}
.toast.success { border-left: 4px solid var(--primary); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--accent); }
.toast.info { border-left: 4px solid var(--info); }
.toast-icon { font-size: 1.15rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.93); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-16px) scale(0.93); }
}

/* ===== QR DISPLAY FRAME ===== */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(0, 0, 0, 0.15);
}
.qr-frame {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.qr-frame::before, .qr-frame::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--primary);
  border-style: solid;
}
.qr-frame::before { top: 6px; left: 6px; border-width: 3px 0 0 3px; border-radius: 6px 0 0 0; }
.qr-frame::after { bottom: 6px; right: 6px; border-width: 0 3px 3px 0; border-radius: 0 0 6px 0; }

.qr-student-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}
.qr-student-id {
  font-family: monospace;
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.9rem;
}

/* ===== LOGIN PAGE (iOS LOCKSCREEN MOCKUP) ===== */
.login-page {
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 10% 20%, rgba(52, 199, 89, 0.05) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(0, 122, 255, 0.05) 0%, transparent 40%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  max-width: 390px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  position: relative;
}
.login-logo {
  text-align: center;
  margin-bottom: 24px;
}
.login-logo .logo-icon {
  width: 60px; height: 60px;
  background: var(--grad-green);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.25);
  color: white;
}
.login-logo h1 { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.03em; }
.login-logo p { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.tagline {
  font-family: 'Amiri', serif;
  font-size: 0.95rem;
  color: var(--primary-dark);
  text-align: center;
  margin-top: 6px;
  direction: rtl;
}
.error-msg {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
  font-weight: 600;
  display: none;
}

/* Demo accounts */
.demo-accounts {
  margin-top: 20px;
  padding: 12px;
  background: #f2f2f7;
  border-radius: 10px;
}
.demo-accounts h4 {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin: 2px;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.demo-chip:hover {
  background: var(--primary-lighter);
  border-color: rgba(52, 199, 89, 0.2);
  color: var(--primary-dark);
}

/* ===== iOS SETTINGS-LIKE LIST LAYOUTS ===== */
.schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.schedule-day {
  background: #f2f2f7;
  border-radius: var(--radius);
  border: 0.5px solid rgba(0,0,0,0.04);
  overflow: hidden;
}
.schedule-day-header {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.schedule-day-header .day-name {
  font-weight: 700;
  font-size: 0.9rem;
}
.schedule-day-body {
  padding: 12px 16px;
}

/* iOS Checkbox Toggles */
.prayer-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media(min-width: 480px) {
  .prayer-checkbox-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media(min-width: 768px) {
  .prayer-checkbox-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
.prayer-cb {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  background: white;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}
.prayer-cb input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0; width: 0;
}
.prayer-cb.checked {
  border-color: var(--primary);
  background: var(--primary-lighter);
  box-shadow: 0 1px 4px rgba(52, 199, 89, 0.1);
}
.prayer-cb .pc-icon {
  font-size: 1.2rem;
}
.prayer-cb .pc-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.prayer-cb.checked .pc-name {
  color: var(--primary-dark);
}

/* Laporan Selects */
.report-prayer-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media(min-width: 480px) {
  .report-prayer-select {
    grid-template-columns: repeat(5, 1fr);
  }
}
.prayer-select-btn {
  background: white;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}
.prayer-select-btn .pray-icon {
  font-size: 1.3rem;
}
.prayer-select-btn span:not(.pray-icon) {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.prayer-select-btn.selected {
  border-color: var(--info);
  background: var(--info-light);
}
.prayer-select-btn.selected span:not(.pray-icon) {
  color: var(--info-dark);
}
.prayer-select-btn.done {
  border-color: var(--primary-light);
  background: var(--primary-lighter);
  cursor: not-allowed;
  opacity: 0.75;
}
.prayer-select-btn.done span:not(.pray-icon) {
  color: var(--primary-dark);
}

/* Location Tags */
.location-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0,0,0,0.08);
  background: white;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.location-tag.selected {
  border-color: var(--primary);
  background: var(--primary-lighter);
  color: var(--primary-dark);
  box-shadow: 0 1px 4px rgba(52, 199, 89, 0.1);
}

/* Class Stat */
.class-stat-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media(min-width: 600px) {
  .class-stat-container {
    grid-template-columns: repeat(4, 1fr);
  }
}
.class-stat {
  background: #f2f2f7;
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  border: 0.5px solid rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}
.class-stat:hover {
  background: white;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-sm);
}
.class-stat .cs-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}
.class-stat .cs-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
  text-transform: uppercase;
}

/* Scanner Results */
@keyframes popIn {
  0% { transform: scale(0.92); opacity: 0; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.scan-result {
  padding: 16px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(0,0,0,0.08);
  background: #f2f2f7;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
}
.scan-result.success { 
  border-color: var(--primary-light); 
  background: var(--primary-lighter); 
  color: var(--primary-dark); 
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.scan-result.already { 
  border-color: var(--accent-light); 
  background: var(--accent-light); 
  color: var(--accent-dark); 
  animation: shake 0.35s ease-in-out both;
}
.scan-result.error { 
  border-color: #fca5a5; 
  background: var(--danger-light); 
  color: var(--danger-dark); 
  animation: shake 0.35s ease-in-out both;
}

/* QR Scanner Box */
#reader {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: none !important;
  background: #000000;
  box-shadow: var(--shadow-sm);
}
#reader video {
  border-radius: var(--radius);
  object-fit: cover;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}
.empty-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  opacity: 0.7;
}
.empty-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 600px) {
  .hide-mobile {
    display: none !important;
  }
  .navbar-user span {
    display: none !important;
  }
  .navbar-user {
    padding: 4px !important;
  }
  .navbar-right {
    gap: 8px !important;
  }
  .profile-hero {
    padding: 20px 16px !important;
  }
  .profile-hero h2 {
    font-size: 1.25rem !important;
  }
  .streak-card {
    padding: 16px !important;
  }
  .streak-number {
    font-size: 2.2rem !important;
  }
  .stat-card {
    padding: 12px 10px !important;
    gap: 8px !important;
  }
  .stat-icon {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }
  .stat-icon svg, .stat-icon i {
    width: 18px !important;
    height: 18px !important;
  }
  .stat-value {
    font-size: 1.35rem !important;
  }
  .stat-label {
    font-size: 0.7rem !important;
  }
}
