/* =============================
   THEME GLOBAL
============================= */
:root {
    --bg: #f4f6f9;
    --bg-card: #ffffff;
    --primary: #2b6cb0;
    --primary-light: #3182ce;
    --danger: #e53e3e;
    --success: #38a169;
    --warning: #dd6b20;
    --text: #2d3748;
    --text-light: #4a5568;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --transition: 0.2s ease;
}

/* =============================
   BASE
============================= */
body {
    font-family: "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
}

h1, h2, h3 {
    color: var(--text);
    margin-top: 0;
}

.container {
    max-width: 1200px;
    margin: auto;
}

.title {
    text-align: center;
}

.container_principal {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    position: absolute;
    min-width: 65%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

}

.cadre {
    flex: 1;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Couleurs de test */
.cadre1 { background: #d0e7ff; }
.cadre2 { background: #ffe7d0; }
.cadre2 { background: #d0e7ff; }

/* =============================
   CARDS / BLOCS
============================= */
.card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* =============================
   FORMULAIRES
============================= */
input, select, textarea, button {
    font-size: 16px;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 3px rgba(43,108,176,0.4);
    outline: none;
}

/* =============================
   BOUTONS
============================= */
.btn {
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    min-width: 75px;
    min-height: 38px;
}

.btn:hover {
    background: var(--primary-light);
}

/* versions */
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #c53030; }

.btn-success { background: var(--success); }
.btn-success:hover { background: #2f855a; }

.btn-warning { background: var(--warning); }
.btn-warning:hover { background: #c05621; }

.btn-upload {
    color: var(--text);
    font-size: 18px;
    min-width: 75px;
    min-height: 38px;
}

/* =============================
   BOUTON UOPLOAD PERSONNALISÉ
============================= */

.upload-form {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.upload-label {
    cursor: pointer;
    font-size: 18px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.upload-label:hover {
    background: #e6e6e6;
}

.upload-input {
    display: none; /* Cache complètement le bouton "Parcourir" */
}

.upload-icon {
    cursor: pointer;
    font-size: 16px;
    padding: 3px;
    opacity: 0.7;
}

.upload-icon:hover {
    opacity: 1;
}

.upload-input {
    display: none;
}


/* =============================
   TABLEAUX
============================= */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
}

th {
    background: var(--primary);
    color: white;
    padding: 12px;
    text-align: left;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
}

tr:hover td {
    background: #f1f5f9;
}

.row-new {
  background-color: #a5a5a5; 
}

.invisible-table {
  border-collapse: unset;
  border: none;
  padding: 0px;
  background-color: unset;
  box-shadow: unset; 
  border-radius: unset;
  zoom: 1.2;
}

.invisible-td {
  border: none;
  padding: 0px;
  background-color: unset;
  border-bottom: unset;
}

/* =============================
   BADGES / STATUTS
============================= */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
}

.badge-new { background: var(--primary); }
.badge-wait { background: var(--warning); }
.badge-progress { background: #805ad5; }
.badge-active { background: var(--primary-light); }
.badge-done { background: var(--success); }
.badge-archived { background: var(--text-light); }

/* =============================
   HEADER / NAV SIMPLE
============================= */
.header {
    background: var(--primary);
    color: white;
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    color: white;
}

/* =============================
   LISTES / PANNEAUX
============================= */
.panel {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* =============================
   GRILLES RESPONSIVES
============================= */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* =============================
   BARRE DE FILTRES
============================= */

.filters-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
  padding: 10px 0;
  font-size: 14px;
}

.filters-bar label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.filters-bar select {
  padding: 4px 6px;
  font-size: 14px;
  width: 200px;
  transform: translateY(8px);
}

.filters-bar button {
  padding: 6px 12px;
  font-size: 14px;
  width: 200px;
  transform: translateY(8px);
  display: none;
}

#refresh {
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}

/* =============================
   CARTE / GÉOLOCALISATION
============================= */
#map { 
    height: 100%; 
    border-radius:8px; 
    min-height: 550px; 
    margin-top: 20px;
}

.btn-geoloc { margin-bottom: 15px; }



/* =============================
   SMARTPHONE / TABLETTE
============================= */

@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
    .container_principal { flex-direction: column; }
    .cadre { width: 100%; }
}

/* En plus, forcer colonne en orientation portrait (sécurité pour mobiles) */
@media (orientation: portrait) and (max-width: 1200px) {
    .container_principal 
    { 
        flex-direction: column; 
        width: 95%; 
        position:unset;
        transform: unset;
    }   

    .cadre { 
        width: 100%; 
        margin-bottom: 16px; 
    }

    body {
        padding: 12px;
    }

    h1, h2, h3 {
        font-size: 36px;
    }

    label {
        font-size: 42px;
    }

    input, select, textarea, button {
        font-size: 42px;            /* texte interne */
        padding: 28px;              /* zones cliquables plus grandes */
        border-radius: 10px;
        margin-bottom: 18px;
        height: 80px;
    }

    select {
        min-height: 100px;               /* meilleure ergonomie */
        background-color: #FFFFFF;
    }

    textarea {
        min-height: 120px;
    }

   .btn {
        padding: 14px 18px;
        font-size: 42px;
    }

    .btn-geoloc {
        padding: 14px 18px;
        font-size: 42px;
    }

    #map {
        min-height: 1000px;              /* carte plus visible */
    }

    .cadre {
        padding: 18px;
    }

    .title h1 {
        font-size: 48px;
    }
}

