@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;0,900;1,400&family=Inter:wght@400;500;600;700&display=swap');

/* ─── Palette Gallinoo ─── */
:root {
  --bg-main:    #FAF6F0;
  --bg-alt:     #F0E8DC;
  --bg-card:    #FFFFFF;
  --text-dark:  #3C342C;
  --text-mid:   #6B5D52;
  --text-light: #9C8C80;
  --accent:     #5A8282;
  --accent-dark:#466868;
  --gold:       #C4902A;
  --brown:      #856336;
  --error:      #B84233;
  --success:    #6B8E23;
  --border:     rgba(60,52,44,0.1);
  --shadow:     0 2px 12px rgba(60,52,44,0.08);
  --shadow-md:  0 4px 24px rgba(60,52,44,0.12);
}

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

html, body {
  background-color: var(--bg-main);
  color: var(--text-dark);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}

h1, h2, h3 { font-family: 'Merriweather', Georgia, serif; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

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

/* ─── Buttons ─── */
.btn-cta {
  background-color: var(--accent);
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  padding: 12px 28px;
  transition: background-color 300ms ease, box-shadow 300ms ease, transform 150ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
}
.btn-cta:hover {
  background-color: var(--accent-dark);
  box-shadow: 0 6px 20px rgba(90,130,130,0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 24px;
  transition: background-color 300ms ease, color 300ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
}
.btn-outline:hover {
  background-color: var(--accent);
  color: #fff;
}

.btn-danger {
  background-color: var(--error);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 0.875rem;
}

/* ─── Card ─── */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ─── Input ─── */
.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-dark);
  font-size: 1rem;
  font-family: 'Inter', system-ui, sans-serif;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  outline: none;
}
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(90,130,130,0.15);
}
.input-field::placeholder { color: var(--text-light); }

select.input-field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B5D52' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

textarea.input-field { resize: vertical; min-height: 80px; }

/* ─── Badges ─── */
.badge-success { background: #EEF3E6; color: var(--success); font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; display: inline-block; }
.badge-gold    { background: #FBF3E3; color: var(--gold);    font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; display: inline-block; }
.badge-brown   { background: #F4EDE3; color: var(--brown);   font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; display: inline-block; }
.badge-error   { background: #FAEAE7; color: var(--error);   font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; display: inline-block; }

/* ─── Layout ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  display: none;
  flex-direction: column;
  width: 260px;
  min-height: 100vh;
  background-color: var(--bg-alt);
  border-right: 1px solid var(--border);
}
@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .topbar { display: none !important; }
}

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

.sidebar-nav {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-mid);
  transition: background-color 200ms;
  border-left: 3px solid transparent;
}
.nav-item:hover { background-color: rgba(90,130,130,0.06); }
.nav-item.active {
  background-color: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow);
  border-left-color: var(--accent);
}
.nav-item.locked { opacity: 0.6; color: var(--text-light); }
.nav-item .emoji { font-size: 1.25rem; }

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

.main-content {
  flex: 1;
  padding: 24px;
  max-width: 100%;
  overflow-x: hidden;
}
@media (min-width: 1024px) {
  .main-content { padding: 32px; }
}

/* ─── Top Bar (mobile) ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

/* ─── Stat Cards ─── */
.stat-card {
  border-radius: 16px;
  padding: 16px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Space ─── */
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }

/* ─── Alert box ─── */
.alert-error {
  background-color: #FAEAE7;
  color: var(--error);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
}
.alert-success {
  background-color: #EEF3E6;
  color: var(--success);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
}
.alert-warning {
  background-color: #FBF3E3;
  color: var(--brown);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  border: 1px solid #e8d5a3;
}

/* ─── Table ─── */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; padding: 10px 12px; color: var(--text-light); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text-mid); }
tr:hover td { background-color: var(--bg-alt); }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab { padding: 10px 16px; font-size: 0.875rem; font-weight: 500; color: var(--text-light); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; transition: all 200ms; }
.tab:hover { color: var(--text-mid); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

/* ─── Misc ─── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }
.min-w-0 { min-width: 0; }

/* ─── Progress bar ─── */
.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 300ms ease;
}

/* ─── Chart bars ─── */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 96px;
}
.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.chart-bar-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  background-color: var(--accent);
  transition: height 300ms ease;
}

/* ─── Mobile menu ─── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.4);
  display: none;
}
.mobile-menu.open { display: block; }
.mobile-menu-panel {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 280px;
  background: var(--bg-alt);
  padding: 24px 0;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}
