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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f3f4f6;
  color: #111827;
  line-height: 1.5;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: #e5e7eb;
}

.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
}

.sidebar-header {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #111827;
}

.app-title {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-user {
  margin-bottom: 1.5rem;
}

.user-name {
  font-weight: 600;
  color: #111827;
}

.user-role {
  font-size: 0.8rem;
  color: #6b7280;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #374151;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover {
  background: #e5e7eb;
  color: #111827;
}

.sidebar-nav .link-danger {
  color: #b91c1c;
}

.sidebar-nav .link-danger:hover {
  background: #fee2e2;
  color: #7f1d1d;
}

.nav-icon {
  width: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.nav-label {
  flex: 1;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  margin-left: 0.4rem;
  border-radius: 9999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 1.1rem;
  color: #111827;
}

.content {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  margin-bottom: 1.2rem;
}

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

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

.card-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

/* Help / usage page */
.help-card {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.card-body {
  font-size: 0.9rem;
  color: #374151;
}

.help-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.help-section {
  padding-top: 0.25rem;
  border-top: 1px solid #e5e7eb;
}

.help-section:first-of-type {
  border-top: none;
}

.help-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.help-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.6rem;
  margin-bottom: 0.25rem;
}

.help-text {
  margin-bottom: 0.35rem;
}

.help-list {
  margin-left: 1.1rem;
  margin-bottom: 0.3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #eef2ff;
  border-color: rgba(129, 140, 248, 0.7);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
}

.btn-secondary {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
}

.btn-secondary:hover {
  background: #f3f4f6;
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  color: #fee2e2;
  border-color: rgba(248, 113, 113, 0.8);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #991b1b, #dc2626);
}

.btn-icon {
  padding: 0.35rem;
  min-width: 2rem;
}

.form-group {
  margin-bottom: 0.9rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: #4b5563;
}

.form-control {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 0.9rem;
}

.form-control:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.6);
}

.form-inline {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.alert {
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.alert-success {
  background: #ecfdf3;
  border: 1px solid #22c55e;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #b91c1c;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.table th,
.table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.table tr:nth-child(even) td {
  background: #f9fafb;
}

.table tr:hover td {
  background: #e5e7eb;
}

.btn-group-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.status-recue {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-en-cours {
  background: #dcfce7;
  color: #16a34a;
}

.status-attente {
  background: #fef3c7;
  color: #d97706;
}

.status-terminee {
  background: #ccfbf1;
  color: #0f766e;
}

.status-annulee {
  background: #fee2e2;
  color: #b91c1c;
}

.pay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
}

.pay-badge.paid {
  background: #16a34a;
}

.pay-badge.unpaid {
  background: #dc2626;
}

.alert-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.alert-item {
  border-radius: 0.6rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.alert-item a {
  display: block;
  padding: 0.45rem 0.6rem;
  text-decoration: none;
  color: #111827;
}

.alert-item-title {
  font-size: 0.86rem;
  font-weight: 600;
}

.alert-item-meta {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.alert-item:hover {
  background: #eef2ff;
  border-color: #4f46e5;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.18);
}

.alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.35rem;
  color: #f97316;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.45);
  padding: 1.5rem 1.75rem;
  max-width: 460px;
  width: 90%;
}

.modal-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.modal-card-body {
  font-size: 0.9rem;
  color: #374151;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #e0f2fe 0, #f3f4f6 40%, #e5e7eb 100%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem 1.7rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.login-title {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  color: #111827;
}

.login-subtitle {
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  color: #6b7280;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  font-size: 0.7rem;
  color: #6b7280;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loader-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.loader-overlay.is-visible {
  display: flex;
}

.loader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(3px);
}

.loader-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1.6rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.loader-spinner {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 9999px;
  border: 3px solid #e5e7eb;
  border-top-color: #4f46e5;
  animation: spin 0.8s linear infinite;
}

.loader-text {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: #4b5563;
}

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

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .topbar {
    position: static;
  }

  .content {
    padding: 1rem;
  }
}

@media (max-width: 600px) {
  .login-card {
    margin: 0 1rem;
  }
}

