:root {
  --maheberg-navy: #0f2238;
  --maheberg-navy-dark: #0a1726;
  --maheberg-navy-light: #183354;
  --maheberg-blue: #2563eb;
  --maheberg-blue-hover: #1d4ed8;
  --maheberg-blue-soft: #eff6ff;
  --maheberg-red: #dc2626;
  --maheberg-red-hover: #b91c1c;
  --maheberg-red-soft: #fef2f2;
  --maheberg-bg: #f8fafc;
  --maheberg-surface: #ffffff;
  --maheberg-border: #e2e8f0;
  --maheberg-text: #1e293b;
  --maheberg-text-muted: #64748b;
  --sidebar-width: 270px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--maheberg-bg);
  color: var(--maheberg-text);
  overflow-x: hidden;
}

/* Sidebar Styling */
.app-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--maheberg-navy);
  color: #ffffff;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--maheberg-navy-dark);
}

.sidebar-logo {
  height: 48px;
  max-width: 100%;
  object-fit: contain;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.sidebar-heading {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #94a3b8;
  padding: 0.75rem 0.75rem 0.25rem;
  font-weight: 700;
}

.nav-sidebar .nav-link {
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

.nav-sidebar .nav-link i {
  font-size: 1.15rem;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.nav-sidebar .nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-sidebar .nav-link:hover i {
  color: var(--maheberg-blue);
}

.nav-sidebar .nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--maheberg-blue) 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.nav-sidebar .nav-link.active i {
  color: #ffffff;
}

.sidebar-user {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

/* Main Layout */
.app-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.app-topbar {
  height: 68px;
  background-color: var(--maheberg-surface);
  border-bottom: 1px solid var(--maheberg-border);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-content {
  flex: 1;
  padding: 1.75rem;
}

/* Cards & Surfaces */
.card-maheberg {
  background: var(--maheberg-surface);
  border: 1px solid var(--maheberg-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-clickable {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 34, 56, 0.08);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* Buttons */
.btn-maheberg {
  background-color: var(--maheberg-blue);
  color: #ffffff;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  transition: all 0.2s ease;
}

.btn-maheberg:hover {
  background-color: var(--maheberg-blue-hover);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-maheberg-danger {
  background-color: var(--maheberg-red);
  color: #ffffff;
  font-weight: 600;
  border: none;
  border-radius: 8px;
}

.btn-maheberg-danger:hover {
  background-color: var(--maheberg-red-hover);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

/* Tables */
.table-maheberg {
  margin-bottom: 0;
}

.table-maheberg thead th {
  background-color: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  border-top: none;
  border-bottom: 1px solid var(--maheberg-border);
  padding: 0.75rem 1rem;
}

.table-maheberg tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--maheberg-border);
  font-size: 0.88rem;
}

/* Badges */
.badge-actif { background-color: #dcfce7; color: #166534; font-weight: 600; }
.badge-en_attente { background-color: #fef9c3; color: #854d0e; font-weight: 600; }
.badge-honoraire { background-color: #e0e7ff; color: #3730a3; font-weight: 600; }
.badge-bienfaiteur { background-color: #fce7f3; color: #9d174d; font-weight: 600; }
.badge-archive { background-color: #f1f5f9; color: #475569; font-weight: 600; }

.badge-planifie { background-color: #e0f2fe; color: #0369a1; font-weight: 600; }
.badge-en_cours { background-color: #dbeafe; color: #1d4ed8; font-weight: 600; }
.badge-en_pause { background-color: #fef3c7; color: #92400e; font-weight: 600; }
.badge-termine { background-color: #dcfce7; color: #166534; font-weight: 600; }
.badge-annule { background-color: #fee2e2; color: #991b1b; font-weight: 600; }

/* Kanban Board */
.kanban-board {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.kanban-column {
  flex: 0 0 320px;
  background-color: #f1f5f9;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--maheberg-navy);
}

.kanban-items {
  flex: 1;
  overflow-y: auto;
  min-height: 150px;
}

.kanban-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: grab;
  transition: all 0.2s ease;
}

.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--maheberg-blue);
}

/* Organigram Tree */
.organigram-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem 0;
}

.organigram-node {
  background: #ffffff;
  border: 2px solid var(--maheberg-navy);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(15, 34, 56, 0.08);
  position: relative;
}

.organigram-node.president {
  border-color: var(--maheberg-blue);
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
  .app-sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
  }
  .app-sidebar.show {
    margin-left: 0;
  }
  .app-main {
    margin-left: 0;
  }
}
