/*================================================================================
	Item Name: Stack - Responsive Admin Theme
	Author: PIXINVENT
	Author URL: http://www.themeforest.net/user/pixinvent
================================================================================

NOTE:
------
PLACE HERE YOUR OWN SCSS CODES AND IF NEEDED, OVERRIDE THE STYLES FROM THE OTHER STYLESHEETS.
WE WILL RELEASE FUTURE UPDATES SO IN ORDER TO NOT OVERWRITE YOUR STYLES IT'S BETTER LIKE THIS.  */

:root {
  --sidebar-width: 260px;
  --appbar-height: 64px;
  --mobile-nav-height: 64px;
  --color-primary: #2B6CB0;
  --color-primary-dark: #2C5282;
  --color-secondary: #3182CE;
  --color-success: #38A169;
  --color-warning: #ECC94B;
  --color-danger: #E53E3E;
  --color-muted: #EDF2F7;
  --color-text: #2D3748;
  --color-overlay: rgba(0, 0, 0, 0.45);
  --gradient-primary: linear-gradient(135deg, #2B6CB0, #2C5282);
}

html {
  width: 100%;
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background: var(--color-muted);
  font-family: "Inter", "Poppins", "Segoe UI", sans-serif;
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
}

body.sidebar-open {
  overflow: hidden;
}

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

a:hover {
  text-decoration: none;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--color-muted);
  width: 100%;
  overflow-x: hidden;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--gradient-primary);
  color: #ffffff;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.25s ease;
  box-shadow: 0 20px 45px rgba(26, 54, 93, 0.25);
  overflow-x: hidden;
}

.sidebar-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem 1.25rem;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: #ffffff;
}

.sidebar-logo-image {
  height: 40px;
  width: 40px;
}

.sidebar-logo-text {
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.sidebar-close {
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 1.25rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-item {
  border-radius: 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-link.sidebar-toggle {
  width: 100%;
  border: none;
  background: transparent;
  justify-content: space-between;
  padding-right: 0.75rem;
}

.sidebar-link.sidebar-toggle:focus {
  outline: none;
}

.sidebar-link i {
  font-size: 1.1rem;
}

.sidebar-caret {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.sidebar-item.is-active .sidebar-link,
.sidebar-link:hover,
.sidebar-link:focus {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: translateX(2px);
}

.sidebar-item.has-children {
  padding-bottom: 0.35rem;
}

.sidebar-sublist {
  list-style: none;
  padding-left: 0;
  margin: 0.35rem 0 0 2.2rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.65rem;
  color: rgba(255, 255, 255, 0.75);
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-sublink:hover,
.sidebar-sublink:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-item.is-open .sidebar-sublist {
  display: flex;
}

.sidebar-item.is-open .sidebar-toggle {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.sidebar-item.is-open .sidebar-caret {
  transform: rotate(180deg);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  align-self: flex-start;
  margin-top: auto;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
}

.sidebar-logout:hover,
.sidebar-logout:focus {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.3);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 1020;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

body.sidebar-open .sidebar-overlay {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
}

/* Main container */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-muted);
  transition: margin-left 0.25s ease;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

@media (min-width: 992px) {
  .app-main {
    margin-left: var(--sidebar-width);
  }
  .appbar {
    left: var(--sidebar-width);
  }
}

/* Appbar */
.appbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1025;
  height: var(--appbar-height);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  transition: transform 0.25s ease;
}

.appbar.is-animating {
  animation: appbarReveal 0.45s cubic-bezier(0.24, 0.82, 0.25, 1) forwards;
}

@keyframes appbarReveal {
  0% {
    transform: translateY(-28px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.appbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.appbar-menu {
  background: transparent;
  border: 0;
  color: var(--color-primary);
  font-size: 1.4rem;
}

.appbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.appbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.appbar-icon {
  background: var(--color-muted);
  border: none;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  box-shadow: 0 8px 16px rgba(47, 128, 237, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.appbar-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(47, 128, 237, 0.2);
}

.appbar-clock {
  font-size: 0.85rem;
  color: #718096;
  font-weight: 500;
}

.appbar-profile {
  display: flex;
  align-items: center;
}

.appbar-user {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border: none;
  background: transparent;
  padding: 0;
}

.appbar-user:focus {
  outline: none;
}

.appbar-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.appbar-user-name {
  font-weight: 600;
  color: var(--color-text);
}

.appbar-user-role {
  font-size: 0.75rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.appbar-avatar img {
  border-radius: 50%;
  height: 40px;
  width: 40px;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

/* Content */
.app-content {
  flex: 1;
  padding: 1.75rem;
  padding-top: calc(1.75rem + var(--appbar-height));
  padding-bottom: 1.75rem;
  display: flex;
  width: 100%;
  overflow-x: hidden;
}

.content-inner {
  width: 100%;
  max-width: 100vw;
}

.page-shell {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  padding: 1.75rem;
  width: 100%;
  overflow-x: hidden;
}

.page-content {
  width: 100%;
  overflow-x: hidden;
}

.page-header {
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(43, 108, 176, 0.15);
}

.page-header .subtitle {
  color: #4A5568;
  margin-bottom: 0;
}

/* Reusable page cards */
.page-card {
  border-radius: 1rem;
  box-shadow: 0 18px 40px rgba(45, 55, 72, 0.12);
  overflow: hidden;
}

.page-card__header {
  background: var(--gradient-primary);
  color: #fff;
  border-bottom: 0;
  padding: 1.25rem 1.5rem;
}

.page-card__header i {
  font-size: 1.6rem;
}

.page-card__body {
  padding: 1.5rem;
}

/* Quick Actions (FAB) */
.fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.75rem;
  z-index: 1040;
}

.fab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 14px 32px rgba(43, 108, 176, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab-button:focus {
  outline: none;
  box-shadow: 0 0 0 0.15rem rgba(49, 130, 206, 0.35);
}

.fab-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(43, 108, 176, 0.36);
}

.fab-menu {
  position: absolute;
  bottom: 4.25rem;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.fab.is-open .fab-menu {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--mobile-nav-height);
  background: #ffffff;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: none;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 0.5rem;
  z-index: 1030;
  box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.12);
}

.mobile-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #4A5568;
  text-decoration: none;
  font-weight: 600;
}

.mobile-nav__item i {
  font-size: 1.2rem;
}

.mobile-nav__item.is-active {
  color: var(--color-primary);
}

.mobile-nav__item.is-active i {
  color: var(--color-primary);
}

.fab-menu__item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
  font-weight: 600;
  text-decoration: none;
  min-width: 220px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab-menu__item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(43, 108, 176, 0.22);
}

.fab-menu__item i {
  font-size: 1.2rem;
}

.page-card__body--flush {
  padding-top: 0.5rem;
}

.page-card__actions .btn {
  white-space: nowrap;
}

.filter-toolbar {
  background: #F7FAFC;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.4);
  width: 100%;
}

.filter-toolbar label {
  font-weight: 600;
  color: #2D3748;
  margin-bottom: 0.35rem;
}

.filter-toolbar .form-control,
.filter-toolbar .custom-select {
  background: #FFFFFF;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.filter-toolbar .form-control:focus,
.filter-toolbar .custom-select:focus {
  transform: translateY(-1px);
}

/* Cards & tables */
.card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}

.table {
  border-radius: 0.75rem;
  overflow: hidden;
  background: #ffffff;
}

.table thead {
  background: var(--color-primary);
  color: #ffffff;
}

.table thead th {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.table tbody tr {
  transition: background 0.2s ease;
}

.table tbody tr:nth-child(even) {
  background-color: #F7FAFC;
}

.table-hover tbody tr:hover {
  background-color: rgba(49, 130, 206, 0.12);
}

.table-legend {
  font-size: 0.85rem;
  color: #4A5568;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 0 0;
}

.table-footer nav {
  margin-bottom: 0;
}

.apexcharts-canvas,
.apexcharts-svg,
.apexcharts-inner,
.apexcharts-legend {
  max-width: 100% !important;
}

.apexcharts-canvas {
  overflow: hidden;
}

.table-wrapper {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: #ffffff;
  width: 100%;
}

.table-wrapper > .table-responsive {
  margin-bottom: 0;
  width: 100%;
}

.table-wrapper > .table-responsive table {
  margin-bottom: 0;
}

.table-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.htmx-request .table-overlay {
  opacity: 1;
}

.table-overlay.htmx-request {
  opacity: 1;
}

/* Forms */
.form-control,
.custom-select,
.input-group-text,
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  border-radius: 0.75rem;
  border-color: #CBD5E0;
  color: var(--color-text);
  box-shadow: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  color: var(--color-text);
}

.form-control::placeholder {
  color: #A0AEC0;
}

.form-control:focus,
.custom-select:focus,
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--multiple:focus {
  border-color: #3182CE;
  box-shadow: 0 0 0 0.2rem rgba(49, 130, 206, 0.15);
}

/* Buttons */
.btn {
  border-radius: 0.75rem;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 10px 20px rgba(43, 108, 176, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-outline-secondary {
  border-color: #CBD5E0;
  color: var(--color-text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: #E2E8F0;
  color: var(--color-text);
}

.btn-success {
  background: var(--color-success);
  border-color: var(--color-success);
}

.btn-warning {
  background: var(--color-warning);
  border-color: var(--color-warning);
  color: #744210;
}

.btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.65);
  color: #ffffff;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Badges */
.badge {
  border-radius: 0.75rem;
  padding: 0.35rem 0.65rem;
}

.badge-success {
  background: rgba(56, 161, 105, 0.15);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(236, 201, 75, 0.15);
  color: #B7791F;
}

.badge-danger {
  background: rgba(229, 62, 62, 0.15);
  color: var(--color-danger);
}

/* Dashboard quick actions */
.quick-card {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  min-height: 185px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 1rem;
  box-shadow: 0 18px 40px rgba(45, 55, 72, 0.18);
  background: var(--gradient-primary);
}

.quick-card__blur {
  position: absolute;
  right: -25px;
  top: -25px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(10px);
}

.quick-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  gap: 0.75rem;
}


.quick-card__metric {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
}

.quick-card__action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  align-self: flex-start;
  margin-top: auto;
  align-self: flex-start;
}

.quick-card__action:hover,
.quick-card__action:focus {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22);
}

.quick-card__action i {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.quick-card__action:hover i,
.quick-card__action:focus i {
  transform: translateX(4px);
}

.quick-card--primary {
  background: linear-gradient(135deg, #2B6CB0, #3182CE);
}

.quick-card--teal {
  background: linear-gradient(135deg, #319795, #38B2AC);
}

.quick-card--warning {
  background: linear-gradient(135deg, #ED8936, #F6AD55);
}

.quick-card--neutral {
  background: linear-gradient(135deg, #4C51BF, #6B46C1);
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-pill {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 12px 28px rgba(45, 55, 72, 0.12);
  transition: transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.metric-pill:hover {
  transform: translateY(-3px);
}

.metric-pill__label {
  color: #4A5568;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.metric-pill__value {
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.metric-pill__value--secondary { color: var(--color-secondary); }
.metric-pill__value--warning { color: #B7791F; }
.metric-pill__value--danger { color: var(--color-danger); }
.metric-pill__value--success { color: var(--color-success); }

.metric-pill__icon {
  font-size: 1.75rem;
}

.metric-pill__icon--primary { color: var(--color-primary); }
.metric-pill__icon--secondary { color: var(--color-secondary); }
.metric-pill__icon--warning { color: #B7791F; }
.metric-pill__icon--danger { color: var(--color-danger); }
.metric-pill__icon--success { color: var(--color-success); }

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  margin: -0.375rem;
}

.filter-actions > * {
  flex: 1 1 140px;
  margin: 0.375rem;
}

@media (max-width: 767.98px) {
  .filter-actions {
    flex-direction: column;
    margin: 0;
  }

  .filter-actions > * {
    margin: 0 0 0.5rem;
  }

  .filter-actions > *:last-child {
    margin-bottom: 0;
  }

  .filter-toolbar form {
    row-gap: 1rem;
  }

  .table.table-lg th,
  .table.table-lg td {
    padding: 0.9rem 0.6rem;
  }

  .table .btn {
    min-height: 40px;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 767.98px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .quick-card {
    min-height: auto;
  }
}

/* Footer */
.app-footer {
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  text-align: center;
  color: #718096;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

/* Responsive tweaks */
@media (max-width: 991.98px) {
  .appbar {
    padding: 0 1rem;
  }

  .appbar.is-hidden {
    transform: translateY(-100%);
  }

  .mobile-nav {
    display: flex;
  }

  .fab {
    right: 1rem;
    bottom: calc(var(--mobile-nav-height) + 1rem);
  }

  .fab-menu__item {
    min-width: 190px;
    font-size: 0.9rem;
  }

  .appbar-left {
    gap: 0.75rem;
  }

  .appbar-search {
    max-width: none;
  }

  .app-content {
    padding: 1.25rem;
    padding-top: calc(1.25rem + var(--appbar-height));
    padding-bottom: calc(1.25rem + var(--mobile-nav-height));
  }

  .page-shell {
    padding: 1.25rem;
  }

  .filter-toolbar {
    padding: 1rem;
  }

  .app-footer {
    padding-bottom: calc(1rem + var(--mobile-nav-height));
  }
}
