/* FarmingSoul Secrétariat — Design System */
:root {
  --green: #2d6a4f;
  --green-dark: #1b4332;
  --green-light: #40916c;
  --green-bg: #d8e8e0;
  --cream: #f5f1e8;
  --orange: #e07a5f;
  --red: #d62828;
  --amber: #f4a261;
  --gray: #6c757d;
  --gray-light: #adb5bd;
  --bg: #f8f9fa;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: #1a1a1a;
  -webkit-tap-highlight-color: transparent;
}

/* === SPLASH (logo page) === */
.splash-body {
  background: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  cursor: pointer;
}
.splash-container {
  text-align: center;
  animation: fadeIn 0.8s ease;
}
.splash-logo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  transition: transform 0.3s;
}
.splash-container:hover .splash-logo { transform: scale(1.05); }
.splash-hint {
  color: rgba(255,255,255,0.5);
  margin-top: 24px;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

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

/* === LOGIN === */
.login-body {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-container {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 360px;
  text-align: center;
}
.login-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 24px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input {
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
}
.login-form input:focus { border-color: var(--green-light); }
.btn-login {
  background: var(--green);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-login:hover { background: var(--green-dark); }
.login-error {
  color: var(--red);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-top: 4px;
}

/* === DASHBOARD === */
.dashboard-body { background: var(--bg); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 56px;
  gap: 8px;
}
.topbar-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-logo { width: 32px; height: 32px; border-radius: 50%; }
.topbar-title { font-weight: 700; font-size: 1rem; color: var(--green-dark); }

.topbar-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-btn:hover { background: var(--green-bg); color: var(--green-dark); }
.nav-btn.active {
  background: var(--green);
  color: white;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-logout:hover { background: #fee; color: var(--red); }

/* === CONTENT === */
.content {
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 0.15s;
}
.card:active { transform: scale(0.98); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-title { font-weight: 600; font-size: 0.95rem; }
.card-section {
  font-size: 0.75rem;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-desc {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Priority badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-urgent { background: #fde8e8; color: var(--red); }
.badge-important { background: #fef3e2; color: #b8740b; }
.badge-normal { background: #e8f5e9; color: var(--green); }
.badge-basse { background: #f0f0f0; color: var(--gray); }

/* Status indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.status-pending { background: var(--amber); }
.status-in_progress { background: #4dabf7; }
.status-done { background: var(--green-light); }
.status-cancelled { background: var(--gray-light); }

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Add button */
.btn-add {
  background: var(--green);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.btn-add:hover { background: var(--green-dark); transform: scale(1.05); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.3; }
.empty-state-text { font-size: 0.9rem; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--green-dark);
}
.modal-field { margin-bottom: 14px; }
.modal-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 4px;
}
.modal-field input,
.modal-field select,
.modal-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}
.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus { border-color: var(--green-light); }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}
.btn-secondary {
  background: #e9ecef;
  color: #495057;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
}
.btn-primary {
  background: var(--green);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-danger {
  background: var(--red);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Item actions */
.item-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.item-actions button {
  background: #f0f0f0;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--gray);
  transition: all 0.15s;
}
.item-actions button:hover { background: #e0e0e0; }
.item-actions .btn-delete:hover { background: #fde8e8; color: var(--red); }

/* Due date */
.due-date {
  font-size: 0.75rem;
  color: var(--orange);
  margin-top: 4px;
}
.due-date.overdue { color: var(--red); font-weight: 600; }

/* Entity badges */
.entity-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}
.entity-soul {
  background: #e8f5e9;
  color: #2d6a4f;
}
.entity-tools {
  background: #e3f2fd;
  color: #1565c0;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 600px) {
  .topbar-title { display: none; }
  .topbar-logo { width: 28px; height: 28px; }
  .content { padding: 12px; }
  .nav-btn { padding: 6px 10px; font-size: 0.8rem; }
  .section-title { font-size: 1.1rem; }
  .splash-logo { width: 150px; height: 150px; }
}

@media (min-width: 768px) {
  .content { padding: 24px; }
  .card { padding: 20px; }
}