/* ============================================================
   PUISI BK — Pusat Sistem Informasi Bimbingan dan Konseling
   Design System: Pink & Purple, Glassmorphism, Premium
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ── */
:root {
  --pink-50:  #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;
  --pink-700: #be185d;

  --purple-50:  #f5f3ff;
  --purple-100: #ede9fe;
  --purple-200: #ddd6fe;
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --purple-700: #6d28d9;
  --purple-900: #4c1d95;

  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --red-500:  #ef4444;
  --red-600:  #dc2626;

  /* Light Mode */
  --bg-primary:    #ffffff;
  --bg-secondary:  #f8f4ff;
  --bg-tertiary:   #f0ebff;
  --surface:       rgba(255, 255, 255, 0.75);
  --surface-hover: rgba(255, 255, 255, 0.92);
  --border:        rgba(139, 92, 246, 0.15);
  --border-hover:  rgba(236, 72, 153, 0.4);
  --text-primary:  #1a1033;
  --text-secondary:#4b3a6e;
  --text-muted:    #8b6aaa;
  --shadow-sm:     0 2px 8px rgba(124, 58, 237, 0.08);
  --shadow-md:     0 8px 32px rgba(124, 58, 237, 0.14);
  --shadow-lg:     0 20px 60px rgba(124, 58, 237, 0.2);
  --shadow-pink:   0 8px 32px rgba(236, 72, 153, 0.25);
  --navbar-bg:     rgba(255, 255, 255, 0.88);
  --card-bg:       rgba(255, 255, 255, 0.8);
  --input-bg:      rgba(248, 244, 255, 0.9);
  --modal-bg:      rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
  --bg-primary:    #0d0816;
  --bg-secondary:  #130f23;
  --bg-tertiary:   #1a1433;
  --surface:       rgba(30, 20, 55, 0.75);
  --surface-hover: rgba(45, 30, 75, 0.92);
  --border:        rgba(139, 92, 246, 0.25);
  --border-hover:  rgba(236, 72, 153, 0.5);
  --text-primary:  #f0ebff;
  --text-secondary:#c4b5fd;
  --text-muted:    #7c6faa;
  --shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md:     0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg:     0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-pink:   0 8px 32px rgba(236, 72, 153, 0.35);
  --navbar-bg:     rgba(13, 8, 22, 0.9);
  --card-bg:       rgba(25, 16, 50, 0.8);
  --input-bg:      rgba(20, 12, 40, 0.9);
  --modal-bg:      rgba(22, 14, 42, 0.96);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Background Gradient Orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: orbFloat 8s ease-in-out infinite;
}

[data-theme="dark"] .orb { opacity: 0.2; }

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--purple-500), transparent);
  top: -200px; right: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--pink-500), transparent);
  bottom: -150px; left: -150px;
  animation-delay: 3s;
}

.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, var(--gold-400), transparent);
  top: 40%; left: 30%;
  animation-delay: 6s;
  opacity: 0.06;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  box-shadow: var(--shadow-pink);
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  flex-shrink: 0;
}

.navbar-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.navbar-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.navbar-center {
  flex: 1;
  max-width: 400px;
}

.search-bar {
  position: relative;
  width: 100%;
}

.search-bar input {
  width: 100%;
  height: 40px;
  padding: 0 5.5rem 0 2.5rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar input:focus {
  border-color: var(--pink-500);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.12);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.search-kbd-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.search-kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: inherit;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.search-kbd-btn:hover .search-kbd {
  border-color: var(--pink-500);
  color: var(--pink-600);
  background: rgba(236, 72, 153, 0.1);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

/* ── Admin Toggle Button in Navbar ── */
.btn-admin-toggle {
  padding: 0.48rem 0.95rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  position: relative;
}

.btn-admin-toggle:hover {
  border-color: var(--pink-500);
  color: var(--pink-600);
  transform: translateY(-1px);
}

.btn-admin-toggle.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(124, 58, 237, 0.15));
  border-color: var(--pink-500);
  color: var(--pink-600);
}

[data-theme="dark"] .btn-admin-toggle.active {
  color: var(--pink-400);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(124, 58, 237, 0.25));
}

.admin-active-dot {
  display: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

.btn-admin-toggle.active .admin-active-dot {
  display: inline-block;
}

.btn-install {
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--shadow-pink);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.4);
}

.btn-theme {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.btn-theme:hover {
  border-color: var(--pink-500);
  color: var(--pink-500);
  transform: rotate(20deg);
}

/* ── Main Layout ── */
main {
  position: relative;
  z-index: 1;
  padding-top: 66px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Hero Section ── */
.hero {
  position: relative;
  padding: 4.8rem 0 3.8rem;
  text-align: center;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(236,72,153,0.1), rgba(124,58,237,0.1));
  border: 1px solid rgba(236,72,153,0.25);
  color: var(--pink-600);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.3rem;
  animation: fadeInDown 0.6s ease both;
}

[data-theme="dark"] .hero-badge {
  color: var(--pink-400);
  background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(124,58,237,0.15));
  border-color: rgba(236,72,153,0.35);
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pink-500);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.5); }
}

.hero h2 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.18;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero h2 .gradient-text {
  background: linear-gradient(135deg, var(--pink-500) 0%, var(--purple-500) 60%, var(--gold-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0.75rem auto 0;
  line-height: 1.7;
  animation: fadeInUp 0.7s ease 0.2s both;
}

/* ── Hero Decorations ── */
.hero-deco {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.deco-geo {
  position: absolute;
  opacity: 0.12;
}

[data-theme="dark"] .deco-geo { opacity: 0.18; }

.deco-left {
  left: 3%;
  top: 10%;
  width: 220px;
  animation: geoSpin 20s linear infinite;
}

.deco-right {
  right: 3%;
  top: 5%;
  width: 250px;
  animation: geoSpin 25s linear infinite reverse;
}

@keyframes geoSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.floating-dots {
  position: absolute;
  inset: 0;
}

.fdot {
  position: absolute;
  border-radius: 50%;
  background: var(--pink-400);
  animation: floatDot 6s ease-in-out infinite;
}

.fdot:nth-child(1)  { width:6px; height:6px; top:20%; left:15%; animation-delay:0s;   background:var(--pink-400); }
.fdot:nth-child(2)  { width:4px; height:4px; top:70%; left:10%; animation-delay:1s;   background:var(--purple-400); }
.fdot:nth-child(3)  { width:8px; height:8px; top:30%; right:18%; animation-delay:2s;  background:var(--gold-400); }
.fdot:nth-child(4)  { width:5px; height:5px; top:75%; right:12%; animation-delay:3s;  background:var(--pink-500); }
.fdot:nth-child(5)  { width:6px; height:6px; top:50%; left:5%;  animation-delay:4s;  background:var(--purple-400); }

@keyframes floatDot {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%       { transform: translateY(-15px); opacity: 1; }
}

/* ── Stats Row ── */
.stats-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-top: 2.8rem;
  animation: fadeInUp 0.7s ease 0.35s both;
}

.stat-item {
  text-align: center;
  padding: 0 2.5rem;
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0; top: 15%; bottom: 15%;
  width: 1px;
  background: var(--border);
}

.stat-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  display: block;
}

/* ── Apps Section ── */
.apps-section {
  padding: 1.5rem 0 5rem;
}

/* ── Section Heading & Controls Wrap ── */
.section-heading-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-heading h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-heading p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.section-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── View Mode Switcher ── */
.view-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 3px;
  border-radius: 50px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  gap: 2px;
}

.btn-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.8rem;
  border-radius: 50px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn-view-mode .view-mode-icon {
  font-size: 0.85rem;
}

.btn-view-mode:hover {
  color: var(--pink-600);
  background: rgba(236, 72, 153, 0.08);
}

.btn-view-mode.active {
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  color: #fff;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

[data-theme="dark"] .btn-view-mode:hover {
  color: var(--pink-400);
  background: rgba(236, 72, 153, 0.15);
}

/* ── Favorites Quick Dock ── */
.favorites-dock {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(236, 72, 153, 0.06));
  border: 1.5px solid rgba(251, 191, 36, 0.3);
  border-radius: 18px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
  animation: fadeInDown 0.4s ease both;
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.08);
}

[data-theme="dark"] .favorites-dock {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(236, 72, 153, 0.1));
  border-color: rgba(251, 191, 36, 0.35);
}

.favorites-dock-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.favorites-dock-icon {
  font-size: 1rem;
}

.favorites-dock-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.favorites-dock-badge {
  background: var(--gold-500);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 50px;
}

.favorites-dock-items {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.favorite-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorite-chip:hover {
  border-color: var(--gold-400);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.25);
  background: var(--surface-hover);
}

.favorite-chip .chip-icon {
  font-size: 0.95rem;
}

/* ── Admin Toolbar ── */
.admin-toolbar {
  display: none; /* activated when admin is logged in */
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.65rem;
  background: linear-gradient(135deg, rgba(236,72,153,0.08), rgba(124,58,237,0.08));
  border: 1.5px solid var(--border-hover);
  border-radius: 50px;
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.4s ease both;
}

.admin-toolbar.active {
  display: flex;
}

.btn-admin-action {
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-admin-action:hover {
  transform: translateY(-1px);
  border-color: var(--pink-500);
  color: var(--pink-600);
}

.btn-add-app {
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  color: #fff;
  border: none;
  box-shadow: var(--shadow-pink);
}

.btn-add-app:hover {
  color: #fff;
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4);
}

.btn-logout-admin:hover {
  border-color: var(--red-500);
  color: var(--red-500);
}

/* ── Category Tabs ── */
.category-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease both;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.tab-btn .tab-icon {
  font-size: 0.9rem;
}

.tab-btn .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 50px;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  border-color: var(--pink-500);
  color: var(--pink-600);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-pink);
}

.tab-btn.active .tab-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

[data-theme="dark"] .tab-btn:hover { color: var(--pink-400); }

/* ============================================================
   APPS DISPLAY MODES (BENTO, LIST, TILES)
   ============================================================ */

/* ── 1. Bento Grid View (Default) ── */
.apps-grid.view-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
}

.app-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  animation: cardIn 0.5s ease both;
  display: flex;
  flex-direction: column;
}

/* Ambient dynamic mouse glow highlight */
.app-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(236,72,153,0.12), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

.app-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: var(--border-hover);
  box-shadow: 0 16px 40px rgba(124, 58, 237, 0.16);
}

.app-card:hover::before { opacity: 1; }

/* Category-specific glowing borders on hover */
.app-card[data-category="akademik"]:hover { border-color: rgba(99, 102, 241, 0.5); box-shadow: 0 16px 40px rgba(99, 102, 241, 0.18); }
.app-card[data-category="konseling"]:hover { border-color: rgba(245, 158, 11, 0.5); box-shadow: 0 16px 40px rgba(245, 158, 11, 0.18); }
.app-card[data-category="perpus"]:hover { border-color: rgba(16, 185, 129, 0.5); box-shadow: 0 16px 40px rgba(16, 185, 129, 0.18); }
.app-card[data-category="administrasi"]:hover { border-color: rgba(6, 182, 212, 0.5); box-shadow: 0 16px 40px rgba(6, 182, 212, 0.18); }
.app-card[data-category="lainnya"]:hover { border-color: rgba(236, 72, 153, 0.5); box-shadow: 0 16px 40px rgba(236, 72, 153, 0.18); }

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

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.app-icon {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-card:hover .app-icon {
  transform: scale(1.08) rotate(3deg);
}

.btn-fav {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.btn-fav:hover, .btn-fav.active {
  border-color: var(--gold-400);
  color: var(--gold-500);
  background: rgba(251, 191, 36, 0.15);
  transform: scale(1.1);
}

/* Card Admin Action Buttons */
.card-admin-actions {
  display: none;
  align-items: center;
  gap: 0.3rem;
}

body.admin-mode-active .card-admin-actions {
  display: flex;
}

.btn-card-action {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.btn-card-move:hover {
  border-color: var(--pink-500);
  color: var(--pink-600);
  background: rgba(236, 72, 153, 0.12);
}

.btn-card-edit:hover {
  border-color: var(--purple-500);
  color: var(--purple-600);
  background: rgba(139, 92, 246, 0.12);
}

.btn-card-delete:hover {
  border-color: var(--red-500);
  color: var(--red-500);
  background: rgba(239, 68, 68, 0.12);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.badge-category {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-akademik   { background: rgba(99,102,241,0.14); color: #6366f1; border: 1px solid rgba(99,102,241,0.25); }
.badge-konseling  { background: rgba(245,158,11,0.14); color: #d97706; border: 1px solid rgba(245,158,11,0.25); }
.badge-perpus     { background: rgba(16,185,129,0.14); color: #059669; border: 1px solid rgba(16,185,129,0.25); }
.badge-administrasi { background: rgba(6,182,212,0.14); color: #0891b2; border: 1px solid rgba(6,182,212,0.25); }
.badge-lainnya    { background: rgba(236,72,153,0.14); color: #db2777; border: 1px solid rgba(236,72,153,0.25); }

[data-theme="dark"] .badge-akademik   { color: #818cf8; border-color: rgba(99,102,241,0.35); }
[data-theme="dark"] .badge-konseling  { color: #fbbf24; border-color: rgba(245,158,11,0.35); }
[data-theme="dark"] .badge-perpus     { color: #34d399; border-color: rgba(16,185,129,0.35); }
[data-theme="dark"] .badge-administrasi { color: #22d3ee; border-color: rgba(6,182,212,0.35); }
[data-theme="dark"] .badge-lainnya    { color: #f472b6; border-color: rgba(236,72,153,0.35); }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
}

.status-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.status-online  { color: #059669; }
.status-online::before  { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.25); animation: pulse 2s infinite; }
.status-offline { color: var(--text-muted); }
.status-offline::before { background: var(--text-muted); }

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.card-subtitle {
  font-size: 0.74rem;
  color: var(--pink-600);
  font-weight: 600;
  margin-bottom: 0.65rem;
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .card-subtitle { color: var(--pink-400); }

.card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: auto;
  position: relative;
  z-index: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.3rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.btn-open {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.15rem;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-open span {
  transition: transform 0.25s ease;
}

.btn-open:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.5);
}

.btn-open:hover span {
  transform: translate(2px, -2px);
}

.btn-open-offline {
  background: linear-gradient(135deg, #64748b, #475569) !important;
  box-shadow: 0 4px 15px rgba(100, 116, 139, 0.3) !important;
}

.card-visits {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

/* ── 2. Compact List View ── */
.apps-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.apps-grid.view-list .app-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.35rem;
  border-radius: 16px;
  gap: 1.25rem;
}

.apps-grid.view-list .card-header {
  margin-bottom: 0;
  gap: 1rem;
  align-items: center;
  flex-shrink: 0;
}

.apps-grid.view-list .app-icon {
  width: 44px; height: 44px;
  font-size: 1.3rem;
  border-radius: 12px;
}

.apps-grid.view-list .list-main-info {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  flex: 1;
}

.apps-grid.view-list .card-title {
  font-size: 1rem;
  margin-bottom: 0;
}

.apps-grid.view-list .card-subtitle {
  font-size: 0.72rem;
  margin-bottom: 0;
}

.apps-grid.view-list .card-desc {
  display: none; /* hidden in compact list */
}

.apps-grid.view-list .card-meta {
  margin-bottom: 0;
  flex-shrink: 0;
}

.apps-grid.view-list .card-footer {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  gap: 1rem;
  flex-shrink: 0;
}

/* ── 3. Tiles / Launchpad View ── */
.apps-grid.view-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.1rem;
}

.apps-grid.view-tiles .app-card {
  align-items: center;
  text-align: center;
  padding: 1.4rem 1rem 1.1rem;
  border-radius: 20px;
}

.apps-grid.view-tiles .card-header {
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.6rem;
  width: 100%;
}

.apps-grid.view-tiles .app-icon {
  width: 60px; height: 60px;
  font-size: 1.85rem;
  border-radius: 18px;
  margin-bottom: 0.5rem;
}

.apps-grid.view-tiles .card-header-actions {
  position: absolute;
  top: 0; right: 0;
}

.apps-grid.view-tiles .card-title {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.apps-grid.view-tiles .card-subtitle {
  font-size: 0.68rem;
  margin-bottom: 0.4rem;
}

.apps-grid.view-tiles .card-desc {
  display: none;
}

.apps-grid.view-tiles .card-footer {
  width: 100%;
  flex-direction: column;
  gap: 0.5rem;
  border-top: none;
  margin-top: 0.6rem;
  padding-top: 0;
}

.apps-grid.view-tiles .btn-open {
  width: 100%;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  font-size: 0.74rem;
}

/* ── Spotlight Command Palette Modal ── */
.modal-spotlight-overlay {
  align-items: flex-start;
  padding-top: 10vh;
}

.spotlight-box {
  width: 100%;
  max-width: 620px;
  background: var(--modal-bg);
  border: 1.5px solid var(--border-hover);
  border-radius: 22px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(236,72,153,0.25);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.spotlight-search-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}

.spotlight-search-icon {
  font-size: 1.25rem;
  color: var(--pink-500);
}

.spotlight-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.spotlight-input::placeholder {
  color: var(--text-muted);
}

.spotlight-esc-kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spotlight-esc-kbd:hover {
  border-color: var(--pink-500);
  color: var(--pink-600);
}

.spotlight-category-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

[data-theme="dark"] .spotlight-category-pills {
  background: rgba(255, 255, 255, 0.02);
}

.spotlight-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.spotlight-pill:hover, .spotlight-pill.active {
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  border-color: transparent;
  color: #fff;
}

.spotlight-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 0.5rem;
}

.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  margin-bottom: 3px;
}

.spotlight-item:hover, .spotlight-item.active {
  background: linear-gradient(135deg, rgba(236,72,153,0.12), rgba(124,58,237,0.12));
  transform: translateX(4px);
}

.spotlight-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.spotlight-item-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.spotlight-item-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.spotlight-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.4rem;
  background: rgba(0, 0, 0, 0.04);
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

[data-theme="dark"] .spotlight-footer {
  background: rgba(255, 255, 255, 0.02);
}

.spotlight-hint {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.spotlight-hint kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}

.spotlight-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--pink-500);
}

/* ── Empty State ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  display: none;
}

.empty-state.visible { display: block; }

.empty-emoji { font-size: 3rem; margin-bottom: 1rem; display: block; }
.empty-state h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}
.empty-state p { font-size: 0.85rem; color: var(--text-muted); }

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  padding: 2rem;
  text-align: center;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.footer-logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}

.footer-logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

footer span {
  color: var(--pink-500);
}

/* ============================================================
   MODALS SYSTEM
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(13, 8, 22, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--modal-bg);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-box {
  transform: scale(1) translateY(0);
}

.modal-box-sm { max-width: 440px; }
.modal-box-lg { max-width: 620px; }

.modal-header {
  padding: 1.5rem 1.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(124,58,237,0.15));
  border: 1px solid rgba(236,72,153,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.modal-icon-badge-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.modal-title-group h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.modal-title-group p {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.btn-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-modal-close:hover {
  color: var(--pink-500);
  border-color: var(--pink-500);
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem 1.75rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.col-span-2 {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group label .req {
  color: var(--pink-500);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.25s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--pink-500);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 75px;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.form-hint code {
  background: rgba(139,92,246,0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
  color: var(--pink-600);
}

[data-theme="dark"] .form-hint code { color: var(--pink-400); }

.text-danger {
  color: var(--red-500);
}

.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap input {
  padding-right: 2.8rem;
}

.btn-toggle-eye {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.btn-toggle-eye:hover { opacity: 1; }

.auth-error-msg {
  display: none;
  font-size: 0.75rem;
  color: var(--red-500);
  font-weight: 600;
  margin-top: 0.35rem;
}

.auth-error-msg.visible {
  display: block;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Emoji Presets */
.emoji-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.emoji-input-wrap input {
  max-width: 90px;
  text-align: center;
  font-size: 1.25rem;
}

.emoji-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-emoji-preset {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-emoji-preset:hover {
  transform: scale(1.15);
  border-color: var(--pink-500);
}

/* Color Presets */
.color-presets {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.color-preset-item {
  cursor: pointer;
  position: relative;
}

.color-preset-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-swatch {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.color-preset-item input[type="radio"]:checked + .color-swatch {
  border-color: var(--text-primary);
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--pink-500);
}

/* Modal Buttons */
.modal-footer {
  padding: 1.2rem 1.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
}

.btn-secondary {
  padding: 0.55rem 1.25rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--pink-500);
  color: var(--pink-600);
}

.btn-primary {
  padding: 0.55rem 1.35rem;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, var(--pink-500), var(--purple-600));
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-pink);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4);
}

.btn-danger {
  padding: 0.55rem 1.35rem;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.45);
}

.delete-confirm-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 0.85rem 1.25rem;
  border-radius: 16px;
  background: var(--modal-bg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  backdrop-filter: blur(16px);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: all 0.3s ease;
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateX(30px);
}

.toast-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast-error   { border-color: rgba(239, 68, 68, 0.4); }
.toast-info    { border-color: rgba(139, 92, 246, 0.4); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Animations ── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--pink-500), var(--purple-600));
  border-radius: 3px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .apps-grid { grid-template-columns: repeat(2, 1fr); }
  .deco-left, .deco-right { display: none; }
}

@media (max-width: 620px) {
  .apps-grid { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  .hero { padding: 3.5rem 0 2.5rem; }
  .stats-row { gap: 0; }
  .stat-item { padding: 0 1.2rem; }
  .stat-number { font-size: 1.6rem; }
  .navbar-text { display: none; }
  .btn-install span { display: none; }
  .btn-admin-toggle span:not(.admin-icon):not(.admin-active-dot) { display: none; }
  .navbar-center { max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .modal-box { border-radius: 20px; }
  .modal-header, .modal-body, .modal-footer { padding-left: 1.2rem; padding-right: 1.2rem; }
  .toast-container { right: 1rem; left: 1rem; bottom: 1rem; }
}

.btn-open-offline {
  background: linear-gradient(135deg, var(--purple-400), var(--pink-400)) !important;
  box-shadow: 0 4px 15px rgba(167, 139, 250, 0.3) !important;
}

.btn-open-offline:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.45) !important;
}

/* ============================================================
   CARD DRAG & REORDER STYLES
   ============================================================ */
body.admin-mode-active .app-card {
  cursor: grab;
  user-select: none;
}

body.admin-mode-active .app-card:active {
  cursor: grabbing;
}

.app-card.card-dragging {
  opacity: 0.4;
  transform: scale(0.96);
  border-style: dashed !important;
  border-color: var(--pink-500) !important;
}

.app-card.card-drag-over {
  border-color: var(--pink-500) !important;
  box-shadow: 0 0 0 2px var(--pink-500), var(--shadow-md) !important;
  transform: translateY(-6px);
}

.btn-card-move:hover {
  border-color: var(--gold-500) !important;
  color: var(--gold-500) !important;
  background: rgba(245, 158, 11, 0.12) !important;
  transform: scale(1.1);
}

/* ── Modal Reorder List ── */
.reorder-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.reorder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  transition: all 0.2s ease;
  cursor: grab;
}

.reorder-item:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateX(2px);
}

.reorder-item.reorder-dragging {
  opacity: 0.35;
  border-style: dashed;
  border-color: var(--pink-500);
}

.reorder-item.reorder-drag-over {
  border-color: var(--pink-500);
  background: rgba(236, 72, 153, 0.08);
  transform: scale(1.01);
}

.reorder-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.reorder-handle {
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: grab;
  user-select: none;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
  letter-spacing: -2px;
}

.reorder-item:hover .reorder-handle {
  opacity: 1;
  color: var(--pink-500);
}

.reorder-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 22px;
  text-align: center;
}

.reorder-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.reorder-details {
  min-width: 0;
  flex: 1;
}

.reorder-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reorder-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.reorder-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-reorder-move {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-reorder-move:hover:not(:disabled) {
  border-color: var(--pink-500);
  color: var(--pink-600);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.btn-reorder-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.reorder-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

