/* ==========================================
   KONFLUENZ NOTES — DESIGN SYSTEM & TOKENS
   ========================================== */

/* Color Palette and Root Variable tokens */
:root {
  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* HSL Tailored Color Schemes - Dark Mode (Default) */
  --bg-primary-hsl: 222, 47%, 11%;     /* #0f172a */
  --bg-secondary-hsl: 222, 47%, 15%;   /* #1e293b */
  --bg-tertiary-hsl: 223, 47%, 20%;    /* #334155 */
  --text-primary-hsl: 210, 40%, 98%;   /* #f8fafc */
  --text-secondary-hsl: 215, 20%, 75%; /* #94a3b8 */
  --text-muted-hsl: 215, 15%, 50%;     /* #64748b */

  --accent-indigo: 239, 84%, 67%;     /* #6366f1 (Primary View/Nav) */
  --accent-emerald: 161, 84%, 43%;    /* #10b981 (Create Note) */
  --accent-amber: 37, 90%, 50%;       /* #f59e0b (Edit Note) */
  --accent-rose: 343, 84%, 58%;       /* #f43f5e (Delete Note) */
  --accent-cyan: 188, 86%, 43%;       /* #06b6d4 (Secondary Actions) */

  /* Shadows and Borders */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px -3px hsla(var(--accent-indigo), 0.3);
  
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-round: 9999px;

  --border-color: hsla(217, 30%, 30%, 0.4);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables Overrides */
html[data-theme="light"] {
  --bg-primary-hsl: 210, 40%, 98%;     /* #f8fafc */
  --bg-secondary-hsl: 0, 0%, 100%;     /* #ffffff */
  --bg-tertiary-hsl: 214, 32%, 91%;    /* #e2e8f0 */
  --text-primary-hsl: 222, 47%, 11%;   /* #0f172a */
  --text-secondary-hsl: 217, 20%, 35%; /* #475569 */
  --text-muted-hsl: 215, 16%, 47%;     /* #64748b */

  --border-color: hsla(214, 32%, 91%, 0.8);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(0, 0, 0, 0.06);
  
  --shadow-glow: 0 0 15px -3px hsla(var(--accent-indigo), 0.15);
}

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

body {
  font-family: var(--font-body);
  background-color: hsl(var(--bg-primary-hsl));
  color: hsl(var(--text-primary-hsl));
  overflow-x: hidden;
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.025em;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: hsl(var(--bg-primary-hsl));
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--bg-tertiary-hsl));
  border-radius: var(--border-radius-round);
}
::-webkit-scrollbar-thumb:hover {
  background: hsla(var(--text-muted-hsl), 0.6);
}

/* Utility Helpers */
.hidden { display: none !important; }
.text-gradient {
  background: linear-gradient(135deg, hsl(var(--accent-indigo)), hsl(var(--accent-cyan)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-emerald { color: hsl(var(--accent-emerald)) !important; }
.text-indigo { color: hsl(var(--accent-indigo)) !important; }
.text-amber { color: hsl(var(--accent-amber)) !important; }
.text-rose { color: hsl(var(--accent-rose)) !important; }
.text-cyan { color: hsl(var(--accent-cyan)) !important; }

/* ==========================================
   APP SHELL / LOADING SPLASH SCREEN
   ========================================== */
.global-loader {
  position: fixed;
  inset: 0;
  background-color: hsl(222, 47%, 11%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity var(--transition-slow);
}
.loader-content {
  text-align: center;
}
.loader-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px auto;
}
.logo-svg-animation {
  width: 100%;
  height: 100%;
  animation: logoPulse 2s infinite ease-in-out;
}
@keyframes logoPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; filter: drop-shadow(0 0 15px hsla(var(--accent-indigo), 0.6)); }
}
.loader-content h2 {
  font-family: var(--font-heading);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* ==========================================
   LANDING PAGE LAYOUT
   ========================================== */
.landing-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: hsl(222, 47%, 11%);
  color: #f8fafc;
  overflow: hidden;
}

/* Animated Neon Background Mesh Grid */
.hero-mesh {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(at 10% 20%, hsla(var(--accent-indigo), 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 10%, hsla(var(--accent-cyan), 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 80%, hsla(var(--accent-rose), 0.1) 0px, transparent 50%);
  filter: blur(80px);
  z-index: 1;
}

.landing-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo-svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 4px 10px rgba(99, 102, 241, 0.4));
}
.brand-name {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: hsl(var(--text-primary-hsl));
}
.landing-page .brand-name {
  color: #ffffff;
}

.landing-header-actions {
  display: flex;
  gap: 16px;
}

/* Button Classes */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}
.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, hsl(var(--accent-indigo)), hsl(244, 79%, 60%));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5), var(--shadow-glow);
}

.btn-secondary {
  background-color: hsla(222, 47%, 20%, 0.6);
  border: 1px solid var(--border-color);
  color: hsl(var(--text-primary-hsl));
}
.btn-secondary:hover {
  background-color: hsl(var(--bg-tertiary-hsl));
  transform: translateY(-2px);
}

/* Light Theme Overrides for Secondary Buttons */
html[data-theme="light"] .btn-secondary {
  background-color: hsl(var(--bg-secondary-hsl));
  border: 1px solid var(--border-color);
  color: hsl(var(--text-secondary-hsl));
  box-shadow: var(--shadow-sm);
}
html[data-theme="light"] .btn-secondary:hover {
  background-color: hsl(var(--bg-tertiary-hsl));
  color: hsl(var(--text-primary-hsl));
  border-color: hsla(var(--accent-indigo), 0.3);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.btn-success {
  background: linear-gradient(135deg, hsl(var(--accent-emerald)), #059669);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, hsl(var(--accent-amber)), #d97706);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}
.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, hsl(var(--accent-rose)), #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.4);
}

.btn-ghost {
  color: hsl(var(--text-secondary-hsl));
}
.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

/* Hero Section */
.hero-section {
  position: relative;
  z-index: 10;
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 64px;
  padding: 48px 64px;
  max-width: 1440px;
  margin: 0 auto;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: var(--border-radius-round);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}
.badge-accent {
  background-color: hsla(var(--accent-indigo), 0.15);
  color: hsl(var(--accent-indigo));
  border: 1px solid hsla(var(--accent-indigo), 0.3);
}
.badge-success {
  background-color: hsla(var(--accent-emerald), 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: hsl(var(--text-secondary-hsl));
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 580px;
}

.hero-ctas {
  display: flex;
  gap: 20px;
}

/* Visual UI Showcase Mockup */
.hero-visual {
  position: relative;
  width: 100%;
}
.visual-card-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, hsla(var(--accent-indigo), 0.4) 0%, transparent 70%);
  filter: blur(20px);
  z-index: 1;
}
.visual-card {
  position: relative;
  z-index: 2;
  background-color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg), 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
  transition: transform 0.5s ease;
}
.visual-card:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}
.card-header {
  background-color: #0f172a;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dots {
  display: flex;
  gap: 6px;
}
.dots span {
  width: 10px;
  height: 10px;
  border-radius: var(--border-radius-round);
}
.dots span:nth-child(1) { background-color: #ef4444; }
.dots span:nth-child(2) { background-color: #f59e0b; }
.dots span:nth-child(3) { background-color: #10b981; }

.tab {
  background-color: #1e293b;
  padding: 6px 14px;
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: #f8fafc;
}

.card-body-preview {
  padding: 24px;
}
.preview-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.card-body-preview h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}
.premium-calc-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--border-radius-md);
  padding: 16px;
  margin-bottom: 20px;
}
.calc-header {
  font-size: 0.85rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.calc-row:last-child { margin-bottom: 0; }
.preview-code {
  background-color: #0f172a;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
  overflow-x: auto;
}

/* Features Grid */
.features-section {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 80px 64px;
  max-width: 1440px;
  margin: 0 auto;
}
.feature-card {
  background-color: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 32px;
  transition: all var(--transition-normal);
}
.feature-card:hover {
  background-color: rgba(30, 41, 59, 0.6);
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-md);
}
.feature-card .icon {
  font-size: 2.25rem;
  margin-bottom: 20px;
}
.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}
.feature-card p {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* ==========================================
   AUTHENTICATION VIEW / OVERLAY
   ========================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.glass {
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  border-radius: var(--border-radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-lg), 0 25px 50px -12px rgba(0,0,0,0.5);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 2rem;
  color: hsl(var(--text-muted-hsl));
  transition: color var(--transition-fast);
}
.auth-close-btn:hover { color: hsl(var(--text-primary-hsl)); }

.auth-logo-svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px auto;
  display: block;
}
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}
.auth-header h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}
.auth-header p {
  font-size: 0.95rem;
  color: hsl(var(--text-secondary-hsl));
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--text-secondary-hsl));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: hsl(var(--bg-primary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: hsl(var(--text-primary-hsl));
  transition: all var(--transition-fast);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: hsl(var(--accent-indigo));
  box-shadow: 0 0 0 3px hsla(var(--accent-indigo), 0.15);
}
.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.password-input-wrapper {
  position: relative;
  width: 100%;
}
.password-input-wrapper input {
  padding-right: 48px;
}
.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--text-muted-hsl));
}

.auth-error {
  background-color: hsla(var(--accent-rose), 0.15);
  border: 1px solid hsla(var(--accent-rose), 0.3);
  color: hsl(var(--accent-rose));
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.9rem;
  color: hsl(var(--text-secondary-hsl));
}
.link-btn {
  background: none;
  border: none;
  color: hsl(var(--accent-indigo));
  font-weight: 600;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* ==========================================
   MAIN DASHBOARD LAYOUT & SIDEBAR
   ========================================== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
  background-color: hsl(var(--bg-secondary-hsl));
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: background-color var(--transition-normal);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.user-profile {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, hsl(var(--accent-indigo)), hsl(var(--accent-cyan)));
  color: #ffffff;
  border-radius: var(--border-radius-round);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.user-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.user-email {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.75rem;
  color: hsl(var(--text-muted-hsl));
}
.btn-logout-icon {
  color: hsl(var(--text-muted-hsl));
  padding: 4px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}
.btn-logout-icon:hover {
  color: hsl(var(--accent-rose));
  background-color: hsla(var(--accent-rose), 0.1);
}

.sidebar-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-section h4 {
  font-size: 0.75rem;
  font-weight: 700;
  color: hsl(var(--text-muted-hsl));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-title-row h4 { margin-bottom: 0; }

.icon-btn-sm {
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--border-radius-sm);
  background-color: var(--border-color);
  font-size: 0.8rem;
  color: hsl(var(--text-secondary-hsl));
}
.icon-btn-sm:hover {
  background-color: hsl(var(--accent-indigo));
  color: #ffffff;
}

/* Spaces list styling */
.spaces-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spaces-list li {
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: hsl(var(--text-secondary-hsl));
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.spaces-list li:hover {
  background-color: hsl(var(--bg-tertiary-hsl));
  color: hsl(var(--text-primary-hsl));
}
.spaces-list li.active {
  background-color: hsla(var(--accent-indigo), 0.15);
  color: hsl(var(--accent-indigo));
  font-weight: 600;
}
.space-list-meta-info {
  font-size: 0.7rem;
  background-color: var(--border-color);
  padding: 2px 6px;
  border-radius: var(--border-radius-round);
}

/* Nav Filters */
.nav-filters {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-filters li {
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  color: hsl(var(--text-secondary-hsl));
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.nav-filters li:hover {
  background-color: hsl(var(--bg-tertiary-hsl));
  color: hsl(var(--text-primary-hsl));
}
.nav-filters li.active {
  background-color: var(--border-color);
  color: hsl(var(--text-primary-hsl));
  font-weight: 600;
}
.nav-filters li .count-badge {
  margin-left: auto;
  font-size: 0.75rem;
  background-color: var(--border-color);
  padding: 2px 8px;
  border-radius: var(--border-radius-round);
  font-weight: 500;
}

/* Categories side-list */
.categories-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.categories-list li {
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.categories-list li:hover {
  background-color: hsl(var(--bg-tertiary-hsl));
}
.categories-list li.active {
  background-color: var(--border-color);
  font-weight: 600;
}
.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--border-radius-round);
}

/* Tags cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-pill {
  font-size: 0.75rem;
  padding: 4px 10px;
  background-color: var(--border-color);
  color: hsl(var(--text-secondary-hsl));
  border-radius: var(--border-radius-round);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.tag-pill:hover, .tag-pill.active {
  background-color: hsl(var(--accent-indigo));
  color: #ffffff;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--border-radius-round);
}
.status-dot.online { background-color: hsl(var(--accent-emerald)); box-shadow: 0 0 8px hsl(var(--accent-emerald)); }
.status-dot.offline { background-color: hsl(var(--accent-amber)); box-shadow: 0 0 8px hsl(var(--accent-amber)); }

.status-text {
  font-size: 0.8rem;
  font-weight: 500;
}

.sync-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sync-time {
  font-size: 0.75rem;
  color: hsl(var(--text-muted-hsl));
}
.btn-sync {
  color: hsl(var(--text-muted-hsl));
  padding: 4px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}
.btn-sync:hover {
  color: hsl(var(--text-primary-hsl));
  background-color: var(--border-color);
}
.btn-sync.spinning svg {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* ==========================================
   MAIN DASHBOARD MAIN PANELS & SEARCH
   ========================================== */
.main-dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: hsl(var(--bg-primary-hsl));
  overflow-y: auto;
  transition: background-color var(--transition-normal);
}

.app-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  align-items: center;
  gap: 24px;
}

.space-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.space-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.space-title-row h2 {
  font-size: 1.5rem;
  line-height: 1.2;
}
#space-encryption-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  background-color: hsla(var(--accent-emerald), 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: hsl(var(--accent-emerald));
}
.space-info p {
  font-size: 0.85rem;
  color: hsl(var(--text-secondary-hsl));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search bar design */
.search-bar {
  position: relative;
  width: 100%;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--text-muted-hsl));
}
.search-bar input {
  width: 100%;
  padding: 10px 48px;
  background-color: hsl(var(--bg-secondary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-round);
  color: hsl(var(--text-primary-hsl));
  transition: all var(--transition-fast);
}
.search-bar input:focus {
  outline: none;
  border-color: hsl(var(--accent-indigo));
  box-shadow: 0 0 0 3px hsla(var(--accent-indigo), 0.15);
}
.search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: hsl(var(--text-muted-hsl));
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.icon-btn-round {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-round);
  background-color: hsl(var(--bg-secondary-hsl));
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  color: hsl(var(--text-secondary-hsl));
  transition: all var(--transition-fast);
}
.icon-btn-round:hover {
  background-color: hsl(var(--bg-tertiary-hsl));
  color: hsl(var(--text-primary-hsl));
}

/* Filters Bar */
.filters-bar {
  padding: 16px 32px;
  background-color: hsla(var(--bg-secondary-hsl), 0.4);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.filter-results-info {
  font-size: 0.9rem;
  color: hsl(var(--text-secondary-hsl));
}

.sorting-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}
.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.control-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--text-muted-hsl));
}
.control-group select {
  padding: 6px 12px;
  background-color: hsl(var(--bg-secondary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: hsl(var(--text-primary-hsl));
  font-size: 0.85rem;
}

.view-switcher {
  display: flex;
  background-color: hsl(var(--bg-secondary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 2px;
}
.view-btn {
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  color: hsl(var(--text-muted-hsl));
  transition: all var(--transition-fast);
}
.view-btn:hover { color: hsl(var(--text-primary-hsl)); }
.view-btn.active {
  background-color: var(--border-color);
  color: hsl(var(--text-primary-hsl));
}

/* ==========================================
   DYNAMIC NOTES RENDERING GRIDS
   ========================================== */
.notes-view-section {
  padding: 32px;
  flex: 1;
}

/* Grids View */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.note-card {
  background-color: hsl(var(--bg-secondary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}
.note-card:hover {
  transform: translateY(-4px);
  border-color: hsla(var(--accent-indigo), 0.4);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.note-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.note-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: hsl(var(--text-primary-hsl));
  line-height: 1.3;
  word-break: break-word;
}
.note-card-pin-btn {
  color: hsl(var(--text-muted-hsl));
  font-size: 1rem;
  padding: 2px;
  transition: transform var(--transition-fast);
}
.note-card-pin-btn:hover {
  transform: scale(1.2);
}
.note-card-pin-btn.pinned {
  color: hsl(var(--accent-amber));
}

.note-card-body {
  font-size: 0.88rem;
  color: hsl(var(--text-secondary-hsl));
  line-height: 1.5;
  flex: 1;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-card-meta-line1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.note-category-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--border-radius-round);
  background-color: var(--border-color);
  color: #ffffff;
}

.note-value-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--border-radius-round);
  background-color: hsla(var(--accent-emerald), 0.15);
  color: hsl(var(--accent-emerald));
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.note-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.note-card-tag {
  font-size: 0.7rem;
  background-color: var(--border-color);
  color: hsl(var(--text-muted-hsl));
  padding: 1px 6px;
  border-radius: 4px;
}

.note-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: hsl(var(--text-muted-hsl));
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* Lists View */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.notes-list .note-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.notes-list .note-card-body {
  -webkit-line-clamp: 1;
  max-width: 40%;
}
.notes-list .note-card-meta {
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

/* Tables View */
.notes-table-container {
  overflow-x: auto;
  background-color: hsl(var(--bg-secondary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
}
.notes-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.notes-table th, .notes-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}
.notes-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  color: hsl(var(--text-muted-hsl));
  background-color: hsla(var(--bg-secondary-hsl), 0.8);
}
.notes-table tbody tr {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.notes-table tbody tr:hover {
  background-color: hsl(var(--bg-tertiary-hsl));
}

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
  background-color: hsla(var(--bg-secondary-hsl), 0.3);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-lg);
  max-width: 480px;
  margin: 40px auto;
}
.empty-illustration {
  font-size: 3rem;
  margin-bottom: 20px;
}
.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 0.9rem;
  color: hsl(var(--text-secondary-hsl));
  margin-bottom: 24px;
}

/* ==========================================
   ANALYTICS & ACCESS LOG AUDITS
   ========================================== */
.analytics-view-section {
  padding: 32px;
}
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}
.metric-card {
  border-radius: var(--border-radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: hsl(var(--text-muted-hsl));
  text-transform: uppercase;
}
.metric-card h3 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.analytics-row-details {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
}
.analytics-card {
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.analytics-card h3 {
  font-size: 1.15rem;
}

/* SVG Chart styles */
.chart-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
}
.chart-bar-label {
  width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.chart-bar-track {
  flex: 1;
  height: 12px;
  background-color: var(--border-color);
  border-radius: var(--border-radius-round);
  overflow: hidden;
}
.chart-bar-fill {
  height: 100%;
  border-radius: var(--border-radius-round);
}
.chart-bar-value {
  width: 40px;
  text-align: right;
  font-weight: 600;
}

/* Audit logs list */
.audit-log-scroller {
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}
.audit-table th, .audit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}
.audit-table th {
  color: hsl(var(--text-muted-hsl));
  font-weight: 600;
}
.audit-table tbody tr {
  color: hsl(var(--text-secondary-hsl));
}

/* ==========================================
   MODAL WINDOW DIALOGS (NATIVE <dialog>)
   ========================================== */
dialog {
  margin: auto;
  padding: 0;
  border: none;
  border-radius: var(--border-radius-lg);
  max-width: 90vw;
  max-height: 85vh;
  box-shadow: var(--shadow-lg), 0 30px 60px -12px rgba(0, 0, 0, 0.6);
  color: hsl(var(--text-primary-hsl));
  overflow: hidden;
  outline: none;
}

dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
}

/* Animation for native dialog */
dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialogScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes dialogScaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Wide dialog for Note view/edit popup */
.note-dialog-modal {
  width: 1000px;
  height: 80vh;
}

.note-modal-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.note-modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.note-modal-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.note-tags-list-inline {
  display: flex;
  gap: 4px;
}
.note-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon-dialog {
  font-size: 1.1rem;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  background-color: var(--border-color);
  transition: all var(--transition-fast);
}
.btn-icon-dialog:hover {
  background-color: hsl(var(--bg-tertiary-hsl));
}

.btn-close-circle {
  font-size: 1.5rem;
  color: hsl(var(--text-muted-hsl));
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--border-radius-round);
  background-color: var(--border-color);
  transition: all var(--transition-fast);
}
.btn-close-circle:hover {
  background-color: hsl(var(--accent-rose));
  color: #ffffff;
}

.note-modal-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.note-view-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.note-dates {
  font-size: 0.8rem;
  color: hsl(var(--text-muted-hsl));
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

/* Dashboard Output box inside Note */
.dashboard-output-card {
  background: linear-gradient(135deg, hsla(var(--accent-indigo), 0.15) 0%, hsla(var(--accent-cyan), 0.08) 100%);
  border: 1px solid hsla(var(--accent-indigo), 0.25);
  box-shadow: var(--shadow-glow);
  border-radius: var(--border-radius-md);
  padding: 24px;
  margin-bottom: 32px;
  animation: glowPulse 3s infinite alternate;
}
@keyframes glowPulse {
  0% { box-shadow: 0 0 10px hsla(var(--accent-indigo), 0.15); }
  100% { box-shadow: 0 0 25px hsla(var(--accent-indigo), 0.35); }
}
.dashboard-output-header {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--accent-indigo));
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dashboard-output-body {
  font-size: 1.1rem;
  line-height: 1.5;
}

/* Styled Markdown Body */
.markdown-body {
  font-size: 1rem;
  line-height: 1.6;
  color: hsl(var(--text-primary-hsl));
}
.markdown-body h1 { font-size: 1.75rem; margin: 24px 0 16px 0; }
.markdown-body h2 { font-size: 1.4rem; margin: 20px 0 12px 0; }
.markdown-body h3 { font-size: 1.15rem; margin: 16px 0 8px 0; }
.markdown-body p { margin-bottom: 16px; }
.markdown-body ul, .markdown-body ol { margin-left: 24px; margin-bottom: 16px; }
.markdown-body li { margin-bottom: 6px; }
.markdown-body pre {
  background-color: hsl(var(--bg-primary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background-color: var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
}
.markdown-body pre code {
  background-color: transparent;
  padding: 0;
}
.markdown-body img {
  max-width: 100%;
  border-radius: var(--border-radius-md);
  margin: 16px 0;
}

/* Edit layout grid split */
.edit-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  overflow-y: hidden;
  height: 100%;
}
.edit-settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding-right: 8px;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.create-new-trigger-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.link-btn-small {
  font-size: 0.75rem;
  color: hsl(var(--accent-indigo));
  font-weight: 500;
}
.tag-input-sm {
  font-size: 0.75rem !important;
  padding: 4px 8px !important;
}

.tags-autocomplete-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 80px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: var(--border-radius-sm);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.helper-box-dark {
  background-color: hsl(var(--bg-primary-hsl));
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.helper-box-dark h4 { color: hsl(var(--accent-amber)); }
.helper-box-dark pre {
  background-color: rgba(255,255,255,0.02);
  padding: 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.edit-editor-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.editor-panes-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  flex: 1;
  height: 100%;
}
.editor-panes-wrapper.split-active {
  grid-template-columns: 1fr 1fr;
}
.pane-editor, .pane-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}
.pane-editor textarea {
  flex: 1;
  width: 100%;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background-color: hsl(var(--bg-primary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  resize: none;
}
.edit-live-preview-box {
  flex: 1;
  background-color: hsl(var(--bg-primary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  overflow-y: auto;
}

/* Medium & Small Dialogs styling */
.dialog-sm {
  width: 500px;
}
.dialog-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.dialog-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-content {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.dialog-actions-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Collaborators list */
.collaborators-config-box {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  background-color: hsl(var(--bg-primary-hsl));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.collaborator-add-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 60px;
  gap: 12px;
}
.collaborator-add-row input, .collaborator-add-row select {
  padding: 6px 12px !important;
}
.collab-lists h5 {
  font-size: 0.75rem;
  color: hsl(var(--text-muted-hsl));
  margin: 12px 0 6px 0;
  text-transform: uppercase;
}
.collab-list-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.collab-list-items li {
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background-color: var(--border-color);
  border-radius: 4px;
}
.btn-remove-item {
  color: hsl(var(--accent-rose));
  font-weight: bold;
}

/* Security card */
.security-card {
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(0,0,0,0));
}
.security-card h4 {
  color: hsl(var(--accent-amber));
  margin-bottom: 8px;
}
.text-secondary-sm {
  font-size: 0.78rem;
  color: hsl(var(--text-secondary-hsl));
  line-height: 1.4;
}
.encryption-status-alert {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: hsl(var(--accent-emerald));
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  margin: 12px 0;
}

/* Categories Quick list editor */
.categories-editor-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.category-add-row {
  display: grid;
  grid-template-columns: 1fr 50px 70px;
  gap: 12px;
  align-items: center;
}
.category-add-row input[type="color"] {
  height: 40px;
  width: 100%;
  border-radius: var(--border-radius-sm);
  padding: 0;
  border: 1px solid var(--border-color);
  background-color: transparent;
  cursor: pointer;
}
.categories-edit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.categories-edit-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: hsl(var(--bg-primary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.88rem;
}

/* Backup Sync dialog */
.import-export-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.backup-panel {
  background-color: hsl(var(--bg-primary-hsl));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 20px;
}
.backup-panel h4 {
  margin-bottom: 8px;
}
.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 24px;
  cursor: pointer;
  background-color: rgba(255,255,255,0.01);
  transition: all var(--transition-fast);
}
.file-upload-label:hover {
  background-color: rgba(255,255,255,0.03);
  border-color: hsl(var(--accent-indigo));
}
.file-upload-label input {
  display: none;
}
.import-status {
  text-align: center;
  font-size: 0.8rem;
  color: hsl(var(--text-muted-hsl));
  margin-top: 8px;
}

/* ==========================================
   RESPONSIVE LAYOUT STYLING MEDIA QUERIES
   ========================================== */
@media (max-width: 1200px) {
  .app-header {
    grid-template-columns: 1fr 1fr;
  }
  .app-header .search-bar {
    grid-column: span 2;
    order: 3;
  }
}

@media (max-width: 992px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 32px 24px;
    text-align: center;
  }
  .hero-content {
    align-items: center;
  }
  .hero-title {
    font-size: 3rem;
  }
  .hero-ctas {
    justify-content: center;
  }
  .hero-visual {
    max-width: 500px;
    margin: 0 auto;
  }
  .features-section {
    grid-template-columns: repeat(2, 1fr);
    padding: 40px 24px;
  }
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.35);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar .sidebar-scroll-content {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
  }

  .sidebar.open .sidebar-scroll-content {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Responsive App Header for mobile */
  .app-header {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 20px !important;
    gap: 16px !important;
  }
  
  .btn-toggle-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: hsl(var(--text-primary-hsl));
    padding: 8px;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: background-color var(--transition-fast);
    order: 1;
  }
  .btn-toggle-sidebar:hover {
    background-color: hsla(var(--text-primary-hsl), 0.08);
  }
  
  .space-info {
    order: 2;
    flex: 1;
    min-width: 0;
  }
  .space-info p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .header-actions {
    order: 3;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }
  
  .app-header .search-bar {
    order: 4;
    grid-column: span 1 !important;
    width: 100% !important;
    margin-top: 4px;
  }
  
  /* Mobile Quick Actions in Sidebar */
  .mobile-only-actions {
    display: block !important;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
  }
  
  .mobile-actions-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
  }
  
  .sidebar-action-btn {
    width: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    font-size: 0.88rem !important;
    background-color: hsl(var(--bg-primary-hsl)) !important;
    border: 1px solid var(--border-color) !important;
    color: hsl(var(--text-secondary-hsl)) !important;
    border-radius: var(--border-radius-md) !important;
    transition: all var(--transition-fast) !important;
  }
  .sidebar-action-btn:hover {
    background-color: hsla(var(--accent-indigo), 0.1) !important;
    color: hsl(var(--accent-indigo)) !important;
    border-color: hsla(var(--accent-indigo), 0.2) !important;
  }
  .sidebar-action-btn svg {
    color: inherit !important;
  }
  
  .hide-on-mobile {
    display: none !important;
  }

  .note-dialog-modal {
    width: 95vw;
    height: 90vh;
  }
  .edit-grid {
    grid-template-columns: 1fr;
  }
}

/* Global utility styles for responsive elements */
@media (min-width: 993px) {
  .btn-toggle-sidebar {
    display: none; /* Hidden on desktop viewports */
  }
}

.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 1000;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.3s cubic-bezier(0.16, 1, 0.3, 1), -webkit-backdrop-filter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  pointer-events: none;
}

.sidebar-backdrop.open {
  opacity: 1;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: auto;
}

@media (min-width: 993px) {
  .mobile-only-actions {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .landing-header {
    padding: 16px;
  }
  .landing-header-actions {
    gap: 8px;
  }
  .hero-title {
    font-size: 2.25rem;
  }
  .features-section {
    grid-template-columns: 1fr;
  }
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-row-details {
    grid-template-columns: 1fr;
  }
  .collaborator-add-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   PAGINATION / LOAD MORE STYLES
   ========================================== */
.load-more-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 0 16px;
  width: 100%;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: hsl(var(--text-primary-hsl));
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn-load-more:hover {
  transform: translateY(-2px);
  border-color: hsla(var(--accent-indigo), 0.4);
  background: hsla(223, 47%, 20%, 0.9);
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.25), var(--shadow-glow);
  color: #ffffff;
}

.btn-load-more:active {
  transform: translateY(0);
}

html[data-theme="light"] .btn-load-more:hover {
  background: hsla(0, 0%, 100%, 0.9);
  color: hsl(var(--accent-indigo));
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.15), var(--shadow-glow);
}

/* Infinite Scroll Loader */
.btn-load-more.infinite-scroll-loader {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: hsl(var(--text-muted-hsl));
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
  cursor: default;
  animation: pulse-loader 1.5s infinite ease-in-out;
  padding: 16px;
}

@keyframes pulse-loader {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
    color: hsl(var(--accent-indigo));
  }
}

/* Keyboard Selection Highlighting */
.note-card.keyboard-selected {
  transform: translateY(-4px);
  border-color: hsl(var(--accent-indigo)) !important;
  box-shadow: var(--shadow-lg), var(--shadow-glow), 0 0 0 2px hsl(var(--accent-indigo)) !important;
  background-color: hsl(var(--bg-tertiary-hsl)) !important;
}

.notes-table tbody tr.keyboard-selected {
  background-color: hsl(var(--bg-tertiary-hsl)) !important;
  outline: 2px solid hsl(var(--accent-indigo)) !important;
  outline-offset: -2px;
}


