:root {
  --bg-primary: #faf6f0;
  --bg-secondary: #f0e9de;
  --bg-card: #fffdf8;
  --bg-sidebar: #f5efe5;
  --text-primary: #3d2e1f;
  --text-secondary: #7a6852;
  --text-muted: #a89880;
  --accent-green: #5a8a5e;
  --accent-green-light: #7db880;
  --accent-gold: #c4973b;
  --accent-gold-light: #e8c06a;
  --accent-brown: #8b6f47;
  --accent-red: #b85450;
  --accent-blue: #5078a0;
  --accent-purple: #7a5ea0;
  --border-color: #e0d5c5;
  --border-light: #ece4d8;
  --shadow-sm: 0 1px 3px rgba(61,46,31,0.08);
  --shadow-md: 0 4px 12px rgba(61,46,31,0.1);
  --shadow-lg: 0 8px 24px rgba(61,46,31,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg-primary: #1a1520;
  --bg-secondary: #231e2c;
  --bg-card: #2a2435;
  --bg-sidebar: #1f1a28;
  --text-primary: #e8ddd0;
  --text-secondary: #b8a890;
  --text-muted: #887868;
  --accent-green: #6faa74;
  --accent-green-light: #8fca94;
  --accent-gold: #daa040;
  --accent-gold-light: #f0c060;
  --accent-brown: #a88860;
  --accent-red: #d07070;
  --accent-blue: #70a0d0;
  --accent-purple: #a080d0;
  --border-color: #3a3245;
  --border-light: #322c3c;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

h1, h2, h3, .font-title {
  font-family: 'Fredoka', sans-serif;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.pixel-border {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(90,138,94,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(90,138,94,0); }
}

@keyframes bounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

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

.anim-fade { animation: fadeIn 0.3s ease-out; }
.anim-slide-left { animation: slideInLeft 0.3s ease-out; }
.anim-slide-right { animation: slideInRight 0.3s ease-out; }
.anim-bounce { animation: bounceIn 0.4s ease-out; }
.anim-pulse { animation: pulse 2s infinite; }
.anim-spin { animation: spin 1s linear infinite; }

.btn-hover {
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-hover:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-hover:active {
  transform: translateY(0);
}

.card-hover {
  transition: transform 0.2s, box-shadow 0.2s;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

input, textarea, select {
  font-family: 'Quicksand', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(90,138,94,0.15);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  animation: bounceIn 0.3s ease-out;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.tag-chip.active {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

.tag-chip:hover {
  border-color: var(--accent-green);
}