:root {
    --bg-page: #f0f2f5;
    --bg-card: #e8eaf6;
    --bg-header: #dde1f5;
    --color-text:#111111;
    --color-accent:#3f51b5;
    font-family: Consolas;
    --border-radius: 8px;
    --box-shadow: 0 2px 6px 0px rgba(0,0,0,0.1);
    --transition: background 0.675s;
}

body {
  transition: var(--transition);
  margin: 0px;
  padding: 0px;
  background-color: var(--bg-page);
  color: var(--color-text);
}

/* Header */
.header {
    transition: var(--transition);
    text-align: left;
    padding: 20px 15%;
    background-color: var(--bg-header);
}

.header-sub {
    transition: var(--transition);
    margin: 0;
    font-size: 12px;
    color: var(--color-text);
    letter-spacing: 1px;
    opacity: 0.6;
}

.header h1 {
    transition: var(--transition);
    margin: 4px 0 0 0;
    color: var(--color-accent);
    font-size: 28px;
}

.header::after {
    transition: var(--transition);
    content: '';
    display: block;
    border-bottom: 1px solid var(--color-accent);
    margin-top: 15px;
    opacity: 0.3;
}

/* Cards */
.cards {
    transition: var(--transition);
    margin: 20px auto;
    width: 70%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.row {
    transition: var(--transition);
    display: flex;
    justify-content: flex-start;
    gap: 20px;
}

.card {
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background-color: var(--bg-card);
    color: var(--color-text);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 15px 20px;
    box-sizing: border-box;
    gap: 8px;
}

.card h2 {
    transition: var(--transition);
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--color-accent);
    border-bottom: 1px solid var(--color-accent);
    padding-bottom: 8px;
    opacity: 0.9;
}

/* Boutons */
.btn {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border: none;
    box-sizing: border-box;
    position: relative;
    background: var(--color-accent);
    color: white;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    width: 175px;
    height: 40px;
    text-decoration: none !important;
    font-family: Noto Sans;
    font-size:13px;
    margin: 20px auto; /* auto = centré */
}

.btn:active {
    top: 2px;
}

.btn:hover {
    filter: brightness(0.85);
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Bouton thème fixe */
#themeBtn {
transition: var(--transition);
position: fixed;
bottom: 20px;
right: 20px;
background: var(--bg-card);
color: var(--color-text);
border: 1px solid var(--color-accent);
border-radius: var(--border-radius);
padding: 6px 12px;
cursor: pointer;
box-shadow: var(--box-shadow);
font-size: 13px;
user-select: none;
}

#themeBtn:hover {
filter: brightness(0.95);
}

/* Panneau thème */
#themePanel {
transition: var(--transition);
position: fixed;
bottom: 55px;
right: 20px;
background: var(--bg-card);
color: var(--color-text);
border: 1px solid var(--color-accent);
border-radius: var(--border-radius);
padding: 12px;
box-shadow: var(--box-shadow);
font-size: 13px;
display: none;
}

#themePanel.open {
display: block;
}

#themePanel p {
margin: 4px 0;
font-weight: bold;
font-size: 12px;
color: var(--color-text);
}

.themeColors {
    display: flex;
    gap: 8px;
    margin: 6px 0 10px 0;
}

.themeColor {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border 0.2s;
}

.themeColor:hover {
    border: 1px solid black;
}

/* ========== RESPONSIVE ========== */

/* Grand écran */
@media (min-width: 1440px) {
    .cards {
        width: 60%;
    }
    .header {
        padding: 20px 20%;
    }
}

/* Tablette paysage */
@media (max-width: 1024px) {
    .cards {
        width: 85%;
    }
    .header {
        padding: 20px 8%;
    }
}

/* Tablette portrait */
@media (max-width: 768px) {
    .cards {
        width: 95%;
    }
    .header {
        padding: 15px 5%;
    }
    .row {
        flex-direction: column;
    }
    .card {
        width: 100% !important;
    }
}

/* Téléphone grand */
@media (max-width: 480px) {
    .header h1 {
        font-size: 22px;
    }
    .header-sub {
        font-size: 10px;
    }
    .btn-group {
        flex-direction: column;
        align-items: center;
    }
    .btn {
        width: 100%;
    }
    #themeBtn {
    bottom: 10px;
    right: 10px;
    font-size: 11px;
    padding: 4px 8px;
    }
    #themePanel {
    right: 10px;
    bottom: 45px;
    }
}

/* Téléphone petit */
@media (max-width: 360px) {
    .header h1 {
        font-size: 18px;
    }
    .cards {
        margin: 10px auto;
    }
    .card {
        padding: 10px 12px;
    }
}

/* Liste des affaires */
.proces-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Une affaire */
.proces-item {
  border: 1px solid var(--color-accent);
  border-radius: var(--border-radius);
  overflow: hidden;
}

/* En-tête cliquable */
.proces-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--bg-header);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.proces-header:hover {
  filter: brightness(0.95);
}

/* Colonnes de l'en-tête */
.proces-numero {
  font-weight: bold;
  color: var(--color-accent);
  min-width: 180px;
}

.proces-parties {
  flex: 1;
  color: var(--color-text);
}

.proces-date {
  color: var(--color-text);
  opacity: 0.7;
  min-width: 90px;
  text-align: center;
}

/* Statuts */
.proces-statut {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  min-width: 80px;
  text-align: center;
}

.statut-encours  { background: #fff3cd; color: #856404; }
.statut-termine  { background: #d1e7dd; color: #0f5132; }
.statut-archive  { background: #e2e3e5; color: #41464b; }

/* Flèche */
.proces-arrow {
  color: var(--color-accent);
  transition: transform 0.3s;
  margin-left: auto;
}

.proces-item.open .proces-arrow {
  transform: rotate(180deg);
}

/* Corps de l'affaire (fermé par défaut) */
.proces-body {
  display: none;
  padding: 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--color-accent);
  flex-direction: column;
  gap: 16px;
}

.proces-item.open .proces-body {
  display: flex;
}

/* Sections */
.proces-section h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: 4px;
  opacity: 0.9;
}

/* Tableau */
.proces-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.proces-table td {
  padding: 6px 10px;
  color: var(--color-text);
  vertical-align: top;
}

.proces-table tr:nth-child(odd) td {
  background: var(--bg-page);
  opacity: 0.85;
}

.proces-table td:first-child {
  font-weight: bold;
  width: 35%;
  color: var(--color-accent);
}

/* Responsive */
@media (max-width: 768px) {
    .proces-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .proces-numero {
        min-width: unset;
        width: 100%;
    }

    .proces-table td:first-child {
        width: 45%;
    }
}

@media (max-width: 480px) {
    .proces-table {
        display: block;
    }

    .proces-table tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 8px;
    }

    .proces-table td:first-child {
        width: 100%;
        padding-bottom: 2px;
    }
}
