/* ============================================
   eShop Plus Admin - Complete Layout CSS v1.2
   ============================================ */

/* ========== RESET & BASE ========== */
html {
  overflow-x: hidden;
}
body {
  margin: 0;
  padding: 0;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  color: #344767;
  background: #f8f9fa;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ========== DB WRAPPER - MAIN LAYOUT ========== */
#db-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* ========== SIDEBAR ========== */
.navbar-vertical.navbar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1020;
  transition: transform 0.3s ease, left 0.3s ease;
  overflow: hidden;
}
.nav-scroller {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  padding-bottom: 60px;
}
.nav-scroller::-webkit-scrollbar {
  width: 4px;
}
.nav-scroller::-webkit-scrollbar-thumb {
  background: #adb5bd;
  border-radius: 4px;
}
.nav-scroller::-webkit-scrollbar-track {
  background: transparent;
}

/* Sidebar Header / Logo */
.sidenav-header {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}
.navbar-brand {
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
  text-decoration: none;
}
.navbar-brand-img {
  max-height: 42px;
  max-width: 180px;
  height: auto;
  width: auto;
  object-fit: contain;
}

/* Sidebar Divider */
.horizontal.dark {
  border-color: #e9ecef;
  margin: 0.5rem 1rem;
  opacity: 1;
}

/* Sidebar Navigation */
.navbar-vertical .navbar-nav {
  flex-direction: column;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}
.sidebar-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8899aa;
  padding: 0.75rem 1.5rem 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.sidebar-title i {
  font-size: 1rem;
  color: #adb5bd;
}
.navbar-vertical .nav-item {
  list-style: none;
}
.navbar-vertical .navbar-nav .nav-link {
  padding: 0.6rem 1.5rem;
  font-size: 0.875rem;
  color: #67748e;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
  border-left: 3px solid transparent;
}
.navbar-vertical .navbar-nav .nav-link:hover {
  background-color: #f8f9fa;
  color: #344767;
  border-left-color: #5e72e4;
}
.navbar-vertical .navbar-nav .nav-link.active {
  background: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
  color: #fff;
  border-left-color: #5e72e4;
}
.nav-link-text {
  flex: 1;
}
.navbar-vertical .navbar-nav .nav-link i.fa-angle-down {
  margin-left: auto;
  transition: transform 0.2s ease;
  font-size: 0.7rem;
}

/* Submenu Collapse */
.navbar-vertical .collapse {
  border: none;
}
.navbar-vertical .collapse .nav {
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
}
.navbar-vertical .collapse .nav .nav-item .nav-link {
  padding: 0.4rem 1.5rem 0.4rem 3rem;
  font-size: 0.8rem;
  border-left: none;
  background: transparent !important;
}
.navbar-vertical .collapse .nav .nav-item .nav-link:hover {
  color: #5e72e4 !important;
}
.navbar-vertical .collapse .nav .nav-item .nav-link.active {
  color: #5e72e4 !important;
  font-weight: 600;
}

/* ========== PAGE CONTENT ========== */
#page-content {
  flex: 1;
  min-width: 0;
  margin-left: 260px;
  width: calc(100% - 260px);
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== HEADER / TOP NAV ========== */
.header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1010;
}
.header .navbar {
  padding: 0.5rem 1.5rem;
  min-height: 60px;
  display: flex;
  align-items: center;
}
.header .navbar .container-fluid,
.header .navbar div[id="navbar"] {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0;
}
.header .navbar .navbar-nav {
  display: flex;
  align-items: center;
  flex-direction: row;
  list-style: none;
  padding: 0;
  margin: 0;
}
.header .navbar .nav-item {
  list-style: none;
}
.header .navbar .nav-link {
  color: #67748e;
  text-decoration: none;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header .navbar .nav-link:hover {
  color: #344767;
}

/* Nav Toggle Button */
#nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #67748e;
  border-radius: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
  font-size: 1.25rem;
  margin-right: 0.5rem;
}
#nav-toggle:hover {
  background: #f0f2f5;
  color: #344767;
}

/* Header store dropdown */
.dropdown-store {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header_store_name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #344767;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-sm {
  width: 28px;
  height: 28px;
}

/* Profile dropdown */
#profileDropDown {
  background: transparent;
  border: none;
  padding: 0;
}
#profileDropDown .nav-link {
  gap: 0.5rem;
}

/* Language badge */
.badge.bg-primary {
  background: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
}

/* Notification bell icon */
.bx.bx-bell,
.bx.bx-globe {
  font-size: 1.25rem;
}

/* ========== CONTAINER / CONTENT AREA ========== */
.container-fluid {
  padding: 1.5rem;
  flex: 1;
}

/* ========== FOOTER ========== */
footer.footer,
.footer {
  background: #fff;
  border-top: 1px solid #e9ecef;
  padding: 0.75rem 1.5rem;
  font-size: 0.75rem;
  color: #8899aa;
  text-align: center;
}

/* ========== CARDS ========== */
.card {
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  box-shadow: 0 0 2rem 0 rgba(136,152,170,.15);
  background: #fff;
  margin-bottom: 1.5rem;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem 0.75rem 0 0;
}
.card-body {
  padding: 1.5rem;
}
.card-footer {
  background: transparent;
  border-top: 1px solid #e9ecef;
  padding: 1rem 1.5rem;
}

/* Stats Cards */
.stat-card {
  border-radius: 0.75rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #8899aa;
}

/* ========== TABLES ========== */
.table {
  width: 100%;
  margin-bottom: 0;
  color: #344767;
}
.table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #8899aa;
  border-top: none;
  border-bottom: 1px solid #e9ecef;
  padding: 0.75rem;
}
.table td {
  font-size: 0.875rem;
  vertical-align: middle;
  padding: 0.75rem;
  border-bottom: 1px solid #f0f2f5;
}
.table-striped tbody tr:nth-of-type(odd) {
  background: #fafbfc;
}
.table-hover tbody tr:hover {
  background: #f0f2f5;
}

/* ========== FORM CONTROLS ========== */
.form-control {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #344767;
  transition: border-color 0.15s ease;
}
.form-control:focus {
  border-color: #5e72e4;
  box-shadow: 0 0 0 0.2rem rgba(94,114,228,.25);
  outline: none;
}
.form-select {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
}
.form-select:focus {
  border-color: #5e72e4;
  box-shadow: 0 0 0 0.2rem rgba(94,114,228,.25);
  outline: none;
}
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #344767;
  margin-bottom: 0.35rem;
}

/* ========== BUTTONS ========== */
.btn {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
  color: #fff;
}
.btn-primary:hover {
  background: linear-gradient(87deg, #825ee4 0, #5e72e4 100%);
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08);
}
.btn-secondary {
  background: #8392ab;
  color: #fff;
}
.btn-success {
  background: #2dce89;
  color: #fff;
}
.btn-danger {
  background: #f5365c;
  color: #fff;
}
.btn-warning {
  background: #fb6340;
  color: #fff;
}
.btn-info {
  background: #11cdef;
  color: #fff;
}
.btn-light {
  background: #f8f9fa;
  color: #344767;
  border: 1px solid #e9ecef;
}
.btn-dark {
  background: #344767;
  color: #fff;
}
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* ========== BADGES ========== */
.badge {
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.35em 0.65em;
  border-radius: 0.375rem;
  display: inline-block;
}
.badge.bg-success { background: #2dce89 !important; color: #fff; }
.badge.bg-danger { background: #f5365c !important; color: #fff; }
.badge.bg-warning { background: #fb6340 !important; color: #fff; }
.badge.bg-info { background: #11cdef !important; color: #fff; }
.badge.bg-secondary { background: #8392ab !important; color: #fff; }

/* ========== ALERTS ========== */
.alert {
  border: none;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  padding: 1rem 1.25rem;
}
.alert-primary { background: #eaecfb; color: #4f68d9; }
.alert-success { background: #d5f5e3; color: #1aae6f; }
.alert-danger { background: #fde1e6; color: #d6314d; }
.alert-warning { background: #fee2d5; color: #e85433; }
.alert-info { background: #d0f0fd; color: #0ea5d6; }

/* ========== MODAL ========== */
.modal-content {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 15px 35px rgba(50,50,93,.1), 0 5px 15px rgba(0,0,0,.07);
}
.modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
}
.modal-body {
  padding: 1.5rem;
}
.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  gap: 0.25rem;
  margin: 0;
}
.pagination .page-link {
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #67748e;
  border-radius: 0.5rem;
  margin: 0 2px;
  background: #f8f9fa;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pagination .page-item.active .page-link {
  background: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
  color: #fff;
}
.pagination .page-link:hover {
  background: #e9ecef;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin: 0;
  background: transparent;
  font-size: 0.8rem;
}
.breadcrumb-item a {
  color: #5e72e4;
  text-decoration: none;
}
.breadcrumb-item.active {
  color: #8899aa;
}
.breadcrumb-item::before {
  content: "/";
  color: #adb5bd;
  margin-right: 0.25rem;
}
.breadcrumb-item:first-child::before {
  content: none;
}

/* ========== TABS ========== */
.nav-tabs {
  border-bottom: 1px solid #e9ecef;
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
}
.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1rem;
  color: #67748e;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.nav-tabs .nav-link:hover {
  color: #344767;
  border-bottom-color: #dee2e6;
}
.nav-tabs .nav-link.active {
  color: #5e72e4;
  border-bottom-color: #5e72e4;
}

/* ========== DROPDOWN ========== */
.dropdown-menu {
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  padding: 0.5rem 0;
}
.dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #344767;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.1s;
}
.dropdown-item:hover {
  background: #f8f9fa;
  color: #5e72e4;
}
.dropdown-item i {
  font-size: 1.1rem;
  color: #8899aa;
}

/* ========== MISC ========== */
.main-content {
  flex: 1;
}
.page-info-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #8899aa;
  margin-bottom: 0.25rem;
}
.sub_title {
  font-size: 0.875rem;
  color: #67748e;
  margin-bottom: 0;
}

/* Dropzone */
.dropzone {
  border: 2px dashed #e9ecef;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dropzone:hover {
  border-color: #5e72e4;
  background: #f8f9fa;
}

/* Search in Sidebar */
.menuSearch {
  border: none;
  background: #f8f9fa;
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  width: 100%;
  outline: none;
}
.menuSearch:focus {
  box-shadow: 0 0 0 2px rgba(94,114,228,.25);
}

/* Toast */
.iziToast {
  margin: 0;
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1040;
}
.sidebar-overlay.show {
  display: block;
}

/* ========== RESPONSIVE ========== */

/* Tablet - Sidebar becomes overlay */
@media (max-width: 1199.98px) {
  .navbar-vertical.navbar {
    transform: translateX(-280px);
    left: 0;
  }
  .navbar-vertical.navbar.sidebar-open {
    transform: translateX(0);
  }
  #page-content {
    margin-left: 0;
    width: 100%;
  }
  .sidenav-header {
    position: sticky;
    top: 0;
    z-index: 1;
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  .header .navbar {
    padding: 0.5rem 1rem;
    min-height: 54px;
  }
  .container-fluid {
    padding: 1rem;
  }

  /* Stats cards stack */
  .stat-card {
    padding: 1rem;
  }
  .stat-value {
    font-size: 1.25rem;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* Tables scrollable */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-responsive .table {
    min-width: 600px;
  }

  /* DataTable */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    float: none !important;
    text-align: left !important;
    margin-bottom: 0.5rem;
    width: 100%;
  }
  .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
  }

  /* Card body padding */
  .card-body { padding: 1rem; }
  .card-header { padding: 0.75rem 1rem; }

  /* Buttons */
  .btn-block-mobile {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Modal */
  .modal-dialog:not(.modal-sm) {
    margin: 0.5rem;
  }

  /* Dropzone */
  .dropzone { padding: 1rem; }

  /* Breadcrumb */
  .breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }
  .breadcrumb-item {
    white-space: nowrap;
    font-size: 0.75rem;
  }

  /* Tabs */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .nav-tabs .nav-link {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  /* Page info */
  .page-info-title { font-size: 0.65rem; }
  .sub_title { font-size: 0.8rem; }

  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  .pagination .page-link {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
  }

  /* Toast */
  .iziToast {
    max-width: 95% !important;
    margin: 0 auto !important;
  }

  /* Stat chart */
  .admin_statistic_chart { height: 200px !important; }

  /* Hide desktop elements */
  .d-none-mobile { display: none !important; }

  /* Header mobile */
  .header .navbar .navbar-collapse.show {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1060;
  }
}

/* Small phones */
@media (max-width: 575.98px) {
  .stat-card { padding: 0.75rem; }
  .stat-value { font-size: 1.1rem; }
  .btn { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
  .badge { font-size: 0.65rem; }
  .table td, .table th { font-size: 0.75rem; padding: 0.4rem; }
}
