/* ---------- GLOBAL ---------- */
body {
    font-family: Arial, sans-serif;
    margin: 10px;
    background: #f4f7fb;
    color: #2f3a4a;

}

a {
    color: #5b7cfa;
    text-decoration: none;
}
a:hover { 
    text-decoration: underline; 
    color: #405de6;
}

/* ---------- LOGIN ---------- */
.login-container {
    max-width: 360px;
    margin: 60px auto;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #dbe4f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(91,124,250,0.12);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
    color: #344054;
}

.login-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #4a5568;
}

.login-container input {
    /*width: 100%;*/
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fdfefe;
}

.small-date {
	width:160px;
	padding:4px;

}



/* ---------- MESSAGES ---------- */
.success, .error, .lock {
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.success {
    background: #d8f3dc;
    color: #1b4332;
    border: 1px solid #b7e4c7;
}

.error {
    background: #ffe5e5;
    color: #b42318;
    border: 1px solid #f5b5b5;
    text-align: center;
}

.lock {
    background: #fff4d6;
    color: #8a5a00;
    border: 1px solid #ffe08a;
}

/* ---------- HEADER ---------- */
.app-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-logo img {
    height: 100px;
    max-width: 100%;
}

.app-title {
    text-align: center;
    margin: 15px 10px;
    font-size: 1.6em;
    color: #344054;
}

.app-stitle {
    text-align: center;
    margin: 15px 10px;
    font-size: 1.2em;
    color: #667085;
}

/* Bouton fermer */
.close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: red;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
}
/*
.out-button {
    float:right;
    text-decoration:none;
    font-size:18px;
    color:#475467;
}
*/
/* ---------- BARRE HAUTE ---------- */
.top {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #dbe4f0;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

/* ---------- TABLEAU ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 10px;
    background: #ffffff;
}

th {
    border: 1px solid #d0d7e2;
    padding: 6px;
}

td {
  /*line-height: 1; */
  padding: 2px;
  /*border: 1px solid #ddd;*/
  color: #344054;
}

tr:hover {
  background-color: #f0f0f0;
}

th {
    background: #e8eef9;
    color: #344054;
}

th[colspan] {
    background: #dbe7ff;
    text-align: center;
    font-weight: bold;
}

.today {
    background-color: #c7f9cc !important;
    color: #1b4332;
    font-weight: bold;
}

/* ---------- FORMULAIRES ---------- */
input[type="text"],
input[type="date"],
input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #ffffff;
    color: #344054;
}

.select-theme {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    font-weight: bold;
    cursor: pointer;
    color: #344054;
}

.select-favoris {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    font-weight: bold;
    cursor: pointer;
    color: #344054;
}

/* ---------- SWITCHS COOL --------- */
.switch {
  appearance: none;
  width: 30px;
  height: 16px;
  background: #b0b0b0;
  border: 1px solid #777;
  border-radius: 16px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.25);
}

.switch::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.switch:checked {
  background: #4caf50;
  border-color: #4caf50;
}

.switch:checked::before {
  transform: translateX(14px);
}

/* ---------- BOUTONS ---------- */
.buttons {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
	text-decoration: none;

}

button {
    background: #5b7cfa;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
	margin-right: 5px;

}

button:hover {
    background: #405de6;
}

button:disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    padding: 6px 12px;
    border-radius: 10px;
    background: #eef2ff;
    color: #344054;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
	margin-right: 5px;
}

.btn:hover {
    background: #dbe7ff;
    text-decoration: none;
}

.btn.primary {
    background: #5b7cfa;
    color: white;
}

.btn-danger {
    background: #ef476f;
    color: white;
}
.btn-danger:hover {
    background: #d63357;
}

.btn-ajout {
    background: #52b788;
    color: white;
}

.btn-warning {
    background: #ffb703;
    color: #4a3200;
}

/* ---------- BADGES ---------- */
.badge_lite {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px;
    white-space: nowrap;
    background-color: #ef476f;
    color: white;
}

.badge_vert {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px;
    white-space: nowrap;
    background-color: #52b788;
    color: white;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px;
    white-space: nowrap;
}

.badge-admin { background:#d63357; color:#fff; }
.badge-editeur { background:#5b7cfa; color:#fff; }
.badge-reader { background:#94a3b8; color:#fff; }
.badge-ok { background:#52b788; color:#fff; }
.badge-off { background:#ef476f; color:#fff; }

/* ---------- ZONE DE RECERCHE ---------- */
.zone-recherche {
	width: 50%;
	padding:4px;
}

/* ---------- FILTRES ---------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;*/
}

.filter-left {
    white-space: wrap;
	
}

.no-wrap {
    white-space: nowrap;
}

.filter-right {
    display: flex;
    gap: 8px;
    align-items: center;
}


/* ---------- GALERIE DOCUMENTS ---------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.doc-card {
    border: 1px solid #dbe4f0;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(91,124,250,0.08);
}

.doc-card img.thumb {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin-bottom: 8px;
}

.doc-name {
    font-size: 13px;
    word-break: break-word;
    color: #344054;
}

/* ---------- FOOTER ---------- */
.footer {
    margin-top: 20px;
    padding: 10px;
    text-align: center;
    font-size: 11px;
    color: #98a2b3;
}

/* SPINNER */
#loadingOverlay{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.5);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.loaderBox{
    background:white;
    padding:30px;
    border-radius:10px;
    text-align:center;
}

.spinner{
    width:50px;
    height:50px;
    border:6px solid #ddd;
    border-top:6px solid #3498db;
    border-radius:50%;
    animation:spin 1s linear infinite;
    margin:auto;
}

.loadingText{
    margin-top:15px;
    font-size:18px;
}

@keyframes spin{
    100%{
        transform:rotate(360deg);
    }
}

/* HAMBURGER MENU */
.hamburger {
    display: none;
}

/* ---------- IMPRESSION ---------- */
@media print {
    button, .btn, .hamburger, .checkbox, .no-wrap, .zone-recherche, .select-favoris, .purge-box ,.out-button,p, .buttons {
        display: none !important;
    }
	
	input[type="file"] {
		display: none !important;
    }

	input[type="checkbox"] {
		display: none !important;
	}

    body {
        background: #fff;
    }

    th, td {
        border: 1px solid #000;
    }

    .login-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
}

/* ===================================
	ZONE DE SAISIE SPECIFIQUE
================================= */
fieldset {
    /*width: 350px;*/
    padding: 20px;
    border: 2px solid #555;
    border-radius: 8px;
}

legend {
    font-weight: bold;
    padding: 0 10px;
}

.radio-group {
    margin-top: 8px;
}


/* ===================================
	MESSAGERIE MAIL
================================= */
.mail-container {
    width: 600px;
    margin: 60px auto;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #dbe4f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(91,124,250,0.12);
}

.mail-container h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
    color: #344054;
}

.mai-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.mail-container input {
    /*width: 100%;*/
    padding: 8px;	
    margin-bottom: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
}

.sans-bouton {
  background-color: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #5b7cfa;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.sans-bouton:hover {
  color: #405de6;
  transform: scale(1.1);
}

/* ==============================
   MOBILE VERSION
============================== */
/* =====================================================
   MENU OFF-CANVAS MOBILE PROPRE
===================================================== */
@media (max-width: 768px) {

    /* Bouton hamburger */
    .hamburger {
        display: block;
        font-size: 26px;
        border: none;
        border-radius: 10px;
        padding: 6px 10px;
        cursor: pointer;
        position: relative;
        z-index: 2001;
        background: #eef2ff;
        color: #344054;
    }

	.hamburger:hover {
		background: #dbe7ff;
	}

    /* Overlay sombre */
    .menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(52,64,84,0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        z-index: 2000;
    }

    .menu-overlay.open {
        opacity: 1;
        visibility: hidden;
    }

    /* Menu latéral */
    .top-actions {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        background: #ffffff;
        box-shadow: 4px 0 20px rgba(91,124,250,0.15);

        display: flex;
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        overflow-y: auto;

        transform: translateX(-100%);
        transition: transform 0.3s ease;

        z-index: 2002;
    }

    .top-actions.open {
        transform: translateX(0);
    }

    /* Boutons style app */
    .top-actions .btn {
        align-items: center;
		text-align: center;
        gap: 10px;
        padding: 12px;
        border-radius: 12px;
        border: none;
        width: auto;
        font-size: 15px;
        transition: 0.2s;
        background: #eef2ff;
    }

    .top-actions .btn:hover {
        background: #dbe7ff;
    }

	/* ---------- HEADER ---------- */
    .app-header {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		text-align: center;
		gap: 5px;
	}

	.app-logo img {
		height: 100px;
		max-width: 100%;
	}

	body {
		overflow-x: hidden;
	}

    /* Empêche scroll arrière-plan */
    body.menu-open {
		overflow: hidden;
    }
}