/* DFM-IT — Style global */

/* Améliorations tableau de bord & app */
.dfmit-app .card-dfmit {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.dfmit-app a[href]:not(.btn) {
  transition: color 0.15s ease;
}
.nav-dfmit {
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-link-dfmit {
  white-space: nowrap;
}

:root {
  --primary: #0d47a1;
  --primary-dark: #002171;
  --primary-light: #5472d3;
  --accent: #ff6f00;
  --bg: #f5f7fa;
  --card: #fff;
  --text: #1a237e;
  --text-muted: #5c6bc0;
  --border: #c5cae9;
  --success: #2e7d32;
  --warning: #ed6c02;
  --error: #c62828;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(13, 71, 161, 0.08);
  --shadow-hover: 0 4px 16px rgba(13, 71, 161, 0.12);
}

* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Nav */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}
.navbar a {
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.95rem;
}
.navbar a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.navbar .nav-right { margin-left: auto; }
.navbar .nav-right a { opacity: 0.9; }

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 60vh;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card h2, .card h3 { margin-top: 0; color: var(--primary); font-size: 1.15rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.card-stat {
  text-align: center;
  padding: 1rem;
  border-left: 4px solid var(--primary);
}
.card-stat .number { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.card-stat .label { font-size: 0.85rem; color: var(--text-muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
tr:hover { background: rgba(13, 71, 161, 0.04); }
table .actions { white-space: nowrap; }
table .actions a { margin-right: 0.5rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff !important;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--text-muted); }
.btn-secondary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); }
.btn-warning { background: var(--warning); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; font-size: 1.5rem; color: var(--primary-dark); }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.messages li {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.messages .success { background: #e8f5e9; color: var(--success); border-left: 4px solid var(--success); }
.messages .info { background: #e3f2fd; color: #1565c0; border-left: 4px solid #1565c0; }
.messages .warning { background: #fff3e0; color: var(--warning); border-left: 4px solid var(--warning); }
.messages .error { background: #ffebee; color: var(--error); border-left: 4px solid var(--error); }

/* Forms */
form p { margin: 0.75rem 0; }
form label { display: block; font-weight: 500; margin-bottom: 0.25rem; color: var(--text); }
form input[type="text"], form input[type="email"], form input[type="password"],
form input[type="number"], form input[type="date"], form input[type="file"],
form textarea, form select {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}
form textarea { min-height: 100px; resize: vertical; }
form .helptext { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-actions { margin-top: 1.25rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Filters / toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar label { margin-right: 0.35rem; font-size: 0.9rem; }
.toolbar select { max-width: 140px; padding: 0.4rem; }

/* Pagination */
.pagination { margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }

/* Suggestions / alerts */
.suggestion { padding: 1rem; border-radius: var(--radius); margin-bottom: 0.75rem; border-left: 4px solid; }
.suggestion.success { background: #e8f5e9; border-color: var(--success); }
.suggestion.warning { background: #fff3e0; border-color: var(--warning); }
.suggestion.info { background: #e3f2fd; border-color: #1565c0; }
.suggestion .titre { font-weight: 600; margin-bottom: 0.25rem; }

/* ========== Dashboard super admin — styles harmonisés ========== */
.dash-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.dash-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dash-card-header h2, .dash-card-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
}
.dash-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #2563eb;
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 0.2s;
}
.dash-btn-primary:hover { background: #1d4ed8; }
.dash-btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 0.2s;
}
.dash-btn-secondary:hover { background: #e2e8f0; color: #334155; }
.dash-table { width: 100%; font-size: 0.875rem; border-collapse: collapse; }
.dash-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}
.dash-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.dash-table tbody tr:hover { background: #f8fafc; }
.dash-link { color: #2563eb; text-decoration: none; }
.dash-link:hover { text-decoration: underline; }
.dash-table .dash-link { color: #2563eb; text-decoration: none; }
.dash-table .dash-link:hover { text-decoration: underline; }
.dash-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  margin-bottom: 0;
}
.dash-filter-form select,
.dash-filter-form input[type="text"],
.dash-filter-form input[type="search"],
.dash-filter-form input[type="date"] {
  padding: 0.5rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.875rem;
  background: #fff;
  color: #334155;
}
.dash-filter-form button[type="submit"] {
  padding: 0.5rem 1rem;
  background: #334155;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
}
.dash-filter-form button[type="submit"]:hover { background: #1e293b; }
.dash-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
}
.dash-page-subtitle { font-size: 0.875rem; color: #64748b; margin: 0; }
.dash-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.8rem;
  color: #64748b;
}
.dash-pagination a {
  padding: 0.35rem 0.75rem;
  background: #f1f5f9;
  color: #475569;
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 0.8rem;
}
.dash-pagination a:hover { background: #e2e8f0; }
