/* ====== RESET ====== */

* {
  box-sizing: border-box;
  }

body {
margin: 0;
padding: 0;
background: #060609;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
color: #f5f5f5;
}

/* ====== LAYOUT ====== */
.sidebar {
width: 240px;
background: #0c0c11;
border-right: 1px solid #1f1f28;
position: fixed;
inset: 0 auto 0 0;
padding: 22px 18px;
color: #f5f5f5;
display: flex;
flex-direction: column;
gap: 16px;
}

.sidebar h2 {
display: flex;
align-items: center;
gap: 8px;
font-size: 18px;
margin: 0 0 10px;
color: #FF7900;
}

.sidebar a {
display: flex;
align-items: center;
gap: 10px;
color: #d3d3d3;
padding: 8px 10px;
margin-bottom: 4px;
text-decoration: none;
border-radius: 9px;
font-size: 13px;
transition: background 0.2s, color 0.2s, transform 0.15s;
}

.sidebar a:hover {
background: rgba(255, 121, 0, 0.13);
color: #ffffff;
transform: translateX(2px);
}

.sidebar a.active {
background: #FF7900;
color: #111;
}

.sidebar .icon {
width: 16px;
text-align: center;
}

.sidebar-bottom {
margin-top: auto;
padding-top: 10px;
border-top: 1px solid #1f1f28;
}

/* CONTENT AREA */
.content {
margin-left: 260px;
padding: 26px 26px 40px;
}

/* ====== PAGE HEADER ====== */
.page-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 24px;
}

.page-header h1 {
font-size: 24px;
margin: 0 0 4px;
}

.page-header .subtitle {
margin: 0;
font-size: 13px;
color: #aaaaaa;
}

.header-right {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 8px;
}

.user-label {
font-size: 12px;
color: #888;
}

/* INLINE FILTERS */
.filters-inline {
display: flex;
gap: 8px;
align-items: center;
}

.filters-inline select,
.filters-inline input[type="date"] {
padding: 6px 10px;
border-radius: 999px;
border: 1px solid #2a2a34;
background: #101018;
color: #f5f5f5;
font-size: 12px;
}

/* ====== BUTTONS ====== */
.btn {
background: #FF7900;
border: none;
color: #111;
padding: 7px 14px;
border-radius: 999px;
font-size: 13px;
font-weight: 600;
text-decoration: none;
display: inline-flex;
align-items: center;
gap: 6px;
cursor: pointer;
}

.btn i {
font-size: 13px;
}

.btn-outline {
background: transparent;
border: 1px solid #FF7900;
color: #FF7900;
}

.btn-sm {
padding: 5px 11px;
font-size: 12px;
}

/* ====== KPI CARDS (ANCIEN SYSTEME .kpi-*) ====== */
/* Gardé pour compat éventuelle, même si on utilise maintenant .cards/.card */
.kpi-row {
display: flex;
gap: 18px;
margin-bottom: 18px;
}

.kpi-card {
flex: 1;
background: radial-gradient(circle at top left, rgba(255,121,0,0.18), #151520);
border-radius: 14px;
padding: 16px 18px;
border: 1px solid #262634;
box-shadow: 0 16px 35px rgba(0,0,0,0.5);
position: relative;
overflow: hidden;
}

.kpi-card::before {
content: "";
position: absolute;
top: -40px;
right: -40px;
width: 90px;
height: 90px;
background: rgba(255,121,0,0.22);
border-radius: 50%;
filter: blur(2px);
}

.kpi-icon {
font-size: 18px;
color: #FF7900;
margin-bottom: 6px;
}

.kpi-label {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #cccccc;
}

.kpi-value {
font-size: 26px;
font-weight: 700;
margin: 3px 0;
color: #ffffff;
}

.kpi-meta {
font-size: 11px;
color: #8b8b8b;
}

.kpi-warning { border-left: 3px solid #ffb347; }
.kpi-info    { border-left: 3px solid #3da9ff; }
.kpi-success { border-left: 3px solid #4caf50; }

/* ====== PANELS & GRID ====== */
.grid-2 {
display: grid;
grid-template-columns: 1.1fr 1.1fr;
gap: 20px;
margin-top: 10px;
}

.panel {
background: #14141f;
border-radius: 14px;
padding: 16px 18px 20px;
border: 1px solid #262634;
box-shadow: 0 14px 30px rgba(0,0,0,0.45);
}

.panel-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
font-size: 13px;
text-transform: uppercase;
letter-spacing: .06em;
color: #c5c5c5;
}

.panel-header span i {
margin-right: 6px;
}

.export-note {
font-size: 11px;
color: #9b9b9b;
margin-top: 8px;
}

/* ====== TABLES ====== */
.table {
width: 100%;
border-collapse: collapse;
background: #14141f;
border-radius: 12px;
overflow: hidden;
margin-top: 12px;
}

.table th,
.table td {
padding: 10px 12px;
font-size: 12px;
border-bottom: 1px solid #222231;
}

.table th {
background: #181825;
text-align: left;
color: #d9d9d9;
font-weight: 600;
}

.table tr:nth-child(even) {
background: #13131d;
}

/* ====== BADGES ====== */
.badge-count {
display: inline-block;
min-width: 18px;
padding: 2px 6px;
border-radius: 999px;
background: #FF7900;
color: #000;
font-size: 11px;
font-weight: bold;
margin-left: 6px;
text-align: center;
}

.badge {
padding: 3px 8px;
border-radius: 999px;
font-size: 11px;
display: inline-block;
}

.badge.pending { background:#ff5252; color:white; }
.badge.progress{ background:#ffb347; color:#202020;}
.badge.done    { background:#4caf50; color:white;}

/* ====== FORMS ====== */
form label {
display: block;
margin: 8px 0 3px;
font-size: 13px;
color: #e0e0e0;
}

form input,
form select,
form textarea {
width: 100%;
padding: 9px 10px;
border-radius: 8px;
border: 1px solid #272737;
background: #101018;
color: #f5f5f5;
font-size: 13px;
}

textarea {
min-height: 110px;
}

/* ====== LOGIN PAGE ====== */
.login-wrapper {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: radial-gradient(circle at top, #1a1a25, #050507);
}

.login-card {
width: 360px;
background: #10101a;
padding: 28px 26px 26px;
border-radius: 16px;
box-shadow: 0 18px 40px rgba(0,0,0,0.8);
border: 1px solid #252535;
}

.login-title {
font-size: 20px;
margin: 0 0 4px;
text-align: center;
}

.login-subtitle {
font-size: 12px;
color: #a0a0a0;
text-align: center;
margin-bottom: 18px;
}

.login-logo {
text-align: center;
margin-bottom: 10px;
color: #FF7900;
font-weight: 700;
}

.login-error {
background: rgba(255,82,82,0.1);
border: 1px solid #ff5252;
color: #ffb3b3;
padding: 7px 9px;
border-radius: 8px;
font-size: 12px;
margin-bottom: 10px;
}

.alert {
padding: 10px 15px;
border-radius: 6px;
margin-bottom: 15px;
font-size: 14px;
}
.alert-error {
background: #5c1b1b;
color: #ffb3b3;
}
.alert-success {
background: #1b5c2c;
color: #b3ffcf;
}

/* ====== AJOUTS POUR LE NOUVEAU DASHBOARD ====== */

/* Sous-titre générique (en dehors du header) */
.subtitle {
font-size: 13px;
color: #aaaaaa;
margin-top: 0;
margin-bottom: 10px;
}

/* Nouveaux KPI blocs : .cards / .card utilisés dans dashboard.php */
.cards {
display: flex;
gap: 18px;
margin: 18px 0;
flex-wrap: wrap;
}

.card {
flex: 1;
min-width: 220px;
background: radial-gradient(circle at top left, rgba(255,121,0,0.18), #151520);
border-radius: 14px;
padding: 16px 18px;
border: 1px solid #262634;
box-shadow: 0 16px 35px rgba(0,0,0,0.5);
position: relative;
overflow: hidden;
}

.card::before {
content: "";
position: absolute;
top: -40px;
right: -40px;
width: 90px;
height: 90px;
background: rgba(255,121,0,0.22);
border-radius: 50%;
filter: blur(2px);
}

.card h3 {
margin: 0 0 6px;
font-size: 14px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #e5e5e5;
}

.card span {
display: block;
font-size: 26px;
font-weight: 700;
margin: 2px 0;
color: #ffffff;
}

.card small {
display: block;
font-size: 11px;
color: #9a9a9a;
}

/* Canvas des graphiques (dashboard) */
/* On garde la taille fluide, mais on laisse le style au .panel pour éviter le “double cadre” */
canvas {
max-width: 100%;
display: block;
}

/* Formulaire de filtres du dashboard (.filters) */
.filters {
background: #101018;
border-radius: 12px;
padding: 12px 14px 14px;
border: 1px solid #262634;
margin: 10px 0 18px;
font-size: 13px;
}

.filters label {
font-size: 12px;
color: #c2c2c2;
}

.filters input[type="date"],
.filters select {
border-radius: 999px;
}
