@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700&display=swap');

:root {
  --bg-light: #f8fafc;
  --bg-dark: #0f172a;
  --text-light: #111827;
  --text-dark: #e5e7eb;
  --accent: #2563eb;
  --border: #cbd5e1;
  --radius: 14px;
}

body {
  font-family: 'Nunito', sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}

body.theme-light {
  background: var(--bg-light);
  color: var(--text-light);
}

body.theme-dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #e2e8f0;
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-group h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
}

.subtitle {
  font-size: 12px;
  color: #64748b;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status {
  font-size: 13px;
  color: #64748b;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 6px;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100%;
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  transition: transform 0.3s ease;
  z-index: 50;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Sidebar obert en PC */
@media (min-width: 769px) {
  .sidebar {
    transform: translateX(0);
  }
}

/* Sidebar tancat en mòbil */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
}

.close-btn {
  float: right;
  margin-bottom: 20px;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
}

.sidebar nav li {
  margin-bottom: 12px;
}

.sidebar nav a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

/* LAYOUT */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
}

.calendar-section,
.agenda-section {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.calendar-section h2,
.agenda-section h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

/* CALENDARI QUADRATS ARRODONITS */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.calendar-day {
  background: #e2e8f0;
  border-radius: 12px; /* QUADRAT ARRODONIT */
  padding: 16px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.calendar-day:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

.calendar-day.selected {
  background: #2563eb;
  color: #fff;
  transform: scale(1.05);
}

.calendar-empty {
  visibility: hidden;
}

/* INPUTS */
.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  font-size: 15px;
}

/* BOTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid #94a3b8;
  color: #0f172a;
}

.error-box {
  color: #dc2626;
  font-size: 14px;
  margin-top: 8px;
}

.note {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
