:root {
  --font-heading:'Playfair Display', serif;
  --font-body:'Poppins', sans-serif;
  --primary-color:#5b7cff;
  --secondary-color:#a855f7;
  --accent:#1E88E5;
  --dark-navy:#071c33;
  --light-bg:#edebeb;
  --text:#6c757d;
}

body {
  background:var(--light-bg);
  font-family:var(--font-body);
  color:var(--dark-navy);
}

/* SIDEBAR FULL HEIGHT FLEX */
.sidebar{
  background:#bbbbbd;
  height:100vh;
  position:fixed;
  left:0;
  top:0;
  width:240px;
  padding:20px;
  display:flex;
  flex-direction:column;
}

/* INNER FLEX */
.sidebar-inner{
  display:flex;
  flex-direction:column;
  height:100%;
}

/* MENU TAKE SPACE */
.menu{
  list-style:none;
  padding:0;
  margin-top:30px;
  flex:1; /* 🔥 push logout down */
}

/* LOGOUT AT BOTTOM */
.menu .logout{
  margin-top:auto; /* 🔥 magic line */
}

.sidebar-logo {
  margin-left: 10px;
  width: 160px;
}
body.dark-mode .sidebar-logo{
  filter: invert(1);
}

.offcanvas-logo {
  margin-top: 60px;
  margin-left: 15px;
  width: 150px;
}
body.dark-mode .offcanvas-logo{
  filter: invert(1);
}

.logo h3 {
  color: var(--secondary-color);
  margin: 0;
}

.logo span {
  font-size: 12px;
  color: #aaa;
  letter-spacing: 1px;
}


.menu li {
  padding: 12px 15px;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  color: #000;
  transition: 0.3s;
}

.menu li i {
  margin-right: 10px;
}

.menu li.active,
.menu li:hover {
  background: var(--light-bg);
  color: #000;
}


/* CONTENT */
.content {
  padding: 30px 10px 30px 10px;
  scroll-behavior:smooth;
}
.content::-webkit-scrollbar{
  width:6px;
}
.content::-webkit-scrollbar-thumb{
  background:#cbd5e1;
  border-radius:10px;
}


.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.menu a {
  text-decoration: none;
  color: inherit;
}

/* BUTTONS */
.btn-outline {
  border: 2px solid #D4AF37;
  color: #000;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: #FFF;

}

/* MOBILE TOPBAR */
.mobile-topbar {
  position: fixed !important;
  top: 0;
  z-index: 2000;
  left: 0;
  width: 100%;
  height: 60px;
  background: #bbbbbd;
  padding: 10px 15px;
  color: #000;
  display: flex;
}
body.dark-mode .mobile-topbar {
  color: #FFF;
}
.topbar{
  background:#fff;
  padding:16px 22px;
  border-radius:14px;
  box-shadow:0 8px 25px rgba(0,0,0,0.05);
  margin-bottom:25px;
}
/* give space below fixed topbar */
@media (max-width:991.98px) {
  .content {
    margin-top: 50px;
  }
}



.menu-btn {
  background: none;
  border: none;
  color: #000;
  font-size: 22px;
}
body.dark-mode .menu-btn{
  color: #FFF;
}

/* OFFCANVAS */
.mobile-sidebar {
  width: 270px;
}

/* Make offcanvas full height */
.offcanvas.mobile-sidebar {
  height: 100vh;
}

/* Sidebar flex layout */
.sidebar-inner {
  height: 100%;
}

/* Menu scroll if needed */
.menu {
  overflow-y: auto;
  padding-right: 5px;
}

/* Logout fixed bottom */
.logout-box {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Optional: nicer scroll */
.menu::-webkit-scrollbar {
  width: 4px;
}

.menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* Logout container */
.logout-box {
  background:#25060a ;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

/* Logout button */
.logout-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--secondary-color);
  font-size: 16px;
  padding: 12px 15px;
  text-align: left;
  cursor: pointer;
  color: var(--secondary-color);
}

.logout-btn i {
  margin-right: 10px;
  color: var(--secondary-color);
}

.logout-btn:hover {
  border-radius: 10px;
  background: var(--light-bg);
}

.offcanvas {
  z-index: 1050;
}

.offcanvas-backdrop {
  z-index: 1040;
}


/* FORCE offcanvas width on mobile & tablet */
@media (max-width: 991.98px) {
  .offcanvas.mobile-sidebar {
    --bs-offcanvas-width: 240px;
    /* 👈 THIS IS THE KEY */
    width: 240px;
  }
}
/* mobile content spacing */
@media (max-width:480px){

  .content{
    padding:20px 14px !important;
  }

  }

/* DESKTOP PERFECT WIDTH FIX */
@media (min-width: 992px) {

  .sidebar{
    position:fixed;
    left:0;
    top:0;
    width:240px;
    height:100vh;
  }

  .content{
    margin-left:240px;
    width:calc(100% - 240px); /* 🔥 KEY FIX */
    max-width:calc(100% - 240px);
    overflow-x:hidden;
    height:100vh;
    overflow-y:auto;
  }

}


html,
body {
  overflow-x: hidden !important;
  width: 100%;
}

/* Bootstrap row fix */
.row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Container fix */
.container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow-x: hidden;
}


/* Prevent cards/table causing scroll */
.dash-box {
  max-width: 100%;
  overflow-x: hidden;
}
/* DASHBOARD CARDS */
.dash-card{
  background:#fff;
  max-width: 100%;
  overflow-x: hidden;
  padding:22px;
  border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,0.05);
  transition:.3s;
  height:100%;
}

.dash-card:hover{
  transform:translateY(-6px);
  box-shadow:0 20px 50px rgba(0,0,0,0.12);
}

/*now add*/
/* ===== PERFECT CONTENT FIT FIX ===== */

/* Remove double scroll */
html, body{
  height:100%;
  overflow:hidden;
}

/* Desktop layout */
@media (min-width:992px){

  body{
    display:flex;
  }

  .content{
    height:100vh;
    overflow-y:auto;
    overflow-x:hidden;
    padding:30px;
  }

}

/* Mobile layout */
@media (max-width:991px){

  html,body{
    overflow:hidden;
  }

  .content{
    height:calc(100vh - 60px); /* minus mobile topbar */
    overflow-y:auto;
    overflow-x:hidden;
    padding:20px 15px;
  }

}

.dash-card h3{
  font-size:28px;
  color:#0B2D4F;
}

.table th{
  font-weight:600;
  color:#0B2D4F;
}


.table thead{
  background:#f1f5f9;
}


.form-control,
.form-select{
  border-radius:10px;
  padding:10px;
}

.form-label{
  font-weight:600;
  font-size:14px;
  margin-bottom:6px;
}

textarea.form-control{
  resize:none;
}

.badge{
  padding:6px 10px;
  font-weight:500;
}
.client-img{
  width:38px;
  height:38px;
  border-radius:50%;
  object-fit:cover;
}

.table thead th{
  font-size:14px;
  color:#6c757d;
  font-weight:600;
}

.table td{
  font-weight:500;
  font-size:14px;
}

/* Prevent select from shrinking too much */
.table select.form-select-sm {
  min-width: 130px;
  white-space: nowrap;
}

/* Prevent table cells from breaking text */
.table td,
.table th {
  white-space: nowrap;
}
/*=======================================================
                  Dashboard Style END
==========================================================*/

/* =========================================
   DARK MODE
========================================= */

body.dark-mode{
  --light-bg:#0f172a;
  --dark-navy:#f1f5f9;
  --text:#94a3b8;
}

/* BODY */
body.dark-mode{
  background:#0f172a;
  color:#e5e7eb;
}

/* SIDEBAR */
body.dark-mode .sidebar{
  background:#020617;
}

body.dark-mode .menu li{
  color:#e5e7eb;
}

body.dark-mode .menu li.active,
body.dark-mode .menu li:hover{
  background:#1e293b;
  color:#fff;
}

/* CARDS */
body.dark-mode .dash-card{
  background:#111827;
  color:#e5e7eb;
  box-shadow:0 10px 30px rgba(0,0,0,0.4);
}

/* TABLE */
body.dark-mode .table{
  color:#e5e7eb;
}

body.dark-mode .table thead{
  background:#1f2937;
}

/* TOPBAR */
body.dark-mode .topbar{
  background:#111827;
  color:#e5e7eb;
}

/* MOBILE TOPBAR */
body.dark-mode .mobile-topbar{
  background:#020617;
}

/* BUTTON */
body.dark-mode .btn-outline{
  border-color:#D4AF37;
  color:#D4AF37;
}

body.dark-mode .btn-outline:hover{
  background:#D4AF37;
  color:#000;
}
/* ==================================
   DARK MODE TEXT VISIBILITY FIX
================================== */

body.dark-mode{
  background:#0f172a;
  color:#e5e7eb;
}

/* headings */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5{
  color:#f8fafc;
}

/* paragraph + muted text */
body.dark-mode p,
body.dark-mode .text-muted{
  color:#94a3b8 !important;
}

/* card titles */
body.dark-mode .dash-card h3{
  color:#f8fafc;
}

/* numbers inside cards */
body.dark-mode .dash-card{
  color:#e2e8f0;
}

/* table text */
body.dark-mode .table{
  color:#e2e8f0;
}

body.dark-mode .table thead{
  background:#1e293b;
}

body.dark-mode .table thead th{
  color:#cbd5f5;
}

/* badge text fix */
body.dark-mode .badge{
  color:#fff;
}

/* sidebar logo area */
body.dark-mode .sidebar{
  background:#020617;
}

/* ==================================
   DARK MODE TABLE FIX
================================== */

body.dark-mode .dash-card{
  background:#111827;
}

body.dark-mode .table{
  background:transparent !important;
  color:#e5e7eb;
}

body.dark-mode .table thead{
  background:#1e293b !important;
}

body.dark-mode .table thead th{
  color:#cbd5f5 !important;
  border-color:#374151;
}

body.dark-mode .table tbody tr{
  background:#111827 !important;
}

body.dark-mode .table tbody td{
  color:#e5e7eb !important;
  border-color:#374151;
}

/* row hover */
body.dark-mode .table tbody tr:hover{
  background:#1f2937 !important;
}
body.dark-mode .dash-card{
  border:1px solid #1f2937;
}
/* =====================================
   FINAL DARK MODE TABLE FIX
===================================== */

body.dark-mode .table{
  background:transparent;
  color:#e5e7eb;
}

body.dark-mode .table > :not(caption) > * > *{
  background:transparent !important;
  color:#e5e7eb !important;
  border-color:#374151 !important;
}

body.dark-mode .table thead th{
  color:#cbd5f5 !important;
}

body.dark-mode .table tbody tr{
  background:#111827 !important;
}

body.dark-mode .table tbody tr:hover{
  background:#1f2937 !important;
}
body.dark-mode .table{
  border-radius:10px;
  overflow:hidden;
}
body.dark-mode .dash-card{
  background:rgba(17,24,39,0.7);
  backdrop-filter:blur(10px);
  border:1px solid #1f2937;
}