/* ==========================================================================
   PHOENIX GESTION - FEUILLE DE STYLE COMPLÉMENTAIRE
   Palette & Design System
   ========================================================================== */

:root {
  --phx-dark: #132b42;
  --phx-sidebar-hover: #1c3a5c;
  --phx-primary: #b89b67;
  --phx-success: #00d97e;
  --phx-warning: #f6c343;
  --phx-danger: #e63757;
  --phx-info: #39afd1;
  --phx-bg: #f9fbfd;
  --phx-card-border: #edf2f9;
  --phx-text: #12263f;
  --phx-muted: #95aac9;
}

/* Header & Synchronisation Pennylane */
.pennylane-badge {
  background: #f3ecdf;
  color: #96814f;
  border: 1px solid #e3d3b8;
  border-radius: 24px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pennylane-badge:hover {
  background: #ead9b8;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(184, 155, 103, 0.25);
}

.sync-spin {
  animation: phx-spin 1s linear infinite;
}

@keyframes phx-spin {
  100% { transform: rotate(360deg); }
}

/* Sidebar Custom Enhancements */
.sidebar .nav-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6e84a3;
  padding: 18px 24px 6px;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: #b1c2de;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-left-color: #b89b67;
}

.sidebar .nav-link i,
.sidebar .nav-link img {
  width: 18px;
  text-align: center;
}

/* Donut Progress Cards (Déclarations fiscales) */
.donut-stat-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
}

.donut-chart {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}

.donut-chart::after {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #ffffff;
}

.donut-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.donut-content .donut-num {
  font-size: 22px;
  font-weight: 800;
  color: #12263f;
  line-height: 1;
}

.donut-content .donut-sub {
  font-size: 11px;
  color: #95aac9;
  font-weight: 600;
}

.donut-chart.tva {
  background: conic-gradient(#00d97e 0% 58%, #f6c343 58% 95%, #e63757 95% 100%);
}

.donut-chart.is {
  background: conic-gradient(#00d97e 0% 83%, #b89b67 83% 100%);
}

.donut-chart.liasse {
  background: conic-gradient(#00d97e 0% 70%, #f6c343 70% 100%);
}

/* Quick Tools Cards Grid */
.tool-tile {
  background: #ffffff;
  border: 1px solid #edf2f9;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: #12263f;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-tile:hover {
  transform: translateY(-2px);
  border-color: #b89b67;
  box-shadow: 0 8px 16px rgba(184, 155, 103, 0.08);
  color: #b89b67;
}

.tool-tile i {
  font-size: 22px;
  color: #b89b67;
}

.tool-tile span {
  font-size: 13px;
  font-weight: 600;
}

/* Silae Invoices Card */
.silae-cta-card {
  background: #ffffff;
  border: 1px solid #edf2f9;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 2px 6px rgba(18, 38, 63, 0.03);
}

.silae-badge-logo {
  background: #feeff0;
  color: #e63757;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

/* Dettes URSSAF / Impots Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status.a_jour {
  background: #e6f9f0;
  color: #00874e;
  border: 1px solid #a3e9c7;
}

.badge-status.dette {
  background: #fdebed;
  color: #d62444;
  border: 1px solid #f9bcc5;
}

.badge-status.en_cours {
  background: #fef8e7;
  color: #b58306;
  border: 1px solid #fae6a6;
}

/* Plaud Audio Meeting Cards */
.plaud-card {
  background: #ffffff;
  border: 1px solid #edf2f9;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.plaud-card:hover {
  border-color: #b89b67;
  box-shadow: 0 4px 12px rgba(18, 38, 63, 0.05);
}

.plaud-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: #fff4d9;
  color: #b27a00;
}

/* Simulateurs Styles */
.simulator-pane {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #edf2f9;
  padding: 24px;
  box-shadow: 0 4px 14px rgba(18, 38, 63, 0.04);
}

.sim-result-box {
  background: linear-gradient(135deg, #132b42 0%, #0d1f33 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.sim-result-value {
  font-size: 32px;
  font-weight: 800;
  color: #00d97e;
  letter-spacing: -0.5px;
}

/* Nav Pills Simulateurs */
.nav-pills .nav-link {
  color: #495057 !important;
  background-color: #ffffff;
  border: 1px solid #edf2f9;
  transition: all 0.2s ease;
}

.nav-pills .nav-link:hover {
  background-color: #f1f5fa;
  color: #b89b67 !important;
}

.nav-pills .nav-link.active {
  background-color: #b89b67 !important;
  color: #ffffff !important;
  border-color: #b89b67;
  box-shadow: 0 4px 10px rgba(184, 155, 103, 0.25);
}

/* ==========================================================================
   RESPONSIVE — points de rupture alignés sur Bootstrap 5 (lg = 992px)
   < 992px : sidebar en tiroir (off-canvas) + topbar compactée
   >= 992px : comportement desktop inchangé
   ========================================================================== */

.sidebar-toggle-btn {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 49, 0.5);
  z-index: 1040;
}

.sidebar-backdrop.show {
  display: block;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1045;
    box-shadow: 8px 0 24px rgba(11, 20, 49, 0.25);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-toggle-btn {
    display: inline-flex;
  }

  .search-bar-wrapper {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
  }

  .topbar {
    padding: 0 16px;
    gap: 12px;
  }

  .content-body {
    padding: 16px;
  }
}

@media (max-width: 575.98px) {
  .phx-modal {
    width: 94%;
  }

  .phx-modal .p-4 {
    padding: 1rem !important;
  }
}

/* Modal Custom styling */
.phx-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 20, 49, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phx-modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(11, 20, 49, 0.2);
  width: 90%;
  max-width: 580px;
  overflow: hidden;
  animation: phx-modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes phx-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* La recherche doit pouvoir se réduire dans la barre mobile. */
.main-content{min-width:0}.topbar{gap:12px}.topbar .search-bar-wrapper{flex:1 1 240px;min-width:0;width:auto;max-width:450px}.topbar>.d-flex{flex-shrink:0}
@media(max-width:767px){.topbar{padding:10px 12px!important;height:auto!important;min-height:64px;flex-wrap:wrap}.topbar .search-bar-wrapper{order:3;flex-basis:100%;max-width:none}.topbar>.d-flex{gap:8px!important;margin-left:auto}.topbar #topbar-user-name{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#view-container{padding:16px!important}.crm-workspace{min-width:0}}

/* Contraste des contrôles sur les surfaces blanches du cabinet. */
.btn-outline-secondary{color:#435267!important;border-color:#acb8c5!important;background:transparent}.btn-outline-secondary:hover,.btn-outline-secondary:focus-visible{color:#fff!important;background:#435267!important}.btn-primary{color:#132b42!important}.table thead th{color:#fff}.crm-workspace .crm-table th{color:#fff}.topbar #topbar-user-name{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:767px){.topbar #topbar-user-name{max-width:110px}}
