/* ==========================================================================
   PintarPelajar — Dark Glassmorphic Design System
   Standalone CSS (no Bootstrap / Tailwind dependency)
   RS Automation Solutions (SSM: 202603043461)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette */
  --brand-primary: #22d3ee;
  --brand-indigo: #06b6d4;
  --brand-amber: #fbbf24;
  --brand-green: #34d399;
  --brand-red: #ef4444;
  --brand-cyan: #22d3ee;
  --brand-purple: #a78bfa;

  /* Backgrounds */
  --bg-base: #0d0d1f;
  --bg-mid: #16103a;
  --bg-card: rgba(22, 16, 58, 0.6);
  --bg-input: rgba(13, 13, 31, 0.7);
  --bg-sidebar: linear-gradient(180deg, #0f0b2e 0%, #16103a 50%, #0d0d1f 100%);
  --bg-topbar: rgba(15, 11, 46, 0.85);

  /* Borders */
  --border-card: rgba(34, 211, 238, 0.15);
  --border-input: rgba(34, 211, 238, 0.25);
  --border-focus: rgba(34, 211, 238, 0.6);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-tertiary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);

  /* Glass effects */
  --glass-blur: blur(12px);
  --glass-blur-heavy: blur(20px);

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 1px rgba(34, 211, 238, 0.1);
  --shadow-glow-blue: 0 0 20px rgba(34, 211, 238, 0.25);
  --shadow-glow-green: 0 0 20px rgba(52, 211, 153, 0.25);
  --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.25);
  --shadow-glow-amber: 0 0 20px rgba(251, 191, 36, 0.25);

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
}


/* --------------------------------------------------------------------------
   2. Reset & Global Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text-primary);
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(6, 182, 212, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(34, 211, 238, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* PWA — prevent overscroll bounce */
  overscroll-behavior: none;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: #67e8f9; }

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-primary);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin-bottom: var(--space-4); }

::selection {
  background: rgba(34, 211, 238, 0.3);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.25);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.4); }


/* --------------------------------------------------------------------------
   3. Layout — Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-base);
}

.sidebar-brand {
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-card);
  flex-shrink: 0;
}

.sidebar-brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.sidebar-brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-3) 0;
  list-style: none;
}

.sidebar-section-title {
  padding: var(--space-3) var(--space-4) var(--space-2);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar-item {
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-tertiary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition-fast);
  position: relative;
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(34, 211, 238, 0.08);
}

.sidebar-link.active {
  color: var(--brand-primary);
  background: rgba(34, 211, 238, 0.12);
  border-right: 3px solid var(--brand-primary);
}

.sidebar-link .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-link.active .icon { opacity: 1; }

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-card);
  flex-shrink: 0;
}

/* Role badge in sidebar */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.2);
  color: var(--brand-indigo);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.role-badge--admin {
  background: rgba(251, 191, 36, 0.15);
  color: var(--brand-amber);
  border-color: rgba(251, 191, 36, 0.3);
}


/* --------------------------------------------------------------------------
   4. Layout — Topbar
   -------------------------------------------------------------------------- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  z-index: 900;
  transition: left var(--transition-base);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-school {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-indigo), var(--brand-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
}

/* Hamburger toggle (hidden on desktop) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-2);
  line-height: 1;
}


/* --------------------------------------------------------------------------
   5. Layout — Main Content
   -------------------------------------------------------------------------- */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  min-height: 100vh;
  min-height: 100dvh;
}

.page-body {
  padding: var(--space-5);
  max-width: 1400px;
}

.page-header {
  margin-bottom: var(--space-5);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}


/* --------------------------------------------------------------------------
   6. Glassmorphic Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  animation: fadeInUp 0.35s ease both;
}

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

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.card-body {
  /* just a semantic wrapper */
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Compact variant */
.card--compact { padding: var(--space-4); }


/* --------------------------------------------------------------------------
   7. Stat / Metric Cards
   -------------------------------------------------------------------------- */
.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  animation: fadeInUp 0.35s ease both;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--space-1);
}

.stat-change--up { color: var(--brand-green); }
.stat-change--down { color: var(--brand-red); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon--blue {
  background: rgba(34, 211, 238, 0.15);
  color: var(--brand-primary);
}
.stat-icon--green {
  background: rgba(52, 211, 153, 0.15);
  color: var(--brand-green);
}
.stat-icon--amber {
  background: rgba(251, 191, 36, 0.15);
  color: var(--brand-amber);
}
.stat-icon--purple {
  background: rgba(167, 139, 250, 0.15);
  color: var(--brand-purple);
}
.stat-icon--red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--brand-red);
}
.stat-icon--cyan {
  background: rgba(34, 211, 238, 0.15);
  color: var(--brand-cyan);
}

/* Grid helper for stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}


/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6rem 1.25rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  min-height: 44px;
}

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — blue gradient */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-indigo) 100%);
  color: #fff;
  border: none;
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow-blue);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

/* Success — green */
.btn-success {
  background: linear-gradient(135deg, var(--brand-green) 0%, #059669 100%);
  color: #fff;
  border: none;
}
.btn-success:hover {
  box-shadow: var(--shadow-glow-green);
  transform: translateY(-1px);
}
.btn-success:active { transform: translateY(0); }

/* Danger — red */
.btn-danger {
  background: linear-gradient(135deg, var(--brand-red) 0%, #b91c1c 100%);
  color: #fff;
  border: none;
}
.btn-danger:hover {
  box-shadow: var(--shadow-glow-red);
  transform: translateY(-1px);
}
.btn-danger:active { transform: translateY(0); }

/* Amber / Warning */
.btn-amber {
  background: linear-gradient(135deg, var(--brand-amber) 0%, #d97706 100%);
  color: #0d0d1f;
  border: none;
}
.btn-amber:hover {
  box-shadow: var(--shadow-glow-amber);
  transform: translateY(-1px);
}
.btn-amber:active { transform: translateY(0); }

/* Ghost / outline */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
}
.btn-ghost:hover {
  background: rgba(34, 211, 238, 0.08);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Small */
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  min-height: 36px;
}

/* Large */
.btn-lg {
  padding: 0.8rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* Block (full width) */
.btn-block { width: 100%; }


/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  min-height: 44px;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Select */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

select.form-control option {
  background: var(--bg-mid);
  color: var(--text-primary);
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Checkbox / radio wrapper */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 22px;
  height: 22px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.form-check-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Help / error text */
.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: 0.8rem;
  color: var(--brand-red);
  margin-top: var(--space-1);
}

.form-control.is-invalid {
  border-color: var(--brand-red);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}


/* --------------------------------------------------------------------------
   10. Tables
   -------------------------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background: rgba(22, 16, 58, 0.8);
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

tbody td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(34, 211, 238, 0.06);
  color: var(--text-secondary);
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:nth-child(even) {
  background: rgba(34, 211, 238, 0.03);
}

tbody tr:hover {
  background: rgba(34, 211, 238, 0.08);
}

tbody tr:last-child td {
  border-bottom: none;
}


/* --------------------------------------------------------------------------
   11. Alerts / Messages
   -------------------------------------------------------------------------- */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
  animation: fadeInDown 0.3s ease both;
}

.alert-success {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.25);
  color: var(--brand-green);
}

.alert-error, .alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--brand-red);
}

.alert-warning {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.25);
  color: var(--brand-amber);
}

.alert-info {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.25);
  color: var(--brand-primary);
}

.alert-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.alert-dismiss:hover { opacity: 1; }


/* --------------------------------------------------------------------------
   12. Badges / Pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-primary {
  background: rgba(34, 211, 238, 0.15);
  color: var(--brand-primary);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.badge-success {
  background: rgba(52, 211, 153, 0.15);
  color: var(--brand-green);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--brand-red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-amber {
  background: rgba(251, 191, 36, 0.15);
  color: var(--brand-amber);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-purple {
  background: rgba(167, 139, 250, 0.15);
  color: var(--brand-purple);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.badge-cyan {
  background: rgba(34, 211, 238, 0.15);
  color: var(--brand-cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.badge-indigo {
  background: rgba(6, 182, 212, 0.15);
  color: var(--brand-indigo);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* Status dot inside badge */
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   13. Grid & Flex Utilities
   -------------------------------------------------------------------------- */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }


/* --------------------------------------------------------------------------
   14. Spacing Utilities
   -------------------------------------------------------------------------- */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.p-0 { padding: 0; }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }


/* --------------------------------------------------------------------------
   15. Text Utilities
   -------------------------------------------------------------------------- */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--brand-green) !important; }
.text-danger { color: var(--brand-red) !important; }
.text-warning { color: var(--brand-amber) !important; }
.text-info { color: var(--brand-primary) !important; }
.text-purple { color: var(--brand-purple) !important; }
.text-cyan { color: var(--brand-cyan) !important; }

.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.text-lg { font-size: 1.15rem; }
.text-xl { font-size: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-bold { font-weight: 700; }
.text-semibold { font-weight: 600; }
.text-normal { font-weight: 400; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.04em; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* --------------------------------------------------------------------------
   16. Display Utilities
   -------------------------------------------------------------------------- */
.d-none { display: none !important; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.relative { position: relative; }
.absolute { position: absolute; }


/* --------------------------------------------------------------------------
   17. Dividers
   -------------------------------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border-card);
  border: none;
  margin: var(--space-4) 0;
}


/* --------------------------------------------------------------------------
   18. Modal / Dialog
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-mid);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: fadeInUp 0.25s ease;
}

.modal-header {
  padding: var(--space-5) var(--space-5) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
  transition: color var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: var(--space-3) var(--space-5);
}

.modal-footer {
  padding: var(--space-3) var(--space-5) var(--space-5);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}


/* --------------------------------------------------------------------------
   19. Loader / Spinner
   -------------------------------------------------------------------------- */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(34, 211, 238, 0.2);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner--lg { width: 40px; height: 40px; border-width: 4px; }

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 31, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
}


/* --------------------------------------------------------------------------
   20. Empty State
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: 0.875rem;
  max-width: 320px;
  margin: 0 auto var(--space-4);
}


/* --------------------------------------------------------------------------
   21. Notifications — Pulse Dot
   -------------------------------------------------------------------------- */
.notification-dot {
  position: relative;
}

.notification-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-red);
  animation: pulse 2s infinite;
}


/* --------------------------------------------------------------------------
   22. Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Staggered card entrance */
.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.18s; }
.card:nth-child(5) { animation-delay: 0.24s; }
.card:nth-child(6) { animation-delay: 0.30s; }

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.10s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }


/* --------------------------------------------------------------------------
   23. Mobile Responsive (<768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  :root {
    --sidebar-width: 0px;
    --topbar-height: 56px;
  }

  /* Hide desktop sidebar */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 1100;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Sidebar overlay backdrop */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* Topbar adjustments */
  .topbar {
    left: 0;
  }

  .hamburger-btn {
    display: flex;
  }

  /* Main content full width */
  .main-content {
    margin-left: 0;
  }

  .page-body {
    padding: var(--space-4);
  }

  /* Bottom navigation bar */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-topbar);
    backdrop-filter: var(--glass-blur-heavy);
    -webkit-backdrop-filter: var(--glass-blur-heavy);
    border-top: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
    flex: 1;
    text-align: center;
  }

  .bottom-nav-item .icon { font-size: 1.35rem; }

  .bottom-nav-item.active { color: var(--brand-primary); }
  .bottom-nav-item:hover  { color: var(--text-secondary); }

  /* Add bottom padding so content doesn't hide behind bottom nav */
  .main-content {
    padding-bottom: 72px;
  }

  /* Responsive grids */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Table scroll hint */
  .table-wrapper {
    position: relative;
  }

  /* Modal full-width on mobile */
  .modal-content {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  /* Stack card footer buttons */
  .card-footer {
    flex-direction: column;
  }

  .card-footer .btn {
    width: 100%;
  }

  /* Hide on mobile utility */
  .hide-mobile { display: none !important; }

  /* Touch-target enforcement */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .form-control, select.form-control, textarea.form-control { min-height: 44px; font-size: 16px; }
  .form-check input[type="checkbox"],
  .form-check input[type="radio"] { width: 22px; height: 22px; }
}

/* Tablet breakpoint */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Show on mobile only utility */
  .show-mobile-only { display: none !important; }
}

/* Desktop — hide mobile-only elements */
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .sidebar-overlay { display: none !important; }
  .show-mobile-only { display: none !important; }
}

/* Large desktop */
@media (min-width: 1024px) {
  .hide-mobile { display: initial; }
}


/* --------------------------------------------------------------------------
   24. PWA & Safe Areas
   -------------------------------------------------------------------------- */
@supports (padding: env(safe-area-inset-top)) {
  .topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--topbar-height) + env(safe-area-inset-top));
  }

  .main-content {
    padding-top: calc(var(--topbar-height) + env(safe-area-inset-top));
  }

  .sidebar {
    padding-top: env(safe-area-inset-top);
  }
}


/* --------------------------------------------------------------------------
   25. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .sidebar,
  .topbar,
  .bottom-nav,
  .btn,
  .hamburger-btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding-top: 0;
  }

  .card {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: none;
    backdrop-filter: none;
    break-inside: avoid;
  }

  table {
    border: 1px solid #ddd;
  }

  thead th {
    background: #f5f5f5;
    color: #333;
  }

  tbody td {
    color: #333;
    border-bottom: 1px solid #eee;
  }
}

/* ==========================================================================
   PS-PREFIXED CLASSES — Auth, Layout, Components
   Used by Django templates (base.html, base_auth.html, etc.)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Auth Layout (base_auth.html)
   -------------------------------------------------------------------------- */
.ps-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--bg-base) 0%, var(--bg-mid) 45%, #0a1628 100%);
  padding: 24px;
}

.ps-auth-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.ps-auth-brand {
  text-align: center;
  margin-bottom: 8px;
}

.ps-auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.25);
}
.ps-auth-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin: 0 auto 16px;
  display: block;
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.2);
}

.ps-auth-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.ps-auth-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 4px 0 0;
}

.ps-auth-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 32px 28px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.ps-auth-card-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}

.ps-auth-card-desc {
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 0 0 24px;
}

.ps-auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-tertiary);
}

.ps-auth-link {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}
.ps-auth-link:hover {
  text-decoration: underline;
  color: #67e8f9;
}

.ps-auth-company {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.25);
  margin-top: 8px;
}
.ps-auth-company p { margin: 0; }
.ps-auth-company small { font-size: 11px; }

/* --------------------------------------------------------------------------
   Forms (ps-form)
   -------------------------------------------------------------------------- */
.ps-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ps-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ps-form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ps-form-input,
.ps-form-select,
.ps-form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ps-form-input:focus,
.ps-form-select:focus,
.ps-form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.ps-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2322d3ee' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.ps-form-select option {
  background: var(--bg-mid);
  color: #fff;
}

.ps-form-textarea {
  resize: vertical;
  min-height: 80px;
}

.ps-form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.ps-input-with-prefix {
  display: flex;
  align-items: center;
  gap: 0;
}
.ps-input-prefix {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid var(--border-input);
  border-right: none;
  border-radius: 12px 0 0 12px;
  padding: 12px 14px;
  color: var(--text-tertiary);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.ps-input-prefixed {
  border-radius: 0 12px 12px 0;
}

/* --------------------------------------------------------------------------
   Buttons (ps-btn)
   -------------------------------------------------------------------------- */
.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.ps-btn:hover { transform: translateY(-1px); }
.ps-btn:active { transform: translateY(0); }

.ps-btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-indigo));
  color: #fff;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.25);
}
.ps-btn-primary:hover {
  box-shadow: 0 6px 24px rgba(34, 211, 238, 0.35);
}

.ps-btn-success {
  background: linear-gradient(135deg, var(--brand-green), #10b981);
  color: #fff;
}

.ps-btn-danger {
  background: linear-gradient(135deg, var(--brand-red), #dc2626);
  color: #fff;
}

.ps-btn-amber {
  background: linear-gradient(135deg, var(--brand-amber), #f59e0b);
  color: var(--bg-base);
}

.ps-btn-outline {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}
.ps-btn-outline:hover {
  background: rgba(34, 211, 238, 0.06);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.ps-btn-sm { font-size: 13px; padding: 8px 16px; border-radius: 10px; }
.ps-btn-block { width: 100%; }
.ps-btn-ghost { background: transparent; color: var(--brand-primary); padding: 8px 12px; }

/* --------------------------------------------------------------------------
   Alerts / Messages
   -------------------------------------------------------------------------- */
.ps-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.ps-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  transition: opacity 0.3s, transform 0.3s;
}
.ps-alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ps-alert-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
}

.ps-alert-success { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.25); color: var(--brand-green); }
.ps-alert-error, .ps-alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: var(--brand-red); }
.ps-alert-warning { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.25); color: var(--brand-amber); }
.ps-alert-info { background: rgba(34,211,238,0.1); border: 1px solid rgba(34,211,238,0.25); color: var(--brand-primary); }

/* --------------------------------------------------------------------------
   App Layout (base.html) — Sidebar + Topbar + Content
   -------------------------------------------------------------------------- */
.ps-main-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sidebar */
.ps-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width, 250px);
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(34,211,238,0.08);
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
}
/* Custom scrollbar for sidebar */
.ps-sidebar::-webkit-scrollbar { width: 4px; }
.ps-sidebar::-webkit-scrollbar-track { background: transparent; }
.ps-sidebar::-webkit-scrollbar-thumb { background: rgba(34,211,238,0.15); border-radius: 4px; }

.ps-sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 16px 0 12px;
}

.ps-sidebar-brand {
  padding: 4px 16px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ps-sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(34,211,238,0.2);
}

.ps-sidebar-school-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.ps-sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 16px 8px;
}

.ps-sidebar-nav {
  flex: 1;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ps-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  position: relative;
}
.ps-nav-item:hover {
  background: rgba(34,211,238,0.08);
  color: #fff;
}
.ps-nav-item.active {
  background: rgba(34,211,238,0.12);
  color: var(--brand-primary);
  font-weight: 700;
}
.ps-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--brand-primary);
  border-radius: 0 3px 3px 0;
}
.ps-nav-item i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  opacity: 0.8;
}
.ps-nav-item.active i { opacity: 1; }
.ps-nav-item:hover i { opacity: 1; }

.ps-nav-badge {
  margin-left: auto;
  background: var(--brand-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}

/* Nav group labels & dividers */
.ps-nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 14px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ps-nav-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.06);
}
.ps-nav-group-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Color-coded icon tints per group */
.ps-nav-item[data-group="pengurusan"] i { color: rgba(129, 140, 248, 0.9); }
.ps-nav-item[data-group="pengurusan"].active i { color: var(--brand-indigo); }
.ps-nav-item[data-group="pengurusan"].active { color: var(--brand-indigo); }
.ps-nav-item[data-group="pengurusan"].active::before { background: var(--brand-indigo); }

.ps-nav-item[data-group="komunikasi"] i { color: rgba(251, 191, 36, 0.85); }
.ps-nav-item[data-group="komunikasi"].active i { color: var(--brand-amber); }
.ps-nav-item[data-group="komunikasi"].active { color: var(--brand-amber); }
.ps-nav-item[data-group="komunikasi"].active::before { background: var(--brand-amber); }

.ps-nav-item[data-group="akademik"] i { color: rgba(52, 211, 153, 0.85); }
.ps-nav-item[data-group="akademik"].active i { color: var(--brand-green); }
.ps-nav-item[data-group="akademik"].active { color: var(--brand-green); }
.ps-nav-item[data-group="akademik"].active::before { background: var(--brand-green); }

.ps-nav-item[data-group="kewangan"] i { color: rgba(244, 114, 182, 0.85); }
.ps-nav-item[data-group="kewangan"].active i { color: #f472b6; }
.ps-nav-item[data-group="kewangan"].active { color: #f472b6; }
.ps-nav-item[data-group="kewangan"].active::before { background: #f472b6; }

.ps-nav-item[data-group="sistem"] i { color: rgba(148, 163, 184, 0.85); }
.ps-nav-item[data-group="sistem"].active i { color: var(--text-muted); }
.ps-nav-item[data-group="sistem"].active { color: var(--text-secondary); }
.ps-nav-item[data-group="sistem"].active::before { background: var(--text-muted); }

.ps-sidebar-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  padding: 14px 16px 6px;
}

.ps-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  margin-top: auto;
}

/* Sidebar overlay (mobile) */
.ps-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 49;
}
.ps-sidebar-overlay.visible,
.ps-sidebar-overlay.show {
  display: block;
}

/* PintarRPH Promo Card */
.ps-promo-card {
  margin: 12px;
  padding: 16px;
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 16px;
  text-align: center;
}
.ps-promo-icon { font-size: 24px; margin-bottom: 8px; }
.ps-promo-card h4 { font-size: 14px; font-weight: 700; color: var(--brand-amber); margin: 0 0 4px; }
.ps-promo-card p { font-size: 12px; color: var(--text-tertiary); margin: 0 0 10px; line-height: 1.5; }
.ps-promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--brand-amber), #f59e0b);
  color: var(--bg-base);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 100px;
  text-decoration: none;
  transition: transform 0.15s;
}
.ps-promo-btn:hover { transform: translateY(-1px); }

/* Topbar */
.ps-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width, 250px);
  right: 0;
  height: 56px;
  background: var(--bg-topbar);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(34,211,238,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 40;
}

.ps-topbar-left { display: flex; align-items: center; gap: 12px; }
.ps-topbar-right { display: flex; align-items: center; gap: 14px; }

.ps-topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

/* Topbar school identity */
.ps-topbar-school {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ps-topbar-school-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}
.ps-topbar-school-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(34,211,238,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  font-size: 12px;
  flex-shrink: 0;
}
.ps-topbar-school-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.ps-topbar-school-type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand-primary);
  background: rgba(34,211,238,0.1);
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Topbar divider */
.ps-topbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.08);
}

.ps-topbar-icon {
  color: var(--text-tertiary);
  font-size: 17px;
  text-decoration: none;
  position: relative;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.ps-topbar-icon:hover {
  color: var(--brand-primary);
  background: rgba(34,211,238,0.08);
}

.ps-topbar-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--brand-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-topbar);
}

.ps-topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
}
.ps-topbar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}
.ps-topbar-user-info { display: flex; flex-direction: column; }
.ps-topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text-secondary); line-height: 1.2; }
.ps-topbar-user-role { font-size: 11px; color: var(--text-muted); }

.ps-topbar-logout { color: var(--text-muted); }
.ps-topbar-logout:hover { color: var(--brand-red); background: rgba(239,68,68,0.08); }

/* Main content */
.ps-content {
  flex: 1;
  margin-left: var(--sidebar-width, 250px);
  margin-top: 56px;
  padding: 28px 32px 40px;
  max-width: calc(100vw - var(--sidebar-width, 250px));
  overflow-x: hidden;
}

/* Footer */
.ps-footer {
  margin-left: var(--sidebar-width, 250px);
  padding: 24px 32px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.ps-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ps-footer-brand {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}
.ps-footer-brand strong {
  color: rgba(255,255,255,0.5);
}
.ps-footer-copy {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
}
.ps-footer-ssm {
  font-size: 10px;
  color: rgba(255,255,255,0.12);
}
.ps-footer-ssm i {
  font-size: 9px;
}
.ps-footer-links {
  font-size: 11px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ps-footer-links a {
  color: rgba(34,211,238,0.5);
  text-decoration: none;
  transition: color 0.15s;
}
.ps-footer-links a:hover {
  color: var(--brand-primary);
}
.ps-footer-dot {
  color: rgba(255,255,255,0.1);
}

/* Mobile bottom nav */
.ps-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15,11,46,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(34,211,238,0.08);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 50;
  justify-content: space-around;
  align-items: center;
}

.ps-mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 8px;
  min-height: 48px;
  justify-content: center;
}
.ps-mobile-nav-item i { font-size: 20px; }
.ps-mobile-nav-item.active { color: var(--brand-primary); }

/* --------------------------------------------------------------------------
   Radio groups (auth forms)
   -------------------------------------------------------------------------- */
.ps-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-radio-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(34,211,238,0.1);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-tertiary);
  transition: border-color 0.2s, background 0.2s;
}
.ps-radio-group label:hover {
  border-color: rgba(34,211,238,0.25);
  background: rgba(34,211,238,0.04);
}
.ps-radio-group input[type=radio] {
  accent-color: var(--brand-primary);
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   Role cards (register_choice)
   -------------------------------------------------------------------------- */
.ps-role-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
/* Widen auth container when role cards are shown */
.ps-auth-container:has(.ps-role-cards) {
  max-width: 780px;
}
.ps-role-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.ps-role-card:hover {
  border-color: var(--brand-primary);
  background: rgba(34,211,238,0.04);
  transform: translateY(-2px);
}

/* Icon */
.ps-role-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: rgba(34,211,238,0.1);
  color: var(--brand-primary);
}
.ps-role-icon-admin { background: rgba(167,139,250,0.1); color: var(--brand-purple); }
.ps-role-icon-teacher { background: rgba(34,211,238,0.1); color: var(--brand-primary); }
.ps-role-icon-parent { background: rgba(52,211,153,0.1); color: var(--brand-green); }

/* Fallback: bare i inside role-card (no wrapper) */
.ps-role-card > i {
  font-size: 20px;
  color: var(--brand-primary);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34,211,238,0.08);
  border-radius: 12px;
  flex-shrink: 0;
}

.ps-role-title { font-size: 17px; font-weight: 800; color: #fff; margin: 0; }
.ps-role-desc { font-size: 13px; color: var(--text-tertiary); margin: 0; line-height: 1.5; }
.ps-role-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-primary);
  margin-top: 2px;
}
.ps-role-action i { font-size: 12px; }

/* Legacy: h3/p directly inside card */
.ps-role-card h3 { font-size: 17px; font-weight: 800; color: #fff; margin: 0; }
.ps-role-card p { font-size: 13px; color: var(--text-tertiary); margin: 0; line-height: 1.5; }

/* Form note */
.ps-form-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 16px;
  background: rgba(34,211,238,0.04);
  border: 1px solid rgba(34,211,238,0.08);
  border-radius: 12px;
  line-height: 1.5;
}
.ps-form-note i { color: var(--brand-primary); flex-shrink: 0; }

/* Radio options (school type SR/SM) */
.ps-radio-options {
  display: flex;
  gap: 10px;
}
.ps-radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(34,211,238,0.1);
  border-radius: 12px;
  cursor: pointer;
  flex: 1;
  transition: border-color 0.2s, background 0.2s;
}
.ps-radio-option:hover {
  border-color: rgba(34,211,238,0.25);
  background: rgba(34,211,238,0.04);
}
.ps-radio-option input[type=radio] { accent-color: var(--brand-primary); }
.ps-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Mobile responsive — app layout
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .ps-sidebar {
    transform: translateX(-100%);
    width: 280px;
    padding-bottom: 70px;
  }
  .ps-sidebar.open {
    transform: translateX(0);
  }
  .ps-sidebar-overlay.show {
    display: block;
  }
  .ps-topbar {
    left: 0;
  }
  .ps-topbar-toggle {
    display: block;
  }
  .ps-topbar-school-name { font-size: 13px; max-width: 160px; }
  .ps-topbar-school-type { display: none; }
  .ps-topbar-user-info { display: none; }
  .ps-topbar-divider { display: none; }
  .ps-topbar { padding: 0 14px; height: 52px; }
  .ps-topbar-right { gap: 8px; }
  .ps-topbar-icon { width: 30px; height: 30px; font-size: 16px; }

  .ps-content {
    margin-left: 0;
    margin-top: 52px;
    padding: 16px 14px 80px;
    max-width: 100vw;
  }
  .ps-footer {
    margin-left: 0;
    padding-bottom: 80px;
  }

  .ps-desktop-only { display: none !important; }
  .ps-page-title { font-size: 20px; }
  .ps-page-subtitle { font-size: 13px; }

  .ps-dashboard-grid { grid-template-columns: 1fr; gap: 14px; }

  .ps-card-header { padding: 14px 16px 0; }
  .ps-card-header h3 { font-size: 14px; }
  .ps-card-body { padding: 12px 16px 16px; }
  .ps-mobile-nav {
    display: flex;
  }
  .ps-promo-card {
    display: none;
  }

  /* Auth pages — mobile */
  .ps-auth-body {
    padding: 16px;
    align-items: flex-start;
    padding-top: 40px;
  }
  .ps-auth-container {
    max-width: 100%;
    gap: 16px;
  }
  .ps-auth-card {
    padding: 24px 18px;
    border-radius: 20px;
  }
  .ps-auth-logo {
    width: 52px;
    height: 52px;
    font-size: 22px;
    border-radius: 16px;
  }
  .ps-auth-title { font-size: 24px; }
  .ps-auth-card-title { font-size: 20px; }

  /* Role cards — mobile: stack vertically */
  .ps-role-cards { grid-template-columns: 1fr; gap: 10px; }
  .ps-auth-container:has(.ps-role-cards) { max-width: 440px; }
  .ps-role-card {
    padding: 16px;
    gap: 8px;
  }
  .ps-role-icon { width: 38px; height: 38px; font-size: 17px; border-radius: 10px; }
  .ps-role-title { font-size: 15px; }
  .ps-role-desc { font-size: 12px; }

  /* Radio options — stack on very small */
  .ps-radio-options { flex-direction: column; }

  /* Stat grid — single column */
  .ps-stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* --------------------------------------------------------------------------
   Stat cards (dashboard)
   -------------------------------------------------------------------------- */
.ps-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.ps-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 22px 20px;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 16px;
}

.ps-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.ps-stat-icon.blue { background: rgba(34,211,238,0.12); color: var(--brand-primary); }
.ps-stat-icon.green { background: rgba(52,211,153,0.12); color: var(--brand-green); }
.ps-stat-icon.amber { background: rgba(251,191,36,0.12); color: var(--brand-amber); }
.ps-stat-icon.purple { background: rgba(167,139,250,0.12); color: var(--brand-purple); }
.ps-stat-icon.red { background: rgba(239,68,68,0.12); color: var(--brand-red); }

.ps-stat-number { font-size: 28px; font-weight: 800; color: #fff; line-height: 1; }
.ps-stat-label { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }

/* Quick actions */
.ps-quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* Section headers */
.ps-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ps-section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* Data tables */
.ps-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
}
.ps-table {
  width: 100%;
  border-collapse: collapse;
}
.ps-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ps-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ps-table tbody tr:hover {
  background: rgba(34,211,238,0.04);
}

/* Badges */
.ps-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.ps-badge-success { background: rgba(52,211,153,0.12); color: var(--brand-green); }
.ps-badge-danger { background: rgba(239,68,68,0.12); color: var(--brand-red); }
.ps-badge-warning { background: rgba(251,191,36,0.12); color: var(--brand-amber); }
.ps-badge-info { background: rgba(34,211,238,0.12); color: var(--brand-primary); }
.ps-badge-muted { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* PIN display card */
.ps-pin-card {
  background: rgba(251,191,36,0.06);
  border: 2px solid rgba(251,191,36,0.25);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 0 30px rgba(251,191,36,0.06);
}
.ps-pin-card .pin-value {
  font-size: 36px;
  font-weight: 900;
  color: var(--brand-amber);
  letter-spacing: 4px;
  margin: 8px 0;
}

/* Empty state */
.ps-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.ps-empty i { font-size: 40px; margin-bottom: 12px; opacity: 0.3; }
.ps-empty p { font-size: 14px; }

/* ==========================================================================
   Dashboard Components
   ========================================================================== */

/* Alias: templates use ps-stats-grid */
.ps-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
@media (max-width: 768px) {
  .ps-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ps-stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
  }
  .ps-stat-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
  .ps-stat-number { font-size: 22px; }
  .ps-stat-label { font-size: 11px; }
}

/* Stat card color variants (on the card itself) */
.ps-stat-blue .ps-stat-icon { background: rgba(34,211,238,0.12); color: var(--brand-primary); }
.ps-stat-green .ps-stat-icon { background: rgba(52,211,153,0.12); color: var(--brand-green); }
.ps-stat-purple .ps-stat-icon { background: rgba(167,139,250,0.12); color: var(--brand-purple); }
.ps-stat-amber .ps-stat-icon { background: rgba(251,191,36,0.12); color: var(--brand-amber); }
.ps-stat-red .ps-stat-icon { background: rgba(239,68,68,0.12); color: var(--brand-red); }
.ps-stat-info { display: flex; flex-direction: column; }

/* Dashboard grid (2-column on desktop) */
.ps-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) { .ps-dashboard-grid { grid-template-columns: 1fr; gap: 14px; } }

/* Cards */
.ps-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.ps-card-full { grid-column: 1 / -1; }
.ps-card-highlight { border-width: 2px; }

.ps-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}
.ps-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ps-card-header h3 i { font-size: 15px; }
.ps-card-action {
  font-size: 13px;
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}
.ps-card-action:hover { text-decoration: underline; }

.ps-card-body {
  padding: 16px 22px 22px;
}

/* PIN display inside card */
.ps-pin-display { margin: 8px 0; }
.ps-pin-code {
  font-weight: 900;
  letter-spacing: 0.2em;
  line-height: 1;
}

/* Text center */
.ps-text-center { text-align: center; }
.ps-text-muted { color: var(--text-muted); font-size: 13px; }
.ps-mt-2 { margin-top: 8px; }
.ps-mt-3 { margin-top: 16px; }

/* Tags */
.ps-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.ps-tag-amber { background: rgba(251,191,36,0.12); color: var(--brand-amber); }
.ps-tag-red { background: rgba(239,68,68,0.12); color: var(--brand-red); }
.ps-tag-green { background: rgba(52,211,153,0.12); color: var(--brand-green); }

/* Approval items */
.ps-approval-section { margin-bottom: 16px; }
.ps-approval-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ps-approval-list { display: flex; flex-direction: column; gap: 8px; }
.ps-approval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}
.ps-approval-name { font-size: 14px; font-weight: 600; color: #fff; }
.ps-approval-detail { font-size: 12px; color: var(--text-muted); }
.ps-approval-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Empty state (small variant) */
.ps-empty-state { text-align: center; padding: 24px 16px; color: var(--text-muted); }
.ps-empty-state i { font-size: 28px; margin-bottom: 8px; display: block; opacity: 0.4; }
.ps-empty-state p { font-size: 13px; margin: 0; }
.ps-empty-sm { padding: 16px 12px; }
.ps-empty-sm i { font-size: 22px; margin-bottom: 6px; }

/* List items */
.ps-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ps-list-item:last-child { border-bottom: none; }
.ps-list-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(34,211,238,0.08);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.ps-list-item-title { font-size: 14px; font-weight: 600; color: #fff; display: block; }
.ps-list-item-meta { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }

/* Subscription info */
.ps-subscription-info { display: flex; flex-direction: column; gap: 8px; }
.ps-subscription-badge {
  display: inline-flex;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
}
.ps-badge-active { background: rgba(52,211,153,0.12); color: var(--brand-green); }
.ps-badge-expired { background: rgba(239,68,68,0.12); color: var(--brand-red); }
.ps-subscription-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Page header */
.ps-page-header { margin-bottom: 24px; }
.ps-page-title { font-size: 24px; font-weight: 800; color: #fff; margin: 0 0 4px; }
.ps-page-subtitle { font-size: 14px; color: var(--text-tertiary); margin: 0; }

/* Form divider */
.ps-form-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 8px 0;
}

/* --------------------------------------------------------------------------
   27. Sticky Submit Buttons on Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .card-footer:has(.btn-primary),
  .form-actions {
    position: sticky;
    bottom: 56px;
    z-index: 10;
    background: rgba(15, 11, 46, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px var(--space-4);
    margin: 0 calc(var(--space-4) * -1) calc(var(--space-4) * -1);
    border-top: 1px solid var(--border-card);
  }
}

/* --------------------------------------------------------------------------
   28. Skeleton Loaders
   -------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-title { height: 22px; width: 50%; margin-bottom: 14px; border-radius: 6px; }
.skeleton-card { height: 140px; border-radius: var(--radius-lg); margin-bottom: var(--space-3); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   29. Haptic Touch Feedback
   -------------------------------------------------------------------------- */
.btn:active, .ps-btn:active { transform: scale(0.97); transition: transform 0.1s ease; }
.bottom-nav-item:active,
.ps-mobile-nav-item:active { transform: scale(0.93); transition: transform 0.1s ease; }
.card:active, .ps-card:active { transform: scale(0.99); transition: transform 0.15s ease; }

/* --------------------------------------------------------------------------
   30. Card Reveal Animations
   -------------------------------------------------------------------------- */
.card-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.card-reveal.visible { opacity: 1; transform: translateY(0); }
.card-reveal:nth-child(2) { transition-delay: 0.06s; }
.card-reveal:nth-child(3) { transition-delay: 0.12s; }
.card-reveal:nth-child(4) { transition-delay: 0.18s; }
.card-reveal:nth-child(5) { transition-delay: 0.24s; }
.card-reveal:nth-child(6) { transition-delay: 0.30s; }

/* --------------------------------------------------------------------------
   31. Reduced Motion Preference
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton { animation: none; }
  .card-reveal { opacity: 1; transform: none; transition: none; }
}
