/* --- Reset & global --- */
@import url('https://fonts.googleapis.com/css2?family=Albert+Sans:ital,wght@0,100..900;1,100..900&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Albert Sans", sans-serif;
    background: #F5F5F5 !important;
    color: #464D77;
}

/* Layout */
.container {
    display: flex;
    margin-top: 40px;
    height: calc(100vh - 40px);
    overflow: hidden;
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #222B38;
    padding: 4px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 998;
}
.topbar > a {
    display: flex;
}
.topbar .logo {
    width: 130px;
}
.topbar nav .display-picture {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    width: 32px;
    height: 32px;
    background: #046981;
    box-shadow: inset 0 0 0 2px #093E52;
    border-radius: 300px;
}
.topbar nav .display-picture:hover {
    box-shadow: inset 0 0 0 2px #fff;
}
.topbar nav a {
    color: #fff;
}

.dropdown {
    transition: 0.5s ease;
    z-index: 999;
}

.dropdown ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 224px;
    background: #fff;
    border: 1px solid #E9E9E9;
    border-radius: 8px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,.2);
    position: absolute;
    top: 3rem;
    right: 24px;
    padding: 4px;
    list-style: none;
    z-index: 999;
}

.dropdown ul li {
    margin: 2px 0;
    padding: 6px 8px;
    color: #FFF;
    font-size: 14px;
    width: 100%;
    border-radius: 4px;
}
.dropdown ul li h5 {
    font-size: 15px;
    color: #464D77;
}
.dropdown ul li:nth-child(3) {
    margin-top: 0;
}
.dropdown ul li:last-child {
    margin: 0;
}
.dropdown ul li:hover {
    background: #EFF3FE;
}
.dropdown ul .separator {
    margin: 4px 0;
    padding: 0;
    width: 100%;
    border-radius: 0;
}
.dropdown ul li:first-child:hover, .dropdown ul .separator:hover {
    background: transparent;
    pointer-events: none;
}
.hidden {
    display: none;
}
.dropdown ul li a {
    display: block;
    text-decoration: none;
    color: #464D77;
    font-size: 14px;
    width: 100%;
    margin: 0;
}
.dropdown ul li a div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dropdown ul li a span {
    margin-left: auto;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 40px;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 240px;
    height: calc(100vh - 40px);
    background: #F5F5F5;
    z-index: 1000;
}
button#toggleAside {
    padding: 0;
    width: 20px;
    height: 32px;
    position: absolute;
    top: 23px;
    left: 240px;
    background: #fff;
    border: 1px solid #E9E9E9;
    border-radius: 0 4px 4px 0;
}
button#toggleAside:hover {
    background: #EFF3FE;
}
aside.open {
    transform: translateX(0%);
}
.sidebar .sidebar-nav {
    overflow: auto;
    padding: 24px;
}
.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-news {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.news-item {
    padding: 10px;
    background: #fff;
    border: 1px solid #E9E9E9;
    border-radius: 8px;
}
.news-item h5 {
    font-size: 15px;
}
.news-item small {
    font-size: 12px;
}
.news-item p {
    font-size: 14px;
}
button#toggleAside i {
    color: #808080;
    transform: rotate(0deg);
}
button#toggleAside:hover i {
    color: #464D77;
}
button#toggleAside .rotate {
    transform: rotate(180deg);
}

/* Main content */
.main-container {
    flex: 1;
    margin: 0px;
    overflow: auto;
}
.main {
    transition: margin 200ms;
    margin: 0;
    padding: 24px;
    background: #fff;
    border-left: 1px solid #E9E9E9;
}
main.fullscreen {
    margin: 0 0 0 240px;
}
.main h2 {
    margin: 0 24px 20px 0;
    color: #464D77;
}

.main h3 i {
    margin-right: 8px;
}

/* Cards Stats */
.cards {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}
.card {
    flex: 1;
    background: #FDFDFD;
    border: 1px solid #E9E9E9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}
.card:hover {
    transform: translateY(-2px);
    background: #EFF3FE;
}
.card h4 {
    margin: 0;
    font-size: 14px;
    color: #464D77;
    font-weight: 500;
}
.card p {
    font-size: 20px;
    font-weight: bold;
    margin: 8px 0 0;
    color: #464D77;
}

/* Filters */
form.filters {
    margin: 20px 0;
    background: #FDFDFD;
    padding: 16px;
    border: 1px solid #E9E9E9;
    border-radius: 8px;
}
form.filters label {
    margin-right: 15px;
}
form.filters input, 
form.filters button {
    margin-left: 5px;
}

/* Table */
.sales {
    background: #FDFDFD;
    border: 1px solid #E9E9E9;
    border-radius: 8px;
    padding: 16px 0 16px 24px;
}
.sales h3 {
    margin: 8px 0 24px;
    color: #464D77;
}
.sales-table {
    width: 100%;
    overflow: auto;
}
table {
    width: 100%;
    min-width: 1180px;
    max-width: calc(100% - 24px);
    background: #FDFDFD;
    border-radius: 8px;
    border-collapse: collapse;
}
tbody:first-child tr {
    background: #fff;
}
th:first-child {
    border-radius: 8px 0 0 8px;
}
th:last-child {
    border-radius: 0 8px 8px 0;
}
th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}
th {
    background: #F5F5F5;
    font-weight: 600;
}
td {
    background: #fff;
}
tr:first-child th {
    border: none;
}
tr {
    border: none;
}
tr:nth-child(even) {
    background: #f9fafb;
}
tr:hover {
    background: #EFF3FE!important;
}
tr:hover td {
    border-color: #FDFDFD!important;
    background: #EFF3FE!important;
}
tr:hover td:first-child {
    border-radius: 8px 0 0 8px!important;
}
tr:hover td:last-child {
    border-radius: 0 8px 8px 0!important;
}
tr:last-child td {
    border: none;
}
td a.facture {
    margin-right: 8px;
}
td a {
    text-decoration: none;
    font-size: 16px;
    border: 1px solid #E3E3E3;
    border-radius: 6px;
    padding: 6px 10px;
    color: #120B06!important;
    background: #f5f5f5;
}
td a:hover {
    background: #046981;
    color: #fff!important;
}
td a.tooltip {
    position: relative;
    text-decoration: none;
    color: blue;
    cursor: pointer;
}
/* Texte de l'infobulle */
td a.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%; /* place au-dessus du lien */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

/* Petite flèche */
td a.tooltip::before {
    content: "";
    position: absolute;
    bottom: 92%; 
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(0,0,0,0.8) transparent transparent transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Affichage au hover */
td a.tooltip:hover::after,
td a.tooltip:hover::before {
    opacity: 1;
}
td img {
    width: 90px;
    height: 90px;
    border: 1px solid #E9E9E9;
    border-radius: 8px;
}

/* Buttons & inputs */
button, input, select {
    border: 1px solid #E9E9E9;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
}
button {
    background: #046981;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    border: none;
}
button:hover {
    background: #093E52;
}
input[type="number"], input[type="date"], input[type="text"], select {
    background: #fff;
    width: auto;
}

/* Alerts */
.alert {
    padding: 12px;
    margin: 15px 0;
    border-radius: 6px;
}
.alert.success {
    background: #e3f6ec;
    border: 1px solid #7be5a2;
    color: #2da56b;
    font-weight: 500;
}
.alert.success .fa-regular {
    margin-right: 8px;
}

/* Graphs */
.graphs {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}
.graphs > div {
    flex: 1;
    min-width: 0;
    background: #FDFDFD;
    border: 1px solid #E9E9E9;
    border-radius: 8px;
    padding: 16px;
}
.graphs > div:hover {
    transform: translateY(-2px);
    background: #EFF3FE;
}
.graphs p {
    margin-bottom: 10px;
    font-weight: 800;
    color: #374151;
}
#salesChart7, #salesChart30, #salesChartYear {
    display: block;
    box-sizing: border-box;
    height: 120px;
    width: 100%;
    min-width: calc(100% / 3);
}
.etat-select {
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 400;
    cursor: pointer;
    appearance: none;
}

/* En cours → orange */
.etat-select.en_cours {
    background-color: #FFF5E6; /* orange clair */
    color: #E39331;           /* orange foncé */
}

/* Expédié → vert */
.etat-select.expedie {
    background-color: #ecfdf5;/* vert clair */
    color: #069669;/* vert clair */
    border: 1px solid #a7f3d0;
}

/*spin refresh*/
/* styles.css */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}


