/* ============================================
   LONASE TRACKER - Feuille de style principale
   ============================================ */

:root {
  --lonase-primary: #1B4F72;
  --lonase-dark: #154360;
  --lonase-light: #AED6F1;
  --lonase-soft: rgba(27, 79, 114, 0.08);
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --navbar-height: 60px;
  --border-radius: 12px;
  --shadow: 0 2px 15px rgba(0,0,0,0.08);
}

/* ============ BASE ============ */
* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f4f8;
  color: #333;
  overflow-x: hidden;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(160deg, var(--lonase-primary) 0%, #0a2540 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 3px 0 20px rgba(0,0,0,0.15);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F9E79F;
  font-size: 20px;
}

.sidebar-brand-text {
  color: white;
  font-size: 16px;
  line-height: 1.2;
}

.sidebar-divider {
  border-color: rgba(255,255,255,0.1);
  margin: 8px 16px;
}

.sidebar-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  padding: 8px 18px 4px;
}

.sidebar-link {
  color: rgba(255,255,255,0.75) !important;
  border-radius: 8px;
  padding: 10px 14px !important;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.1) !important;
  color: white !important;
  transform: translateX(2px);
}

.sidebar-link.active {
  background: rgba(255,255,255,0.18) !important;
  color: white !important;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: auto;
}

/* ============ CONTENT ============ */
#content-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* ============ TOP NAVBAR ============ */
.top-navbar {
  height: var(--navbar-height);
  background: white;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 999;
}

.sidebar-toggle {
  color: var(--lonase-primary) !important;
  padding: 4px 8px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  padding: 24px 0 0 0;
}

/* ============ FOOTER ============ */
.footer {
  background: white;
  border-top: 1px solid #e9ecef;
}

/* ============ CARDS ============ */
.card {
  border-radius: var(--border-radius) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover { box-shadow: 0 4px 25px rgba(0,0,0,0.1) !important; }

/* ============ STAT CARDS ============ */
.stat-card {
  cursor: default;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--lonase-primary);
}

.stat-label {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
  margin-top: 4px;
}

/* ============ PDV CARDS ============ */
.pdv-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.pdv-card:hover { transform: translateY(-2px); }

/* ============ LONASE COLOR ============ */
.bg-lonase { background-color: var(--lonase-primary) !important; }
.text-lonase { color: var(--lonase-primary) !important; }
.btn-lonase {
  background: var(--lonase-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-lonase:hover { background: var(--lonase-dark); color: white; transform: translateY(-1px); }
.btn-outline-lonase {
  border: 1.5px solid var(--lonase-primary);
  color: var(--lonase-primary);
  background: transparent;
  border-radius: 8px;
  font-weight: 500;
}
.btn-outline-lonase:hover { background: var(--lonase-primary); color: white; }

/* ============ SOFT COLORS ============ */
.bg-lonase-soft { background: var(--lonase-soft) !important; }
.bg-primary-soft { background: rgba(13, 110, 253, 0.08) !important; }
.bg-success-soft { background: rgba(25, 135, 84, 0.08) !important; }
.bg-danger-soft { background: rgba(220, 53, 69, 0.08) !important; }
.bg-warning-soft { background: rgba(255, 193, 7, 0.1) !important; }
.bg-info-soft { background: rgba(13, 202, 240, 0.08) !important; }

/* ============ AVATARS ============ */
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--lonase-soft);
  color: var(--lonase-primary);
  flex-shrink: 0;
}

.avatar-md {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: var(--lonase-soft);
  color: var(--lonase-primary);
  flex-shrink: 0;
}

/* ============ PAGE TITLE ============ */
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--lonase-primary);
}

/* ============ TABLE ============ */
.table { font-size: 14px; }
.table-light th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #6c757d; }

/* ============ FORMS ============ */
.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid #dee2e6;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--lonase-primary);
  box-shadow: 0 0 0 0.2rem rgba(27, 79, 114, 0.15);
}
.form-label { font-size: 13px; }

/* ============ BUTTONS ============ */
.btn { border-radius: 8px; font-size: 14px; }
.btn-sm { font-size: 12px; border-radius: 6px; }

/* ============ BADGE ============ */
.badge { font-weight: 500; }

/* ============ MODAL ============ */
.modal-content { border-radius: var(--border-radius) !important; }
.modal-header { border-radius: calc(var(--border-radius) - 1px) calc(var(--border-radius) - 1px) 0 0 !important; }

/* ============ ALERT ============ */
.alert { border-radius: 10px; }

/* ============ LEAFLET MAP ============ */
.leaflet-popup-content-wrapper { border-radius: 10px !important; }

/* ============ LOGIN PAGE ============ */
.login-page { background: #f0f4f8; }

.login-wrapper {
  min-height: 100vh;
  display: flex;
}

.login-left {
  width: 45%;
  background: linear-gradient(135deg, var(--lonase-primary) 0%, #0a2540 100%);
  padding: 60px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.login-left-content { position: relative; z-index: 1; }

.login-right {
  flex: 1;
  padding: 40px;
  background: white;
}

.login-form-wrapper {
  width: 100%;
  max-width: 420px;
}

/* ============ NAVBAR ACTIVE ============ */
.nav-link { border-radius: 8px; }
.nav-tabs .nav-link.active {
  color: var(--lonase-primary) !important;
  border-bottom-color: var(--lonase-primary) !important;
  border-bottom-width: 2px;
  font-weight: 600;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(27,79,114,0.3); border-radius: 3px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  #content-wrapper { margin-left: 0 !important; }
  .login-left { display: none !important; }
  .login-right { width: 100%; }
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeIn 0.3s ease; }

/* Card hover lift */
.pdv-card, .stat-card {
  transition: all 0.25s ease;
}
.pdv-card:hover, .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
}
