/* ALLO AVOCAT : tableaux de bord (admin et avocat).
   Ordinateur : cadre noir arrondi, barre latérale d'icônes, panneau blanc, tuiles pastel.
   Téléphone : le contenu seul, en-tête d'application et onglets en bas comme ailleurs.
   Pas d'ombre portée ni de dégradé (charte du site). */
:root {
  --dash-bg: #e8eff9; /* fond bleu très clair autour du cadre */
  --dash-soft: #f3f5f8; /* pilules et lignes discrètes */
  --pastel-blue: #dce9f8;
  --pastel-lavender: #e6dff5;
  --pastel-mint: #dcefe0;
  --pastel-cream: #f6eed3;
  --note-lavender: #6a54a6;
  --note-mint: #2e8a57;
  --note-cream: #8a6a12;
  --note-blue: #2f5f94;
  --sky-button: #cfe3fb;
}

/* ---------- Cadre (ordinateur) ---------- */
.dash-frame {
  display: block;
}
.dash-side,
.dash-head {
  display: none;
}
.dash-main {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0.5rem 1rem 1.5rem;
}

@media (min-width: 900px) {
  body.dash-body {
    background: var(--dash-bg);
  }
  .dash-body .topbar {
    display: none;
  }
  .dash-frame {
    display: flex;
    width: calc(100% - 3rem);
    max-width: 1280px;
    min-height: calc(100vh - 7rem);
    margin: 2rem auto 0;
    padding: 14px;
    padding-inline-start: 0;
    border-radius: 36px;
    background: var(--black);
  }
  .dash-main {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 2rem 2.25rem 2.5rem;
    border-radius: 28px;
    background: var(--page);
  }
  .dash-body .footer {
    background: transparent;
  }
}

/* Barre latérale : logo, icônes, déconnexion en bas */
@media (min-width: 900px) {
  .dash-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 88px;
    flex-shrink: 0;
    padding: 6px 0 10px;
  }
}
.side-logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-block-end: 2.5rem;
  border-radius: 16px;
  background: var(--gold-soft);
  color: var(--black);
}
.side-logo svg,
.side-nav svg,
.side-out svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-nav {
  display: grid;
  gap: 0.6rem;
  width: 100%;
}
.side-nav a,
.side-out {
  position: relative;
  display: grid;
  place-items: center;
  height: 48px;
  color: #8c8c8c;
  border: none;
  background: none;
  cursor: pointer;
}
.side-nav a:hover,
.side-out:hover {
  color: var(--page);
}
.side-nav a.is-active {
  color: var(--page);
}
/* Repère blanc sur le bord de l'onglet actif */
.side-nav a.is-active::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--page);
}
:root[dir='rtl'] .side-nav a.is-active::before {
  border-radius: 3px 0 0 3px;
}
.side-out {
  width: 100%;
  margin-block-start: auto;
}

/* ---------- En-tête du panneau : titre, langue, personne connectée ---------- */
@media (min-width: 900px) {
  .dash-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-block-end: 1.75rem;
  }
}
.dash-head .page-title {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.dash-head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.dash-head .top-pill {
  border-color: transparent;
  background: var(--dash-soft);
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 4px 1rem 4px 4px;
  padding-inline: 4px 1rem;
  border-radius: var(--pill);
  background: var(--dash-soft);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--black);
  color: var(--gold);
  font-family: var(--font-title);
  font-weight: 600;
}
.user-chip-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Grille du tableau de bord ---------- */
.dash-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 2rem 1.75rem;
    align-items: start;
  }
  .dash-wide {
    grid-column: 1 / -1;
  }
}
.dash-block {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}
.dash-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 36px;
}
.dash-block-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dash-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0 0.9rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--pill);
  background: var(--page);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.dash-pill:hover {
  background: var(--dash-soft);
}

/* Grande carte bleu pâle (comme « Portfolio ») */
.dash-hero {
  display: grid;
  gap: 1rem;
  padding: 1.4rem 1.5rem 1.5rem;
  border-radius: 22px;
  background: var(--pastel-blue);
}
.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-value {
  display: block;
  font-family: var(--font-title);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hero-label {
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--pill);
  background: var(--black);
  color: var(--page);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.hero-badge .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6fd08f;
}
/* Barre de répartition des statuts */
.status-bar {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.7);
}
.status-bar span {
  height: 100%;
}
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.status-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.status-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.status-legend b {
  color: var(--ink);
  font-weight: 600;
}
.seg-approved {
  background: var(--black);
}
.seg-pending {
  background: var(--gold);
}
.seg-other {
  background: #9aa6b4;
}

/* Tuiles pastel (comme « Your Assets ») */
.tile-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
@media (min-width: 600px) {
  .tile-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 150px;
  padding: 1.1rem 1.1rem 1rem;
  border-radius: 22px;
  color: var(--ink);
  text-decoration: none;
}
.tile-value {
  font-family: var(--font-title);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.tile-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-block-start: auto;
  padding-block-start: 0.8rem;
}
.tile-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--page);
}
.tile-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--black);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tile-note {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: end;
}
.tile.is-lavender {
  background: var(--pastel-lavender);
}
.tile.is-lavender .tile-note {
  color: var(--note-lavender);
}
.tile.is-mint {
  background: var(--pastel-mint);
}
.tile.is-mint .tile-note {
  color: var(--note-mint);
}
.tile.is-cream {
  background: var(--pastel-cream);
}
.tile.is-cream .tile-note {
  color: var(--note-cream);
}
.tile.is-blue {
  background: var(--pastel-blue);
}
.tile.is-blue .tile-note {
  color: var(--note-blue);
}

/* Tableau (comme « Market ») */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.dash-table th {
  padding: 0 0.5rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-align: start;
}
.dash-table td {
  padding: 0.6rem 0.5rem;
  vertical-align: middle;
}
.dash-table .num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.dash-table th.num {
  font-weight: 500;
}
.dash-table .up {
  color: var(--note-mint);
}
.cell-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.cell-name strong {
  display: block;
  font-weight: 600;
}
.cell-name small {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.row-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--black);
  color: var(--page);
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Carte noire mise en avant (comme « Earn free crypto ») avec une carte grise en dessous */
.dash-promo-wrap {
  position: relative;
  z-index: 0;
  padding-block-end: 12px;
}
.dash-promo-wrap::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset-inline: 16px;
  bottom: 0;
  height: 40px;
  border-radius: 0 0 22px 22px;
  background: #e4e6ea;
}
.dash-promo {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0.9rem;
  justify-items: start;
  padding: 1.8rem 1.6rem 1.9rem;
  border-radius: 24px;
  background: var(--black);
  color: var(--page);
}
.dash-promo h3 {
  margin: 0;
  max-width: 17em;
  color: var(--page);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.dash-promo p {
  position: relative;
  margin: 0;
  max-width: 24em;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
}
.promo-pill {
  display: inline-block;
  padding: 0 0.65rem;
  border: 1.5px solid var(--page);
  border-radius: var(--pill);
  font-style: italic;
  line-height: 1.4;
}
.btn-sky {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 1.4rem;
  border: none;
  border-radius: var(--pill);
  background: var(--sky-button);
  color: var(--black);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-sky:hover {
  background: #b9d6f8;
}
/* Cartes dessinées au trait, en bas à droite */
.promo-art {
  position: absolute;
  inset-inline-end: 0;
  bottom: -26px;
  width: 150px;
  height: 120px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1.5;
  pointer-events: none;
}
:root[dir='rtl'] .promo-art {
  transform: scaleX(-1);
}

/* Liens rapides sous la carte noire */
.dash-links {
  display: grid;
  gap: 0.6rem;
}
.dash-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: var(--dash-soft);
  color: var(--ink);
  text-decoration: none;
}
.dash-link:hover {
  background: #e9ecf1;
}
.dash-link > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
}
.dash-link .tile-icon {
  width: 38px;
  height: 38px;
}
.dash-link strong {
  font-family: var(--font-title);
  font-size: 1.2rem;
}

/* ---------- Ajustements des blocs existants dans ce style ---------- */
.dash-main .empty-line {
  border: none;
  background: var(--dash-soft);
}
.dash-main .history-list {
  padding: 0;
  border: none;
  background: none;
}
.dash-main .history-list li {
  justify-content: flex-start;
  padding-block: 0.65rem;
  border-block-end-color: var(--line-soft);
}
.dash-main .history-list .request-main {
  flex: 1;
  min-width: 0;
  display: grid;
}
.dash-main .history-list small {
  color: var(--ink-muted);
}
/* Disponibilité de l'avocat : bleu pâle hors ligne, noire en ligne */
.dash-main #availability.card {
  margin: 0;
  border: none;
  border-radius: 22px;
}
.dash-main #availability.card:not(.card-dark) {
  background: var(--pastel-blue);
}
.dash-main #availability.card-dark {
  background: var(--black);
}
.dash-main #ongoing {
  display: grid;
  gap: 0.75rem;
}

/* Placement des blocs sur ordinateur (sur téléphone : l'ordre du HTML, le plus utile d'abord) */
@media (min-width: 900px) {
  .dash-grid-admin {
    grid-template-areas:
      'hero tiles'
      'table aside';
  }
  .dash-grid-lawyer {
    grid-template-areas:
      'avail stats'
      'incoming ongoing'
      'history tip';
  }
  .area-hero { grid-area: hero; }
  .area-tiles { grid-area: tiles; }
  .area-table { grid-area: table; }
  .area-aside { grid-area: aside; }
  .area-avail { grid-area: avail; }
  .area-stats { grid-area: stats; }
  .area-incoming { grid-area: incoming; }
  .area-ongoing { grid-area: ongoing; }
  .area-history { grid-area: history; }
  .area-tip { grid-area: tip; }
}
