/**
 * DAN ERP - Unified Theme CSS
 * Version 2.0 - Applied to all modules
 */

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #1a3a5c;
  --primary-light: #2e6da4;
  --accent: #f39c12;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  --light: #f4f6f9;
  --dark: #2c3e50;
  --border: #dce3ec;
  --white: #ffffff;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --header-h: 110px;
  --tabs-h: 48px;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--light);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== HEADER ===== */
.app-header {
  background: linear-gradient(135deg, #0f2440 0%, #1a3a5c 45%, #2e6da4 100%);
  color: #fff;
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.app-header .subtitle {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 2px;
}

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

.btn-accueil {
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-accueil:hover {
  background: rgba(255, 255, 255, 0.28);
}

.tenant-sel {
  padding: 6px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 0.82rem;
}

.tenant-sel option {
  color: #333;
  background: #fff;
}

/* ===== TABS BAR ===== */
.tabs-bar {
  background: var(--white);
  border-bottom: none;
  display: flex;
  flex-wrap: wrap;
  overflow-x: auto;
  padding: 0;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  scrollbar-width: none;
}

.tabs-bar.dan-tabs-scrollable {
  align-content: flex-start;
  max-height: 8.75rem;
  overflow-y: scroll;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  padding-right: 0.35rem;
  scrollbar-width: thin;
}

.tabs-bar::-webkit-scrollbar {
  display: none;
}

.tabs-bar.dan-tabs-scrollable::-webkit-scrollbar {
  display: block;
  width: 8px;
  height: 8px;
}

.tabs-bar.dan-tabs-scrollable::-webkit-scrollbar-thumb {
  background: rgba(16, 35, 62, 0.18);
  border-radius: 999px;
}

.tabs-bar.dan-tabs-scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.tab-btn {
  padding: 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #7f8c8d;
  border-bottom: 3px solid transparent;
  white-space: normal;
  transition: all 0.2s;
  flex: 1 1 140px;
  min-width: 140px;
  text-align: center;
}

.tab-btn.active {
  background: #f8f9fa;
  color: var(--primary-light);
  border-bottom-color: var(--primary-light);
}

.tab-btn:hover:not(.active) {
  color: var(--primary);
  background: var(--light);
}

/* ===== MAIN CONTENT ===== */
.main {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.container,
.content,
.main-content,
.page-body {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  background: var(--white);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  padding: 2rem;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  background: var(--white);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  padding: 2rem;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 20px;
}

.panel,
.receipt-panel,
.quick-actions,
.hero-card,
.report-card,
.cashbox-card,
.alert-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.card-icon {
  width: 55px;
  height: 55px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
}

.stat-value {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.stat-label {
  color: #7f8c8d;
  font-size: 0.95rem;
}

.kpi-box {
  background: var(--white);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.kpi-ico {
  font-size: 24px;
  margin-bottom: 6px;
}

.kpi-val {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary-light);
}

.kpi-lbl {
  font-size: 0.78rem;
  color: #7f8c8d;
  margin-top: 5px;
  font-weight: 500;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== KPI GRID ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary-light);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card.green {
  border-left-color: var(--success);
}

.kpi-card.red {
  border-left-color: var(--danger);
}

.kpi-card.yellow {
  border-left-color: var(--warning);
}

.kpi-card.blue {
  border-left-color: var(--info);
}

.kpi-card.purple {
  border-left-color: #9b59b6;
}

.kpi-val {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.dan-upgrade-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.46);
  z-index: 12050;
}

.dan-upgrade-modal.visible {
  display: flex;
}

.dan-upgrade-dialog {
  width: min(100%, 460px);
  padding: 1.35rem;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.24);
}

.dan-upgrade-title {
  margin: 0 0 0.6rem;
  font-size: 1.12rem;
  color: #0f172a;
}

.dan-upgrade-message {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.dan-upgrade-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.15rem;
}

.dan-upgrade-primary,
.dan-upgrade-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.dan-upgrade-primary {
  flex: 1;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
}

.dan-upgrade-secondary {
  border: none;
  background: #f8fafc;
  color: #334155;
}

.kpi-label {
  font-size: 0.78rem;
  color: #888;
  margin-top: 5px;
  font-weight: 500;
}

/* ===== GRIDS ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--primary-light);
  color: #fff;
}

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

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  filter: brightness(0.88);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(0.88);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-warning:hover {
  filter: brightness(0.88);
}

.btn-info {
  background: var(--info);
  color: #fff;
}

.btn-info:hover {
  filter: brightness(0.88);
}

.btn-outline {
  background: var(--white);
  border: 1.5px solid var(--primary-light);
  color: var(--primary-light);
}

.btn-outline:hover {
  background: var(--primary-light);
  color: #fff;
}

.btn-secondary {
  background: #7f8c8d;
  color: #fff;
}

.btn-secondary:hover {
  background: #6c7a7d;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 0.94rem;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}

.form-control,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
  color: var(--dark);
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.12);
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

/* ===== TABLES ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

thead th {
  background: var(--primary);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #f8f9fb;
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-green {
  background: #d4edda;
  color: #155724;
}

.badge-blue {
  background: #d1ecf1;
  color: #0c5460;
}

.badge-yellow {
  background: #fff3cd;
  color: #856404;
}

.badge-red {
  background: #f8d7da;
  color: #721c24;
}

.badge-gray {
  background: #e2e3e5;
  color: #383d41;
}

.badge-purple {
  background: #e2d9f3;
  color: #432874;
}

.badge-orange {
  background: #ffe0b2;
  color: #e65100;
}

/* Legacy status aliases */
.status-actif,
.status-active,
.status-approuve,
.status-termine,
/* .status-livre, .status-valide, .status-payee { @extend .badge-green; background: #d4edda; color: #155724; } */
.status-livre,
.status-valide,
.status-payee {
  background: #d4edda;
  color: #155724;
}

.status-en-cours,
.status-en_cours,
.status-assignee {
  background: #d1ecf1;
  color: #0c5460;
}

.status-brouillon,
.status-inactif,
.status-creee {
  background: #e2e3e5;
  color: #383d41;
}

.status-rejete,
.status-annule,
.status-impayee,
.status-bloquee {
  background: #f8d7da;
  color: #721c24;
}

.status-attente,
.status-pending,
.status-suspendu {
  background: #fff3cd;
  color: #856404;
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error,
.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open,
.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-close,
.close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover,
.close:hover {
  color: var(--danger);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== PROGRESS BARS ===== */
.progress-bar {
  background: #e9ecef;
  border-radius: 50px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 50px;
  background: var(--success);
  transition: width 0.5s ease;
}

.progress-fill.warning {
  background: var(--warning);
}

.progress-fill.danger {
  background: var(--danger);
}

.progress-fill.info {
  background: var(--info);
}

/* ===== DASHBOARD MENU CARDS ===== */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.menu-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary-light);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-left-color 0.2s;
}

.menu-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--accent);
}

.menu-card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.menu-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.menu-card p {
  font-size: 0.8rem;
  color: #7f8c8d;
  line-height: 1.4;
}

/* ===== TIMELINE ===== */
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  width: 2px;
  height: calc(100% + 4px);
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  z-index: 1;
}

.dot-green {
  background: #d4edda;
}

.dot-yellow {
  background: #fff3cd;
}

.dot-blue {
  background: #d1ecf1;
}

.dot-red {
  background: #f8d7da;
}

/* ===== GANTT ===== */
.gantt-container {
  overflow-x: auto;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
}

.gantt-row {
  display: flex;
  align-items: center;
  margin-bottom: 7px;
  min-height: 34px;
}

.gantt-label {
  width: 200px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 10px;
}

.gantt-timeline {
  flex: 1;
  position: relative;
  height: 26px;
  background: #f0f4f8;
  border-radius: 4px;
}

.gantt-bar {
  position: absolute;
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.72rem;
  color: #fff;
  font-weight: 600;
  min-width: 20px;
  cursor: pointer;
}

.gantt-bar.en-cours {
  background: var(--primary-light);
}

.gantt-bar.termine {
  background: var(--success);
}

.gantt-bar.a-faire {
  background: #adb5bd;
}

.gantt-bar.critique {
  background: var(--danger);
}

/* ===== MISC UTILITIES ===== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.font-bold {
  font-weight: 700;
}

.text-muted {
  color: #7f8c8d;
  font-size: 0.85rem;
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-primary {
  color: var(--primary-light);
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.gap-1 {
  gap: 8px;
}

.gap-2 {
  gap: 16px;
}

.flex-wrap {
  flex-wrap: wrap;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 32px;
  color: #7f8c8d;
  font-size: 0.9rem;
}

.loading::before {
  content: '⏳ ';
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #7f8c8d;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.filter-bar label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

.filter-bar select,
.filter-bar input {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  background: var(--light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .app-header {
    padding: 0 14px;
  }

  .app-header h1 {
    font-size: 1rem;
  }

  .app-header .subtitle {
    display: none;
  }

  .main {
    padding: 14px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

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

  .gantt-label {
    width: 120px;
  }

  .modal {
    padding: 20px;
  }

  .tabs-bar {
    padding: 0 8px;
  }
}

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

  .app-header-right .tenant-sel {
    display: none;
  }
}

/* ===== SCROLLBAR (subtle) ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* ===== DAN PREMIUM SHELL OVERRIDES ===== */
body.dan-premium-shell {
  --dan-sidebar-w: 292px;
  --dan-header-h: 84px;
  --dan-content-pad: 24px;
  background: radial-gradient(circle at top left, rgba(33, 79, 130, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(243, 156, 18, 0.16), transparent 22%),
    linear-gradient(180deg, #eef3f9 0%, #f7f9fc 48%, #edf2f8 100%);
  color: #132238;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

body.dan-premium-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(15, 36, 64, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 36, 64, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.34;
  pointer-events: none;
  z-index: 0;
}

body.dan-premium-shell > * {
  position: relative;
  z-index: 1;
}

body.dan-premium-shell .app-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  height: var(--dan-header-h);
  padding: 0 24px;
  border: 1px solid rgba(15, 36, 64, 0.08);
  border-top: none;
  border-left: none;
  border-right: none;
  border-radius: 0;
  background: linear-gradient(135deg, rgba(14, 36, 63, 0.94), rgba(28, 61, 102, 0.92));
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(15, 36, 64, 0.16);
  overflow: hidden;
  z-index: 160;
  isolation: isolate;
  pointer-events: auto;
}

body.dan-premium-shell .app-header::after {
  content: '';
  position: absolute;
  inset: auto -12% -48% 56%;
  height: 120px;
  background: radial-gradient(circle, rgba(243, 156, 18, 0.42), transparent 68%);
  pointer-events: none;
}

body.dan-premium-shell .app-header > * {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

body.dan-premium-shell .app-header-left,
body.dan-premium-shell .app-header-right,
body.dan-premium-shell .dan-header-tools,
body.dan-premium-shell .dan-profile-chip,
body.dan-premium-shell .dan-language-switch,
body.dan-premium-shell .dan-shell-toggle,
body.dan-premium-shell .btn-accueil,
body.dan-premium-shell .btn-signaler-probleme,
body.dan-premium-shell .dan-header-icon,
body.dan-premium-shell .tenant-sel,
body.dan-premium-shell .dan-language-select,
body.dan-premium-shell .app-header a,
body.dan-premium-shell .app-header button,
body.dan-premium-shell .app-header select {
  position: relative;
  z-index: 2;
  pointer-events: auto !important;
}

body.dan-premium-shell .app-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

body.dan-premium-shell .app-header-left h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

body.dan-premium-shell .app-header-left .subtitle,
body.dan-premium-shell .dan-header-kicker,
body.dan-premium-shell .dan-language-switch,
body.dan-premium-shell .tenant-sel,
body.dan-premium-shell .dan-header-tools,
body.dan-premium-shell .dan-profile-chip {
  display: none !important;
}

body.dan-premium-shell .app-header .subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.74);
}

body.dan-premium-shell .dan-header-kicker {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

body.dan-premium-shell .dan-shell-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

body.dan-premium-shell .dan-shell-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(250, 204, 21, 0.45);
}

body.dan-premium-shell .dan-shell-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

body.dan-premium-shell .dan-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  border: none;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

body.dan-premium-shell .app-header-right {
  gap: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

body.dan-premium-shell .dan-header-left-locked {
  min-width: 0;
}

body.dan-premium-shell .dan-header-actions > :not(.btn-accueil):not(.btn-signaler-probleme):not(.dan-header-icon):not(.dan-user-chip) {
  display: none !important;
}

body.dan-premium-shell .dan-user-chip {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  min-width: 160px;
}

body.dan-premium-shell .dan-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f7c75f, #c99211);
  color: #102036;
  font-size: 0.74rem;
  font-weight: 800;
  flex-shrink: 0;
}

body.dan-premium-shell .dan-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dan-premium-shell .dan-header-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: 4px;
}

body.dan-premium-shell .dan-header-icon,
body.dan-premium-shell .btn-accueil,
body.dan-premium-shell .tenant-sel,
body.dan-premium-shell .btn-signaler-probleme {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.16s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

body.dan-premium-shell .dan-header-icon {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

body.dan-premium-shell .dan-header-icon:hover,
body.dan-premium-shell .btn-accueil:hover,
body.dan-premium-shell .tenant-sel:hover,
body.dan-premium-shell .btn-signaler-probleme:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 36, 64, 0.18);
}

body.dan-premium-shell .dan-header-icon-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.18);
}

body.dan-premium-shell .dan-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 168px;
  padding: 7px 14px 7px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.dan-premium-shell .dan-profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f7c75f, #c99211);
  color: #102036;
  font-size: 0.82rem;
  font-weight: 800;
}

body.dan-premium-shell .dan-profile-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

body.dan-premium-shell .dan-profile-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.64);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.dan-premium-shell .dan-profile-role {
  font-size: 0.82rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dan-premium-shell .dan-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: 0.85rem;
  color: #f8fafc;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.dan-premium-shell .dan-language-select {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

body.dan-premium-shell .dan-language-select option {
  color: #0f172a;
  background: #fff;
}

body.dan-premium-shell .btn-accueil,
body.dan-premium-shell .tenant-sel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

body.dan-premium-shell .tenant-sel option {
  color: #132238;
}

body.dan-premium-shell .btn-signaler-probleme {
  background: linear-gradient(135deg, rgba(243, 116, 116, 0.18), rgba(223, 62, 62, 0.22));
  border: 1px solid rgba(255, 116, 116, 0.26);
}

body.dan-premium-shell .tabs-bar {
  position: fixed !important;
  left: 0;
  top: var(--dan-header-h);
  bottom: 0;
  width: var(--dan-sidebar-w);
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  gap: 8px;
  padding: 18px 14px 16px !important;
  border: none;
  border-right: 1px solid rgba(15, 36, 64, 0.08);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 253, 0.94));
  box-shadow: 10px 0 32px rgba(31, 48, 74, 0.08);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 120;
}

body.dan-premium-shell .tabs-bar.dan-tabs-scrollable {
  max-height: none;
  height: auto;
  overflow-y: scroll !important;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

body.dan-premium-shell .tabs-bar.dan-tabs-scrollable::-webkit-scrollbar {
  display: block;
  width: 8px;
}

body.dan-premium-shell .dan-sidebar-brand {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(15, 36, 64, 0.08);
}

body.dan-premium-shell .dan-sidebar-logo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10233e, #214f82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 28px rgba(24, 53, 87, 0.18);
}

body.dan-premium-shell .dan-sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

body.dan-premium-shell .dan-sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

body.dan-premium-shell .dan-sidebar-kicker {
  font-size: 0.69rem;
  font-weight: 800;
  color: #9aa8ba;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

body.dan-premium-shell .dan-sidebar-module {
  font-size: 1rem;
  color: #14233b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dan-premium-shell .dan-sidebar-sub {
  font-size: 0.77rem;
  color: #7b8898;
}

body.dan-premium-shell .tab-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: #60728a;
  font-size: 0.88rem;
  font-weight: 700;
  border-bottom: none !important;
  white-space: normal;
  line-height: 1.25;
  flex: none;
  min-width: 0;
  text-align: left;
}

body.dan-premium-shell .tab-btn:hover {
  color: #163761;
  background: rgba(22, 55, 97, 0.06);
  border-color: rgba(22, 55, 97, 0.08);
}

body.dan-premium-shell .tab-btn.active {
  color: #10233e;
  background: linear-gradient(135deg, rgba(18, 60, 106, 0.12), rgba(243, 156, 18, 0.12));
  border-color: rgba(18, 60, 106, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

body.dan-premium-shell .dan-sidebar-footer {
  margin-top: auto;
  padding: 16px 12px 8px;
  font-size: 0.77rem;
  color: #8796a8;
  border-top: 1px solid rgba(15, 36, 64, 0.08);
}

body.dan-premium-shell .dan-sidebar-foot-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.67rem;
  margin-bottom: 4px;
}

body.dan-premium-shell .dan-sidebar-foot-value {
  color: #17385f;
  font-weight: 700;
}

body.dan-premium-shell .main,
body.dan-premium-shell .content,
body.dan-premium-shell .container,
body.dan-premium-shell .main-content,
body.dan-premium-shell .page-body {
  position: fixed !important;
  top: var(--dan-header-h);
  right: 0;
  bottom: 0;
  left: var(--dan-sidebar-w);
  max-width: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: var(--dan-content-pad) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.dan-premium-shell .tab-panel.active,
body.dan-premium-shell .tab-content.active {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

body.dan-premium-shell > .module-container,
body.dan-premium-shell > .tab-content {
  position: fixed !important;
  top: var(--dan-header-h);
  right: 0;
  bottom: 0;
  left: var(--dan-sidebar-w);
  box-sizing: border-box;
  max-width: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: var(--dan-content-pad) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  min-width: 0;
}

body.dan-premium-shell .main > form,
body.dan-premium-shell .content > form,
body.dan-premium-shell .main-content > form,
body.dan-premium-shell .page-body > form,
body.dan-premium-shell .tab-panel > form,
body.dan-premium-shell .page > form {
  width: min(100%, 860px);
  margin-inline: auto !important;
}

body.dan-premium-shell .modal-overlay,
body.dan-premium-shell .modal.show,
body.dan-premium-shell .modal.active,
body.dan-premium-shell .modal.dan-modal-visible {
  z-index: 240 !important;
}

body.dan-premium-shell .modal-overlay,
body.dan-premium-shell .modal.dan-modal-visible {
  inset: var(--dan-header-h) 0 0 0 !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 16px 24px 24px calc(var(--dan-sidebar-w) + 24px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.dan-premium-shell .modal.dan-modal-visible {
  display: flex !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  background: rgba(0, 0, 0, 0.52) !important;
}

body.dan-premium-shell .modal,
body.dan-premium-shell .modal-box,
body.dan-premium-shell .modal-content {
  width: min(100%, 860px) !important;
  max-width: min(860px, calc(100vw - var(--dan-sidebar-w) - 72px)) !important;
  margin: 0 auto !important;
  max-height: calc(100vh - var(--dan-header-h) - 42px) !important;
  overflow-y: auto !important;
}

body.dan-premium-shell .modal.dan-modal-visible > .modal-content,
body.dan-premium-shell .modal.dan-modal-visible > form,
body.dan-premium-shell .modal.dan-modal-visible > div {
  width: min(100%, 860px) !important;
  max-width: min(860px, calc(100vw - var(--dan-sidebar-w) - 56px)) !important;
  margin: 0 auto !important;
  max-height: calc(100vh - var(--dan-header-h) - 42px) !important;
  overflow-y: auto !important;
}

body.dan-premium-shell .modal.modal-lg,
body.dan-premium-shell .modal-box.modal-lg,
body.dan-premium-shell .modal-content.modal-lg {
  width: min(100%, 1040px) !important;
  max-width: min(1040px, calc(100vw - var(--dan-sidebar-w) - 72px)) !important;
}

body.dan-premium-shell .card,
body.dan-premium-shell .section,
body.dan-premium-shell .chart-card,
body.dan-premium-shell .table-card,
body.dan-premium-shell .sidebar-panel,
body.dan-premium-shell .modal-box,
body.dan-premium-shell .search-bar,
body.dan-premium-shell .filter-bar,
body.dan-premium-shell .vendeur-card,
body.dan-premium-shell .totaux-box,
body.dan-premium-shell .section-header,
body.dan-premium-shell .upload-zone {
  border: 1px solid rgba(15, 36, 64, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(10px);
}

body.dan-premium-shell .kpi-card,
body.dan-premium-shell .ratio-card,
body.dan-premium-shell .stat-badge,
body.dan-premium-shell .ech-row,
body.dan-premium-shell .alerte-item,
body.dan-premium-shell .workflow-step {
  border-radius: 12px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07) !important;
}

body.dan-premium-shell .grid-kpi {
  gap: 1rem !important;
}

body.dan-premium-shell .kpi-box {
  border-radius: 12px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07) !important;
  padding: 1rem !important;
}

body.dan-premium-shell .kpi-ico {
  font-size: 24px !important;
}

body.dan-premium-shell .kpi-val {
  font-size: 1.9rem !important;
  color: var(--primary-light) !important;
}

body.dan-premium-shell .kpi-lbl {
  font-size: 0.78rem !important;
  color: #7f8c8d !important;
}

body.dan-premium-shell .btn,
body.dan-premium-shell button.btn,
body.dan-premium-shell .btn-primary,
body.dan-premium-shell .btn-success,
body.dan-premium-shell .btn-danger,
body.dan-premium-shell .btn-warning,
body.dan-premium-shell .btn-info,
body.dan-premium-shell .btn-outline,
body.dan-premium-shell .btn-secondary {
  border-radius: 8px !important;
  min-height: 38px;
  padding: 0.7rem 1rem !important;
  font-size: 0.85rem !important;
}

body.dan-premium-shell .btn-sm,
body.dan-premium-shell .btn-xs {
  min-height: auto;
  padding: 0.35rem 0.7rem !important;
  font-size: 0.75rem !important;
}

body.dan-premium-shell .filters input,
body.dan-premium-shell .filters select,
body.dan-premium-shell .search-input,
body.dan-premium-shell .search-bar input,
body.dan-premium-shell .filter-bar input,
body.dan-premium-shell .filter-bar select {
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  min-height: 38px;
}

body.dan-premium-shell .kpi-card {
  min-height: 144px;
  padding: 16px;
  border: 1px solid rgba(15, 36, 64, 0.06);
  border-left-width: 1px;
  border-top-width: 1px;
}

body.dan-premium-shell .kpi-card::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(18, 60, 106, 0.08), rgba(243, 156, 18, 0.12));
  opacity: 0.8;
}

body.dan-premium-shell .kpi-val,
body.dan-premium-shell .kpi-value,
body.dan-premium-shell .ratio-val {
  font-size: clamp(1.7rem, 2vw, 2.2rem) !important;
  font-weight: 800 !important;
  color: #11233b !important;
}

body.dan-premium-shell .card-title,
body.dan-premium-shell .section-title,
body.dan-premium-shell .section-header h2,
body.dan-premium-shell .chart-card h3,
body.dan-premium-shell .table-header h3,
body.dan-premium-shell .sidebar-panel h4,
body.dan-premium-shell .form-section-title {
  color: #11233b !important;
  border-bottom-color: rgba(15, 36, 64, 0.08) !important;
}

body.dan-premium-shell table,
body.dan-premium-shell .doc-table,
body.dan-premium-shell .data-table {
  border-collapse: separate;
  border-spacing: 0;
}

body.dan-premium-shell th,
body.dan-premium-shell thead th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(15, 36, 64, 0.04), rgba(15, 36, 64, 0.01)) !important;
  color: #5a6980 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(15, 36, 64, 0.08) !important;
}

body.dan-premium-shell td,
body.dan-premium-shell tbody td {
  border-bottom: 1px solid rgba(15, 36, 64, 0.06) !important;
  color: #24364d !important;
}

body.dan-premium-shell tr:hover td,
body.dan-premium-shell tbody tr:hover td {
  background: rgba(18, 60, 106, 0.03) !important;
}

body.dan-premium-shell input,
body.dan-premium-shell select,
body.dan-premium-shell textarea,
body.dan-premium-shell .search-input,
body.dan-premium-shell .filter-sel {
  min-height: 44px;
  border-radius: 14px !important;
  border: 1px solid rgba(15, 36, 64, 0.11) !important;
  background: rgba(250, 252, 255, 0.96) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.dan-premium-shell textarea {
  min-height: 96px;
}

body.dan-premium-shell input:focus,
body.dan-premium-shell select:focus,
body.dan-premium-shell textarea:focus,
body.dan-premium-shell .search-input:focus,
body.dan-premium-shell .filter-sel:focus {
  border-color: rgba(33, 79, 130, 0.6) !important;
  box-shadow: 0 0 0 4px rgba(33, 79, 130, 0.12) !important;
}

body.dan-premium-shell .btn,
body.dan-premium-shell .btn-primary,
body.dan-premium-shell .btn-secondary,
body.dan-premium-shell .btn-success,
body.dan-premium-shell .btn-warning,
body.dan-premium-shell .btn-danger,
body.dan-premium-shell .btn-outline,
body.dan-premium-shell .btn-search,
body.dan-premium-shell .auth-btn,
body.dan-premium-shell .auth-btn-secondary,
body.dan-premium-shell .comp-logo-btn,
body.dan-premium-shell .legal-accept-btn,
body.dan-premium-shell .legal-close-btn {
  min-height: 44px;
  border-radius: 14px !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 20px rgba(15, 36, 64, 0.08);
}

body.dan-premium-shell .btn-primary,
body.dan-premium-shell .auth-btn,
body.dan-premium-shell .legal-accept-btn,
body.dan-premium-shell .btn-search {
  background: linear-gradient(135deg, #17385f, #285d96) !important;
}

body.dan-premium-shell .btn-success {
  background: linear-gradient(135deg, #1f8e63, #27ae60) !important;
}

body.dan-premium-shell .btn-warning {
  background: linear-gradient(135deg, #d48707, #f2b132) !important;
}

body.dan-premium-shell .btn-outline,
body.dan-premium-shell .btn-secondary,
body.dan-premium-shell .legal-close-btn,
body.dan-premium-shell .auth-btn-secondary {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(15, 36, 64, 0.1) !important;
  color: #17385f !important;
}

body.dan-premium-shell .btn:hover,
body.dan-premium-shell .btn-primary:hover,
body.dan-premium-shell .btn-secondary:hover,
body.dan-premium-shell .btn-success:hover,
body.dan-premium-shell .btn-warning:hover,
body.dan-premium-shell .btn-danger:hover,
body.dan-premium-shell .btn-outline:hover,
body.dan-premium-shell .btn-search:hover,
body.dan-premium-shell .auth-btn:hover,
body.dan-premium-shell .auth-btn-secondary:hover,
body.dan-premium-shell .comp-logo-btn:hover,
body.dan-premium-shell .legal-accept-btn:hover,
body.dan-premium-shell .legal-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 36, 64, 0.12);
}

body.dan-premium-shell .modal {
  backdrop-filter: blur(6px);
}

body.dan-premium-shell .toast,
body.dan-premium-shell .toast-item {
  border-radius: 18px !important;
  box-shadow: 0 18px 36px rgba(15, 36, 64, 0.18) !important;
}

body.dan-premium-shell .dan-toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 220;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}

body.dan-premium-shell .dan-toast-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  color: #1f2937;
  animation: dan-toast-in 0.18s ease;
}

body.dan-premium-shell .dan-toast-item.is-leaving {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body.dan-premium-shell .dan-toast-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

body.dan-premium-shell .dan-toast-copy strong {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0f172a;
}

body.dan-premium-shell .dan-toast-copy span {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #334155;
}

body.dan-premium-shell .dan-toast-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

body.dan-premium-shell .dan-toast-close:hover {
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

body.dan-premium-shell .dan-toast-info {
  border-left: 4px solid #2563eb;
}

body.dan-premium-shell .dan-toast-success {
  border-left: 4px solid #16a34a;
}

body.dan-premium-shell .dan-toast-warning {
  border-left: 4px solid #f59e0b;
}

body.dan-premium-shell .dan-toast-error {
  border-left: 4px solid #dc2626;
}

@keyframes dan-toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  body.dan-premium-shell {
    --dan-sidebar-w: 246px;
  }
}

@media (max-width: 980px) {
  body.dan-premium-shell .dan-shell-toggle {
    display: inline-flex;
  }

  body.dan-premium-shell .dan-sidebar-backdrop {
    display: none;
  }

  body.dan-premium-shell .tabs-bar {
    position: fixed !important;
    top: var(--dan-header-h);
    left: 0;
    bottom: 0;
    width: min(320px, calc(100vw - 40px));
    margin: 0;
    padding: 18px 14px 24px !important;
    border-right: 1px solid rgba(15, 36, 64, 0.08);
    border-radius: 0 22px 22px 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: translateX(calc(-100% - 22px));
    transition: transform 0.24s ease;
    z-index: 120;
  }

  body.dan-premium-shell.dan-sidebar-open .tabs-bar {
    transform: translateX(0);
  }

  body.dan-premium-shell.dan-sidebar-open .dan-sidebar-backdrop {
    display: block;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  body.dan-premium-shell:not(.dan-sidebar-open) .dan-sidebar-backdrop {
    display: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  body.dan-premium-shell .app-header {
    left: 0;
    right: 0;
    top: 0;
  }

  body.dan-premium-shell .main,
  body.dan-premium-shell .content,
  body.dan-premium-shell .main-content,
  body.dan-premium-shell .page-body {
    top: var(--dan-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 !important;
    padding: 18px 16px 24px !important;
  }

  body.dan-premium-shell > .module-container,
  body.dan-premium-shell > .tab-content {
    width: auto !important;
    top: var(--dan-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 !important;
    padding: 18px 16px 24px !important;
  }

  body.dan-premium-shell .modal-overlay {
    inset: var(--dan-header-h) 0 0 0 !important;
    padding: 20px 16px !important;
  }

  body.dan-premium-shell .modal.dan-modal-visible {
    inset: var(--dan-header-h) 0 0 0 !important;
    padding: 20px 16px !important;
  }

  body.dan-premium-shell .modal,
  body.dan-premium-shell .modal-box,
  body.dan-premium-shell .modal-content,
  body.dan-premium-shell .modal.modal-lg,
  body.dan-premium-shell .modal-box.modal-lg,
  body.dan-premium-shell .modal-content.modal-lg,
  body.dan-premium-shell .modal.dan-modal-visible > .modal-content,
  body.dan-premium-shell .modal.dan-modal-visible > form,
  body.dan-premium-shell .modal.dan-modal-visible > div {
    max-width: min(100%, calc(100vw - 32px)) !important;
  }
}

@media (max-width: 720px) {
  body.dan-premium-shell {
    --dan-header-h: 72px;
  }

  body.dan-premium-shell .app-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    height: var(--dan-header-h);
    min-height: 0;
    padding: 0 14px;
    flex-wrap: nowrap;
    gap: 10px;
  }

  body.dan-premium-shell .app-header-left,
  body.dan-premium-shell .app-header-right {
    min-width: 0;
  }

  body.dan-premium-shell .app-header-left h1 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.dan-premium-shell .btn-signaler-probleme,
  body.dan-premium-shell .dan-header-icon span {
    display: none !important;
  }

  body.dan-premium-shell .btn-accueil,
  body.dan-premium-shell .dan-header-icon,
  body.dan-premium-shell .tenant-sel,
  body.dan-premium-shell .btn-signaler-probleme {
    min-width: 42px;
    padding: 0 12px;
  }

  body.dan-premium-shell .main,
  body.dan-premium-shell .content,
  body.dan-premium-shell .main-content,
  body.dan-premium-shell .page-body,
  body.dan-premium-shell .container {
    top: var(--dan-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px !important;
  }

  .main,
  .container,
  .content,
  .main-content,
  .page-body,
  .tab-panel.active,
  .tab-content.active {
    padding: 1rem;
  }

  body.dan-premium-shell > .module-container,
  body.dan-premium-shell > .tab-content {
    width: auto !important;
    top: var(--dan-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 !important;
    padding: 14px !important;
  }

  body.dan-premium-shell .modal-overlay {
    inset: var(--dan-header-h) 0 0 0 !important;
    padding: 14px !important;
  }

  body.dan-premium-shell .tabs-bar {
    top: var(--dan-header-h);
    left: 0;
    bottom: 0;
    width: min(304px, calc(100vw - 28px));
    border-radius: 0 20px 20px 0;
  }

  body.dan-premium-shell .app-header-right,
  body.dan-premium-shell .dan-header-tools {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }


/* ===== FULL PAGE FORMS ===== */
.dan-form-page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
}

.dan-form-page--wide {
  width: 100%;
}

.dan-form-page__header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--white);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.dan-form-page__body {
  min-height: 0;
}

.dan-form-page__footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, #fff 28%);
  border-top: 1px solid var(--border);
}

body .modal-overlay.open,
body .modal-overlay.active,
body .modal.show,
body .modal.active,
body .modal.dan-modal-visible,
body #modalContainer:not(.hidden),
body .invoice-modal.open {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(15, 23, 42, 0.5) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 1400 !important;
}

body .modal-overlay.open > .modal-content,
body .modal-overlay.open > .modal-box,
body .modal-overlay.open > .modal,
body .modal-overlay.active > .modal-content,
body .modal-overlay.active > .modal-box,
body .modal-overlay.active > .modal,
body .modal.show > .modal-content,
body .modal.show > .modal-box,
body .modal.show > form,
body .modal.show > div,
body .modal.active > .modal-content,
body .modal.active > .modal-box,
body .modal.active > form,
body .modal.active > div,
body .modal.dan-modal-visible > .modal-content,
body .modal.dan-modal-visible > .modal-box,
body .modal.dan-modal-visible > form,
body .modal.dan-modal-visible > div,
body #modalContainer:not(.hidden) > .modal-content,
body .invoice-modal.open > .invoice-modal-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 24px !important;
  border: none !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  align-self: stretch !important;
}

body.dan-premium-shell .modal.modal-fullscreen.active,
body.dan-premium-shell .modal.modal-fullscreen.dan-modal-visible,
body.dan-premium-shell #modalContainer:not(.hidden),
body.dan-premium-shell .invoice-modal.open {
  inset: 0 !important;
  padding: 0 !important;
}

body.dan-premium-shell .modal.modal-fullscreen.active > .modal-content,
body.dan-premium-shell .modal.modal-fullscreen.dan-modal-visible > .modal-content,
body.dan-premium-shell #modalContainer:not(.hidden) > .modal-content,
body.dan-premium-shell .invoice-modal.open > .invoice-modal-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 24px !important;
  border-radius: 0 !important;
}

body .modal-overlay.open .modal-header,
body .modal-overlay.open .invoice-modal-head,
body .modal.show .modal-header,
body .modal.active .modal-header,
body .modal.dan-modal-visible .modal-header,
body #modalContainer:not(.hidden) .modal-header,
body #modalContainer:not(.hidden) .invoice-modal-head,
body .invoice-modal.open .invoice-modal-head,
body .invoice-modal.open .ac-modal-toolbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 4 !important;
  background: #fff !important;
  padding-top: 0 !important;
  padding-bottom: 12px !important;
  margin-bottom: 18px !important;
  border-bottom: 1px solid var(--border) !important;
}

body .modal-overlay.open form > .button-group:last-child,
body .modal-overlay.open form > .modal-footer:last-child,
body .modal.show form > .button-group:last-child,
body .modal.show form > .modal-footer:last-child,
body .modal.active form > .button-group:last-child,
body .modal.active form > .modal-footer:last-child,
body .modal.dan-modal-visible form > .button-group:last-child,
body .modal.dan-modal-visible form > .modal-footer:last-child,
body #modalContainer:not(.hidden) form > .button-group:last-child,
body #modalContainer:not(.hidden) form > .modal-footer:last-child,
body .invoice-modal.open .invoice-form-footer {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 4 !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  margin-top: 20px !important;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom)) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, #fff 28%) !important;
  border-top: 1px solid var(--border) !important;
}

@media (max-width: 768px) {
  body .modal-overlay.open > .modal-content,
  body .modal-overlay.open > .modal-box,
  body .modal-overlay.open > .modal,
  body .modal-overlay.active > .modal-content,
  body .modal-overlay.active > .modal-box,
  body .modal-overlay.active > .modal,
  body .modal.show > .modal-content,
  body .modal.show > .modal-box,
  body .modal.show > form,
  body .modal.show > div,
  body .modal.active > .modal-content,
  body .modal.active > .modal-box,
  body .modal.active > form,
  body .modal.active > div,
  body .modal.dan-modal-visible > .modal-content,
  body .modal.dan-modal-visible > .modal-box,
  body .modal.dan-modal-visible > form,
  body .modal.dan-modal-visible > div,
  body #modalContainer:not(.hidden) > .modal-content,
  body .invoice-modal.open > .invoice-modal-panel {
    padding: 16px !important;
  }

  body .modal-overlay.open form > .button-group:last-child > *,
  body .modal-overlay.open form > .modal-footer:last-child > *,
  body .modal.show form > .button-group:last-child > *,
  body .modal.show form > .modal-footer:last-child > *,
  body .modal.active form > .button-group:last-child > *,
  body .modal.active form > .modal-footer:last-child > *,
  body .modal.dan-modal-visible form > .button-group:last-child > *,
  body .modal.dan-modal-visible form > .modal-footer:last-child > *,
  body #modalContainer:not(.hidden) form > .button-group:last-child > *,
  body #modalContainer:not(.hidden) form > .modal-footer:last-child > *,
  body .invoice-modal.open .invoice-form-footer > * {
    flex: 1 1 100%;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  .print-area,
  .print-area *,
  .modal-overlay.open > .modal-content,
  .modal-overlay.open > .modal-content *,
  .modal-overlay.open > .modal-box,
  .modal-overlay.open > .modal-box *,
  .modal-overlay.open > .modal,
  .modal-overlay.open > .modal *,
  .modal.show > .modal-content,
  .modal.show > .modal-content *,
  .modal.show > .modal-box,
  .modal.show > .modal-box *,
  .modal.active > .modal-content,
  .modal.active > .modal-content *,
  .modal.dan-modal-visible > .modal-content,
  .modal.dan-modal-visible > .modal-content *,
  #modalContainer:not(.hidden) > .modal-content,
  #modalContainer:not(.hidden) > .modal-content *,
  .invoice-modal.open > .invoice-modal-panel,
  .invoice-modal.open > .invoice-modal-panel * {
    visibility: visible !important;
  }

  .print-area,
  .modal-overlay.open > .modal-content,
  .modal-overlay.open > .modal-box,
  .modal-overlay.open > .modal,
  .modal.show > .modal-content,
  .modal.show > .modal-box,
  .modal.active > .modal-content,
  .modal.dan-modal-visible > .modal-content,
  #modalContainer:not(.hidden) > .modal-content,
  .invoice-modal.open > .invoice-modal-panel {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .app-header,
  .tabs-bar,
  .btn-accueil,
  .dan-sidebar-backdrop,
  .dan-shell-toggle,
  .modal-close,
  .close,
  .modal-footer,
  .button-group,
  .invoice-form-footer,
  .invoice-modal-head .actions,
  .ac-toolbar-btns {
    display: none !important;
  }
}
  body.dan-premium-shell .dan-profile-chip {
    min-width: 0;
    flex: 1 1 220px;
  }

  body.dan-premium-shell .btn-accueil,
  body.dan-premium-shell .btn-signaler-probleme,
  body.dan-premium-shell .dan-header-icon {
    flex: 1 1 calc(50% - 8px);
  }

  body.dan-premium-shell .dan-toast-stack {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
  }

  body.dan-premium-shell .kpi-grid,
  body.dan-premium-shell .grid-2,
  body.dan-premium-shell .grid-3,
  body.dan-premium-shell .grid-4,
  body.dan-premium-shell .grid-auto {
    grid-template-columns: 1fr !important;
  }
}