:root {
  --primary: #38bdf8; 
  --primary-hover: #0284c7; 
  --bg: #f8fafc; 
  --card-bg: #ffffff; 
  --text-main: #0f172a; 
  --text-muted: #64748b; 
  --border: #e2e8f0; 
}

* {
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: 'Inter', -apple-system, sans-serif; 
}

/* 1. CLEAN UP THE BODY BACKGROUND */
body {
  background-color: var(--bg) !important; 
  color: var(--text-main); 
  line-height: 1.6; 
}

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

/* Auth Page */
.auth-wrapper {
  display: flex; 
  justify-content: center; 
  align-items: center; 
  min-height: 100vh; 
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 2.5rem; 
  border-radius: 20px; 
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05); 
  width: 100%; 
  max-width: 400px;
  color: var(--text-main); 
}

.card h2 { 
  margin-bottom: 1.5rem; 
  text-align: center; 
  color: var(--text-main);
}

.form-group { 
  margin-bottom: 1rem; 
}
.form-group label { 
  display: block; 
  margin-bottom: 0.5rem; 
  font-size: 0.9rem; 
  font-weight: 500; 
  color: var(--text-main);
}

/* 2. FIX THE MUDDY INPUTS & DROPDOWNS */
.form-control {
  width: 100%; 
  padding: 0.75rem 1rem; 
  background-color: #ffffff !important; 
  border: 1px solid var(--border) !important; 
  border-radius: 8px; 
  font-size: 0.95rem; 
  color: var(--text-main) !important; 
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); 
}

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

select.form-control option {
  background-color: #ffffff;
  color: var(--text-main);
}

/* 3. POLISH THE BUTTONS */
.btn {
  display: inline-block; 
  width: 100%; 
  padding: 0.6rem 1rem; 
  background: var(--primary); 
  color: white; 
  border: none; 
  border-radius: 8px; 
  font-weight: 600; 
  cursor: pointer; 
  text-align: center; 
  transition: all 0.2s ease; 
}

.btn:hover { 
  background: var(--primary-hover); 
  transform: translateY(-1px);
}
.btn-secondary { background: var(--text-muted); }
.btn-secondary:hover { background: #475569; }

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

.admin-grid {
  display: grid; 
  grid-template-columns: 1fr 2fr; 
  gap: 2rem; 
}
.stat-card {
  background: var(--card-bg); 
  padding: 2rem; 
  border-radius: 12px; 
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
  text-align: center; 
  margin-bottom: 2rem; 
}
.stat-card h3 { 
  font-size: 3rem; 
  color: var(--primary); 
}

table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f1f5f9; font-weight: 600; color: #0f172a; }

.notes-grid {
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 1.5rem; 
}

/* 4. MODERNIZE THE NOTE CARDS & FORCE TEXT VISIBILITY */
.note-card {
  background: var(--card-bg); 
  padding: 1.5rem; 
  border-radius: 12px; 
  border: 1px solid var(--border); 
  display: flex; 
  flex-direction: column; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: var(--text-muted) !important; /* Catch bare text nodes */
}

.note-card:hover {
  transform: translateY(-4px); 
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Aggressively target all text elements to override JS inline styles */
.note-card p, 
.note-card span,
.note-card div:not(.note-actions):not(.note-title) {
  color: var(--text-muted) !important; 
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.note-title { 
  font-weight: 600; 
  font-size: 1.1rem;
  margin-bottom: 0.5rem; 
  word-break: break-word; 
  color: var(--text-main) !important; 
}

.note-date { font-size: 0.85rem; color: var(--text-muted) !important; margin-bottom: 1.5rem; }
.note-actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 1rem; }
.note-actions .btn { padding: 0.5rem; font-size: 0.9rem; }

.hidden { display: none !important; }

.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  background: rgba(15, 23, 42, 0.6); z-index: 1000; 
  display: flex; justify-content: center; align-items: center; padding: 1rem; 
}
.modal-overlay.hidden { display: none !important; }

input:disabled {
  background-color: var(--bg); 
  cursor: not-allowed; color: var(--text-muted); 
  border-color: var(--border); 
}

.profile-pic {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover; 
  border: 2px solid var(--primary); background-color: var(--border); 
  cursor: pointer; transition: opacity 0.2s ease;
}
.profile-pic:hover { opacity: 0.8; }
.header-left { display: flex; align-items: center; gap: 15px; }

#liquid-ocean-canvas {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: -1; pointer-events: none; 
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

.auth-wrapper .card { animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.login-card { position: relative; margin-top: 40px; padding-top: 4rem; }

.card-icon {
    position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
    width: 80px; height: 80px; background: linear-gradient(135deg, #a855f7, var(--primary)); 
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 16px rgba(56, 189, 248, 0.4); border: 5px solid rgba(255, 255, 255, 0.2); 
}
.card-icon svg { width: 34px; height: 34px; color: white; }

.login-title { color: var(--text-main); font-size: 1.8rem; font-weight: 700; margin-bottom: 2rem !important; }
.muted-label { color: var(--text-muted); font-weight: 500; font-size: 0.85rem !important; margin-bottom: 0.3rem !important; }
.rounded-input { border-radius: 50px !important; padding: 0.9rem 1.25rem !important; transition: all 0.3s ease; }
.rounded-input:focus { background-color: #ffffff !important; border-color: var(--primary) !important; box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2); outline: none; }
.form-options { margin: -0.5rem 0 1.5rem 0.5rem; display: flex; align-items: center; }
.remember-me { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; cursor: pointer; }
.remember-me input { margin-right: 0.5rem; cursor: pointer; }
.rounded-btn { border-radius: 50px !important; padding: 0.9rem 1.5rem !important; font-weight: 700 !important; text-transform: uppercase; letter-spacing: 0.5px; box-shadow: 0 4px 10px rgba(56, 189, 248, 0.3); }
.rounded-btn:active { transform: translateY(2px); box-shadow: 0 2px 5px rgba(56, 189, 248, 0.3); }

.divider { text-align: center; position: relative; margin: 2rem 0; }
.divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); z-index: 1; }
.divider span { background: var(--bg); padding: 0 1rem; color: var(--text-muted); font-size: 0.85rem; position: relative; z-index: 2; }

.btn-google { background-color: #ffffff !important; color: #0f172a !important; border: 1px solid var(--border) !important; box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important; display: flex !important; align-items: center; justify-content: center; gap: 10px; }
.btn-google:hover { background-color: #f8fafc !important; transform: translateY(-2px); }