:root {
  --green-primary: #1a6b3e;
  --green-dark: #145530;
  --green-light: #e8f5e9;
  --green-hover: #21804a;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --orange: #ea580c;
  --orange-light: #fff7ed;
  --red: #dc2626;
  --red-light: #fef2f2;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg-page: #f3f4f6;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --white: #ffffff;
  --sidebar-width: 280px;
  --header-height: 72px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--green-primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  overflow: hidden;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.sidebar-brand-art {
  width: 100%;
  max-width: 200px;
  display: block;
  margin: 0 auto;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  padding: 8px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.55;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.85;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-item.active {
  background: var(--white);
  color: var(--green-primary);
  border-left-color: var(--green-primary);
  font-weight: 600;
}

.nav-item.active i { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.nav-item.active .nav-badge {
  background: var(--green-light);
  color: var(--green-primary);
}

.nav-toggle .chevron {
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.15s;
}

.nav-group.open .nav-toggle .chevron {
  transform: rotate(180deg);
}

.nav-submenu {
  max-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
  transition: max-height 0.2s ease;
}

.nav-group.open .nav-submenu {
  max-height: 200px;
}

.nav-subitem {
  display: block;
  padding: 10px 20px 10px 50px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-subitem:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-subitem.active {
  color: var(--white);
  font-weight: 600;
}

/* ── Layout ── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--header-height);
}

.header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.menu-toggle:hover { background: var(--bg-page); }

.header-title { line-height: 1.3; }

.header-title h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-primary);
}

.header-title .subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
}

.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-page);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.header-search input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 62, 0.1);
  background: var(--white);
}

.header-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.15s;
}

.header-btn:hover { background: var(--bg-page); }

.header-btn .dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.header-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}

.header-user:hover { background: var(--bg-page); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 20;
}

.header-user.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--red);
  cursor: pointer;
  text-align: left;
}

.user-dropdown-item:hover { background: var(--red-light); }

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
}

.user-name i {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
}

.content {
  padding: 28px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-text h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-header-text p {
  font-size: 14px;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary {
  background: var(--green-primary);
  color: var(--white);
}

.btn-primary:hover { background: var(--green-hover); }

.btn-outline {
  background: var(--white);
  color: var(--text-dark);
  border: 1px solid var(--border);
}

.btn-outline:hover { background: var(--bg-page); }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 6px;
}

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

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

.stat-icon.green { background: var(--green-light); color: var(--green-primary); }
.stat-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }

.stat-info h3 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-trend {
  font-size: 12px;
  font-weight: 600;
}

.stat-trend.green { color: var(--green-primary); }
.stat-trend.blue { color: var(--blue); }
.stat-trend.orange { color: var(--orange); }
.stat-trend.purple { color: var(--purple); }

/* ── Panels ── */
.panel-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-grid.equal { grid-template-columns: 1fr 1fr; }
.panel-grid .panel.full { grid-column: 1 / -1; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.panel-header a {
  font-size: 12px;
  color: var(--green-primary);
  text-decoration: none;
  font-weight: 600;
}

.panel-body { padding: 0; }

.panel-body.padded { padding: 20px; }

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: #fafafa; }

.doc-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.doc-icon.pdf { background: #fef2f2; color: #dc2626; }
.doc-icon.doc { background: #eff6ff; color: #2563eb; }
.doc-icon.xls { background: #f0fdf4; color: #16a34a; }
.doc-icon.img { background: #faf5ff; color: #9333ea; }
.doc-icon.folder { background: #fff7ed; color: #ea580c; }

.doc-name {
  font-weight: 600;
  color: var(--text-dark);
  display: block;
  margin-bottom: 2px;
}

.doc-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: var(--green-light); color: var(--green-primary); }
.badge-warning { background: var(--orange-light); color: var(--orange); }
.badge-info { background: var(--blue-light); color: var(--blue); }
.badge-danger { background: var(--red-light); color: var(--red); }
.badge-neutral { background: var(--bg-page); color: var(--text-muted); }

/* ── Activity list ── */
.activity-list { list-style: none; }

.activity-item {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.activity-text {
  font-size: 13px;
  line-height: 1.45;
}

.activity-text strong { font-weight: 600; }

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Quick access cards ── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--green-primary);
}

.quick-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.quick-card h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.quick-card p {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ── Filters bar ── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-select,
.filter-input {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--white);
  outline: none;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--green-primary);
}

.filters-bar .spacer { flex: 1; }

.search-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-group .filter-input {
  min-width: 220px;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.view-toggle button {
  padding: 8px 12px;
  border: none;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

.view-toggle button.active {
  background: var(--green-primary);
  color: var(--white);
}

/* ── Folder grid ── */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.folder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.folder-card:hover {
  border-color: var(--green-primary);
  box-shadow: var(--shadow-card);
}

.folder-card .folder-icon {
  font-size: 32px;
  color: var(--orange);
  margin-bottom: 12px;
}

.folder-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.folder-card p {
  font-size: 12px;
  color: var(--text-muted);
}

.folder-card .folder-count {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green-primary);
}

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-page);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--green-primary);
  background: var(--green-light);
}

.upload-zone i {
  font-size: 48px;
  color: var(--green-primary);
  margin-bottom: 16px;
}

.upload-zone h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.upload-zone .formats {
  font-size: 11px;
  color: var(--text-light);
}

/* ── Form ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group.full { grid-column: 1 / -1; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 62, 0.1);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
}

.form-error {
  display: block;
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.alert-success {
  background: var(--green-light);
  color: var(--green-primary);
}

/* ── Settings tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}

.tab:hover { color: var(--text-dark); }

.tab.active {
  color: var(--green-primary);
  border-bottom-color: var(--green-primary);
}

/* ── User cards ── */
.user-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.user-card .user-avatar {
  width: 56px;
  height: 56px;
  font-size: 18px;
  margin: 0 auto 12px;
}

.user-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.user-card .role {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.user-card .user-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.user-card .user-stats strong {
  display: block;
  font-size: 16px;
  color: var(--text-dark);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-btns {
  display: flex;
  gap: 6px;
}

.pagination-btns button,
.pagination-btns a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}

.pagination-btns button.active,
.pagination-btns a.active {
  background: var(--green-primary);
  color: var(--white);
  border-color: var(--green-primary);
}

.pagination-btns a.disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* ── Configuration hub (grille 6 colonnes) ── */
.config-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.config-card {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 160px;
}

.config-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--green-primary);
}

.config-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.config-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
  line-height: 1.35;
}

.config-card p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.page-header.simple {
  display: block;
  margin-bottom: 28px;
}

.page-header.simple h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-header.simple p {
  font-size: 14px;
  color: var(--text-muted);
}

.header-title .responsible {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

/* ── Responsive ── */
@media (max-width: 1400px) {
  .config-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1200px) {
  .stats-grid,
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .config-grid { grid-template-columns: repeat(3, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .folder-grid { grid-template-columns: repeat(3, 1fr); }
  .user-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
    height: 100vh;
  }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper {
    margin-left: 0;
    padding-top: var(--header-height);
  }
  .header {
    left: 0;
  }
  .header-search { display: none; }
  .stats-grid,
  .quick-grid,
  .folder-grid,
  .form-grid,
  .user-grid { grid-template-columns: 1fr; }
  .content { padding: 20px 16px; }
  .config-grid { grid-template-columns: repeat(2, 1fr); }
  .header-title .responsible { display: none; }
}

@media (max-width: 480px) {
  .config-grid { grid-template-columns: 1fr; }
}

/* ── Login ── */
body.login-page {
  display: block;
  min-height: 100vh;
}

.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.login-brand {
  position: relative;
  overflow: hidden;
  background: var(--green-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.login-brand-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.login-brand-blob {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  background: var(--white);
  filter: blur(10px);
  pointer-events: none;
}

.login-brand-blob.blob-1 {
  width: 260px;
  height: 260px;
  top: -80px;
  right: -80px;
  opacity: 0.07;
}

.login-brand-blob.blob-2 {
  width: 200px;
  height: 200px;
  bottom: -60px;
  left: -60px;
  opacity: 0.06;
}

.login-brand-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
}

.login-brand-art {
  width: 100%;
  display: block;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.18));
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--bg-page);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.login-card-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-card-logo {
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 0 auto 20px;
  display: none;
}

.login-card-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.login-card-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.login-form .form-group { margin-bottom: 20px; }

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap > i:first-child {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
  pointer-events: none;
}

.input-icon-wrap input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-icon-wrap input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 62, 0.1);
}

.input-icon-wrap:has(.password-toggle) input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
}

.password-toggle:hover {
  color: var(--text-muted);
  background: var(--bg-page);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.login-remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--green-primary);
}

.login-forgot {
  font-size: 13px;
  font-weight: 500;
  color: var(--green-primary);
  text-decoration: none;
}

.login-forgot:hover { text-decoration: underline; }

.login-submit {
  width: 100%;
  justify-content: center;
  padding: 12px 18px;
  font-size: 14px;
}

.login-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
}

.login-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
}

.login-back:hover { color: var(--green-primary); }

.login-alert {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.login-alert[hidden] { display: none; }

.login-alert.success {
  background: var(--green-light);
  border: 1px solid rgba(26, 107, 62, 0.2);
  color: var(--green-dark);
}

.login-alert.error {
  background: var(--red-light);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--red);
}

.login-alert > i {
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.login-alert strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.login-alert p {
  color: var(--text-muted);
  margin: 0;
}

.login-alert-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  color: var(--green-primary);
  text-decoration: none;
}

.login-alert-link:hover { text-decoration: underline; }

.login-alert .btn {
  margin-top: 16px;
  width: 100%;
  justify-content: center;
}

.login-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-light);
}

/* ── Nivellement form ── */
.nivellement-panel {
  max-width: 720px;
}

.nivellement-panel .panel-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nivellement-panel .panel-header h3 i {
  color: var(--green-primary);
  font-size: 14px;
}

.nivellement-form .form-grid {
  grid-template-columns: 1fr 1fr;
}

.nivellement-form .form-group label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.nivellement-form .input-icon-wrap input {
  background: var(--bg-page);
}

.nivellement-form .input-icon-wrap input:focus {
  background: var(--bg-card);
}

.nivellement-form .form-actions {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 20px;
}

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card-logo { display: block; }
  .login-panel { padding: 32px 20px; }
  .login-card { padding: 32px 24px; }
}
