[hidden] { display: none !important; }
/* ===== RESET & BASE ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}

:root {
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
  --sidebar-w: 260px;

  /* Light theme */
  --bg: #f5f6fa;
  --bg-card: #ffffff;
  --bg-sidebar: #f0f1f5;
  --bg-input: #ffffff;
  --border: #e2e4ea;
  --text: #1a1d2e;
  --text-secondary: #6b7194;
  --text-muted: #9498b3;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --code-bg: #f8f9fc;
  --scrollbar-thumb: #c5c8d6;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-card: #1a1d2e;
  --bg-sidebar: #141625;
  --bg-input: #222540;
  --border: #2a2d42;
  --text: #e4e6f0;
  --text-secondary: #9498b3;
  --text-muted: #6b7194;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-light: rgba(99,102,241,0.15);
  --danger: #f87171;
  --danger-hover: #ef4444;
  --success: #4ade80;
  --warning: #fbbf24;
  --code-bg: #12141f;
  --scrollbar-thumb: #3a3d52;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.link { color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }

/* ===== LOGIN PAGE ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

.login-error {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(239,68,68,0.2);
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 1.15rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
.select-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, textarea:focus, .select-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea { resize: vertical; }

.select-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7194' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 1rem;
}
.flex-1 { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: var(--danger-hover); }

.btn-accent {
  background: var(--accent-light);
  color: var(--accent);
}
.btn-accent:hover { background: var(--accent); color: #fff; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--accent-light); color: var(--accent); }

/* Toggle switch */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.toggle-input { display: none; }
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-input:checked + .toggle-switch {
  background: var(--accent);
}
.toggle-input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

/* ===== ADMIN LAYOUT ===== */
.admin-panel {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition), transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand { white-space: nowrap; }

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
}
.nav-item:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.logout-btn:hover {
  background: rgba(239,68,68,0.1) !important;
  color: var(--danger) !important;
}

/* Love quote in sidebar footer */
.love-quote {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--accent);
  opacity: 0.85;
  min-height: 32px;
}
.love-quote-heart {
  font-style: normal;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.love-quote-text {
  transition: opacity 0.5s ease;
}
.love-quote-text.fade-out {
  opacity: 0;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 2rem 2.5rem;
  max-width: 100%;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* Mobile header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 90;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.mobile-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.3s ease;
}

/* Theme icons in mobile */
[data-theme="dark"] .icon-sun { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: inline; }

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 95;
  backdrop-filter: blur(2px);
}

/* Sections */
.section { display: none; }
.section.active { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

/* ===== CARDS & STATS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: background var(--transition), border-color var(--transition);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

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

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Views detail row */
.views-detail {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
}

/* Recent posts list */
.recent-posts-list { }

.recent-post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.recent-post-item:last-child { border-bottom: none; }

.recent-post-info { flex: 1; min-width: 0; }
.recent-post-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

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

/* ===== POSTS TABLE ===== */
.posts-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { flex-shrink: 0; color: var(--text-muted); }
.search-box input {
  border: none !important;
  background: transparent !important;
  padding: 0.55rem 0 !important;
  box-shadow: none !important;
}

.posts-table-wrap { overflow-x: auto; }

.posts-table {
  width: 100%;
  border-collapse: collapse;
}

.posts-table th,
.posts-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.posts-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.posts-table tr:last-child td { border-bottom: none; }

.posts-table tr:hover td { background: var(--accent-light); }

.post-title-cell {
  white-space: normal !important;
  max-width: 300px;
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-published { background: #dcfce7; color: #16a34a; }
.badge-draft { background: #fef3c7; color: #d97706; }
[data-theme="dark"] .badge-published { background: rgba(22,163,74,0.15); color: #4ade80; }
[data-theme="dark"] .badge-draft { background: rgba(217,119,6,0.15); color: #fbbf24; }

.action-btns {
  display: flex;
  gap: 0.35rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.action-btn:hover { background: var(--accent-light); color: var(--accent); }
.action-btn.delete:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ===== POST FORM ===== */
.post-form { max-width: 900px; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1rem;
}

.form-actions-right {
  display: flex;
  gap: 0.75rem;
}

/* Tags */
.tags-input-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  min-height: 42px;
  transition: border-color var(--transition);
}
.tags-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.tags-container { display: contents; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}

.tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  border-radius: 50%;
  padding: 0;
}
.tag-remove:hover { background: var(--accent); color: #fff; }

#post-tags-input {
  border: none !important;
  background: transparent !important;
  padding: 0.25rem 0 !important;
  box-shadow: none !important;
  min-width: 100px;
  flex: 1;
}

/* Tag suggestions dropdown */
.tags-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

.tag-suggestion-item {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: var(--text);
}
.tag-suggestion-item:hover,
.tag-suggestion-item.active {
  background: var(--accent-light);
  color: var(--accent);
}
.tag-suggestion-item:first-child {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tag-suggestion-item:last-child {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* Code editor */
.code-editor-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--code-bg);
}

.code-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
}

.code-lang-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-editor-body {
  display: flex;
  position: relative;
  min-height: 200px;
}

.line-numbers {
  padding: 0.75rem 0.5rem;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  user-select: none;
  min-width: 40px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  white-space: pre-line;
  overflow: hidden;
}

.code-textarea {
  flex: 1;
  padding: 0.75rem;
  font-family: var(--font-mono) !important;
  font-size: 0.85rem !important;
  line-height: 1.6 !important;
  background: var(--code-bg) !important;
  color: var(--text) !important;
  border: none !important;
  resize: none;
  outline: none;
  min-height: 200px;
  tab-size: 2;
  white-space: pre;
  overflow-x: auto;
  box-shadow: none !important;
}

.code-output-panel {
  margin-top: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.code-output {
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--code-bg);
  color: var(--text);
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.drop-zone svg { margin-bottom: 0.5rem; }
.drop-zone p { font-size: 0.9rem; }

.file-list { margin-top: 0.75rem; }

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
}

.file-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 0.75rem;
}

/* ===== PROFILE ===== */
.profile-card { max-width: 600px; }

.avatar-section {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.avatar-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid var(--border);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg);
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition);
}
.avatar-wrap:hover .avatar-overlay { opacity: 1; }

/* ===== SETTINGS ===== */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: toastIn 0.3s ease forwards;
  max-width: 360px;
  border-left: 4px solid var(--accent);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.removing { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(12px) scale(0.96); }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 { margin-bottom: 0.65rem; font-size: 1.15rem; }
.modal-card p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.25rem; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== PULSE HEART (dashboard welcome) ===== */
.pulse-heart {
  color: #ef4444;
  display: inline-block;
  animation: pulseHeart 1.2s ease-in-out infinite;
  font-size: 1.2rem;
  vertical-align: middle;
  margin-left: 0.3rem;
}
@keyframes pulseHeart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ===== SECRET LOVE CARD ===== */
.secret-love-card {
  position: relative;
  overflow: hidden;
}
.secret-love-inner {
  position: relative;
  z-index: 2;
}
.floating-hearts-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.floating-heart {
  position: absolute;
  bottom: -30px;
  font-size: 1.2rem;
  opacity: 0;
  animation: floatHeart 4s ease-in infinite;
  pointer-events: none;
}
@keyframes floatHeart {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  10% { opacity: 0.8; }
  90% { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-300px) rotate(30deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .mobile-header { display: flex; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 1.25rem;
    padding-top: calc(56px + 1.25rem);
  }

  .section-header h2 { font-size: 1.3rem; }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .form-row .form-group { width: 100% !important; }

  .posts-table th:nth-child(3),
  .posts-table td:nth-child(3),
  .posts-table th:nth-child(4),
  .posts-table td:nth-child(4) { display: none; }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  .toast { max-width: none; }
}

@media (max-width: 480px) {
  .login-card { padding: 2rem 1.25rem; }
  .main-content { padding: 1rem; padding-top: calc(56px + 1rem); }
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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