/* =========================================================
   POSIDIUS REPAIR - Thème "Atelier Tech"
   ========================================================= */
:root {
  --primary: #FF6A13;
  --primary-dark: #E0570A;
  --secondary: #1B2A4A;
  --accent: #17C3B2;
  --danger: #E63946;
  --warning: #FFB703;
  --light: #F4F6FA;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(27, 42, 74, 0.08);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--light);
  color: var(--secondary);
  margin: 0;
}

h1, h2, h3, h4, h5, .brand {
  font-family: 'Poppins', sans-serif;
}

a { text-decoration: none; color: inherit; }

/* ===================== LAYOUT ===================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--secondary);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.25s ease;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar .brand img { height: 32px; width: auto; border-radius: 6px; }
.sidebar .brand .badge-version { font-size: 0.6rem; opacity: 0.6; font-weight: 400; }

.sidebar nav { padding: 10px 0 30px; }

.sidebar .nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 14px 18px 6px;
}

.sidebar a.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: rgba(255,255,255,0.75);
  font-size: 0.92rem;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.sidebar a.nav-link i { width: 18px; text-align: center; color: rgba(255,255,255,0.55); }

.sidebar a.nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.sidebar a.nav-link.active {
  background: rgba(255,106,19,0.15);
  color: #fff;
  border-left-color: var(--primary);
}

.sidebar a.nav-link.active i { color: var(--primary); }

/* ===================== MAIN ===================== */
.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #E9ECEF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar .menu-toggle {
  display: none;
  font-size: 1.3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--secondary);
}

.topbar .page-title { font-weight: 600; font-size: 1.05rem; }

.topbar .user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.content {
  padding: 24px;
  flex: 1;
}

/* ===================== CARDS ===================== */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: none;
}

.stat-card {
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: #fff;
}

.stat-card .value { font-size: 1.5rem; font-weight: 700; font-family: 'Poppins', sans-serif; }
.stat-card .label { font-size: 0.8rem; color: #6C757D; }

/* ===================== BUTTONS ===================== */
.btn-primary, .btn-primary:focus {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-accent {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.text-accent { color: var(--accent); }
.bg-accent { background-color: var(--accent); }

/* ===================== BADGES STATUTS ===================== */
.badge-statut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

/* ===================== TABLES ===================== */
.table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6C757D;
  border-bottom-width: 1px;
  background: #F8F9FB;
}

.table td, .table th { vertical-align: middle; }

/* ===================== AUTH PAGES ===================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary) 0%, #0F1830 100%);
  padding: 20px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.auth-card .brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.auth-card .brand-logo .icon-box {
  width: 48px; height: 48px;
  background: var(--primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.4rem;
}

.input-group .toggle-password {
  cursor: pointer;
  background: #fff;
  border-left: none;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; width: 100%; }
  .topbar .menu-toggle { display: inline-block; }
}

/* ===================== MISC ===================== */
.alert-licence {
  background: #FFF3E0;
  border-left: 4px solid var(--warning);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #ADB5BD;
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }
