/* ===== AZZUR CRM - Feuille de style principale ===== */

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

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  background: #ecf0f1;
  color: #2c3e50;
  min-height: 100vh;
}

a { color: #1a6496; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LOGIN ===== */
#login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a2a4a 0%, #2c3e50 60%, #1a6496 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: #fff;
  border-radius: 8px;
  padding: 36px 40px 28px;
  width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  text-align: center;
}

.login-box h1 {
  font-size: 32px;
  font-weight: bold;
  color: #1a2a4a;
  letter-spacing: 4px;
  margin-bottom: 2px;
}

.login-box h2 {
  font-size: 14px;
  color: #1a6496;
  font-weight: normal;
  letter-spacing: 2px;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.login-box .form-group {
  text-align: left;
  margin-bottom: 12px;
}

.login-box .form-group label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  color: #555;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.login-box input:focus { border-color: #1a6496; }

.login-btn {
  width: 100%;
  padding: 10px;
  background: #1a2a4a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 6px;
  letter-spacing: 1px;
  transition: background 0.2s;
}
.login-btn:hover { background: #1a6496; }

.login-footer {
  margin-top: 20px;
  font-size: 11px;
  color: #aaa;
  border-top: 1px solid #eee;
  padding-top: 14px;
}

/* ===== TOP BAR ===== */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 36px;
  background: #1a2a4a;
  display: flex;
  align-items: center;
  z-index: 1000;
  padding: 0 8px;
  gap: 2px;
}

.home-btn {
  color: #fff;
  font-size: 20px;
  padding: 0 10px;
  line-height: 36px;
  display: inline-block;
  text-decoration: none;
}
.home-btn:hover { background: rgba(255,255,255,0.1); }

.nav-item {
  color: #dce6f0;
  font-size: 12px;
  padding: 0 12px;
  line-height: 36px;
  display: inline-block;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

.nav-dropdown { position: relative; display: inline-block; }

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 36px; left: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: 2px solid #1a6496;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 2000;
}

.nav-dropdown:hover .nav-dropdown-content { display: block; }

.nav-dropdown-content a {
  display: block;
  padding: 7px 14px;
  font-size: 12px;
  color: #2c3e50;
  border-bottom: 1px solid #f0f0f0;
}
.nav-dropdown-content a:hover {
  background: #e8f4fd;
  color: #1a6496;
  text-decoration: none;
}

#topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  background: #34495e;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.badge:hover { opacity: 0.85; }
.badge-orange { background: #e67e22; }
.badge-blue { background: #2980b9; }
.badge-green { background: #27ae60; }

.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #1a6496;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ===== MAIN CONTENT ===== */
#main {
  margin-top: 36px;
  padding: 14px 16px;
  min-height: calc(100vh - 36px - 28px);
}

#footer {
  background: #1a2a4a;
  color: #7f8c8d;
  font-size: 11px;
  text-align: center;
  padding: 6px 0;
}
#footer a { color: #7f8c8d; }

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== CARDS ===== */
.card {
  background: #fff;
  border: 1px solid #dce3ea;
  border-radius: 4px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-header {
  background: #2c3e50;
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 4px 4px 0 0;
}

.card-body { padding: 12px 14px; }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

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

/* ===== TABLES ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead tr {
  background: #34495e;
  color: #fff;
}

.data-table th {
  padding: 7px 10px;
  text-align: left;
  font-weight: bold;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table th:hover { background: #2c3e50; }

.data-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #ecf0f1;
  vertical-align: middle;
}

.data-table tbody tr:hover { background: #f0f7ff; }
.data-table tbody tr:nth-child(even) { background: #f9fbfc; }
.data-table tbody tr:nth-child(even):hover { background: #e8f4fd; }

.admin-table-wrapper { overflow-x: auto; }

/* ===== ETAT BADGES ===== */
.etat-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  background: #95a5a6;
  color: #fff;
}
.etat-01 { background: #3498db; }
.etat-02 { background: #e74c3c; }
.etat-03 { background: #e67e22; }
.etat-04 { background: #f39c12; color: #fff; }
.etat-05 { background: #95a5a6; }
.etat-06 { background: #c0392b; }
.etat-07 { background: #8e44ad; }
.etat-08 { background: #27ae60; }
.etat-09 { background: #7f8c8d; }
.etat-10 { background: #bdc3c7; color: #555; }

/* ===== FORMS ===== */
.form-group {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.form-group label {
  min-width: 140px;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  text-align: right;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 12px;
  font-family: Arial, sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #1a6496; }

.form-section-title {
  font-size: 12px;
  font-weight: bold;
  color: #1a6496;
  border-bottom: 1px solid #dce3ea;
  padding-bottom: 4px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: opacity 0.15s;
  line-height: 1.4;
}
.btn:hover { opacity: 0.85; text-decoration: none; }

.btn-sm { padding: 3px 8px; font-size: 11px; }
.btn-primary { background: #1a6496; color: #fff; border-color: #1a6496; }
.btn-success { background: #27ae60; color: #fff; border-color: #27ae60; }
.btn-warning { background: #f39c12; color: #fff; border-color: #f39c12; }
.btn-danger { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.btn-default { background: #ecf0f1; color: #2c3e50; border-color: #bdc3c7; }
.w100 { width: 100%; text-align: center; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid #1a6496;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 2px;
}

.tab {
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  background: #ecf0f1;
  border: 1px solid #dce3ea;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  color: #555;
  user-select: none;
  transition: background 0.15s;
}
.tab:hover { background: #d5e8f5; color: #1a6496; }
.tab.active { background: #1a6496; color: #fff; border-color: #1a6496; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== FICHE HEADER ===== */
.fiche-header {
  background: #2c3e50;
  color: #fff;
  padding: 10px 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fiche-header h2 { font-size: 15px; margin-right: 10px; flex: 1; }

.fiche-action-btn {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 3px;
  font-size: 11px;
  text-decoration: none;
  transition: background 0.15s;
}
.fiche-action-btn:hover { background: rgba(255,255,255,0.3); text-decoration: none; }

/* ===== INFO GRID (fiche détails) ===== */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}

.info-row {
  display: flex;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
}

.info-label {
  min-width: 160px;
  font-weight: bold;
  color: #555;
  font-size: 11px;
}

.info-value { color: #2c3e50; }

/* ===== FICHE SIDEBAR ===== */
.fiche-sidebar {
  background: #f9fbfc;
  border: 1px solid #dce3ea;
  border-radius: 4px;
  padding: 12px;
  font-size: 12px;
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid #ecf0f1;
  font-size: 11px;
}

.sidebar-label { color: #888; }
.sidebar-value { font-weight: bold; color: #2c3e50; text-align: right; }

/* ===== SUIVI ===== */
.suivi-entry {
  border: 1px solid #dce3ea;
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

.suivi-entry-header {
  background: #f5f7fa;
  padding: 5px 10px;
  font-size: 11px;
  display: flex;
  gap: 16px;
  color: #555;
  border-bottom: 1px solid #dce3ea;
}

.suivi-entry-body {
  padding: 7px 10px;
  font-size: 12px;
}

/* ===== ALERTES ===== */
.alerte-row.traitee td { opacity: 0.6; }

/* ===== AGENDA ===== */
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.agenda-day {
  min-height: 80px;
  border: 1px solid #dce3ea;
  border-radius: 3px;
  padding: 4px;
  background: #fff;
  font-size: 11px;
}

.agenda-day-header {
  font-weight: bold;
  font-size: 13px;
  color: #2c3e50;
  margin-bottom: 4px;
}

.agenda-event {
  background: #1a6496;
  color: #fff;
  border-radius: 2px;
  padding: 2px 4px;
  font-size: 10px;
  margin-top: 2px;
}

/* ===== STATISTIQUES ===== */
.stat-box {
  background: #fff;
  border: 1px solid #dce3ea;
  border-radius: 4px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-number { font-size: 28px; font-weight: bold; color: #2c3e50; }
.stat-label { font-size: 11px; color: #888; margin-top: 4px; }

/* ===== DISPATCH BOARD ===== */
.dispatch-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: #fff;
  border: 1px solid #dce3ea;
  border-radius: 4px;
  padding: 14px;
  text-align: center;
}

.kpi-number { font-size: 32px; font-weight: bold; color: #2c3e50; }
.kpi-label { font-size: 11px; color: #888; margin-top: 4px; }

/* ===== CAMPAGNE D'APPELS ===== */
.campagne-fiche-card {
  background: #f0f7ff;
  border: 2px solid #1a6496;
  border-radius: 6px;
  padding: 14px;
  max-width: 500px;
}

.campagne-fiche-card h3 { font-size: 15px; margin-bottom: 10px; color: #1a2a4a; }

/* ===== GED ===== */
.ged-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #ecf0f1;
  font-size: 12px;
}
.ged-file-item:hover { background: #f5f7fa; }
.ged-file-icon { font-size: 16px; }

/* ===== MESSAGERIE ===== */
.message-item {
  padding: 8px 10px;
  border-bottom: 1px solid #ecf0f1;
  cursor: pointer;
  font-size: 12px;
}
.message-item:hover { background: #f0f7ff; }
.message-item.unread { background: #fffde7; font-weight: bold; border-left: 3px solid #f39c12; }

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 6px;
  padding: 20px 24px;
  min-width: 360px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.modal-close {
  cursor: pointer;
  font-size: 16px;
  color: #888;
  padding: 2px 6px;
  border-radius: 3px;
}
.modal-close:hover { background: #ecf0f1; color: #e74c3c; }

/* ===== UTILITIES ===== */
.text-muted { color: #888; }
.mt-8 { margin-top: 8px; }

code {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: monospace;
}
