@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700&display=swap");

:root {
  --app-sidebar-width: 220px;
  --app-sidebar-mini-width: 70px;
  --app-header-height: 64px;
  --app-font: "Nunito", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --app-font-weight: 500;
  --app-radius: 10px;
}

html,
body {
  font-family: var(--app-font);
  font-weight: var(--app-font-weight);
  letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.card-title,
.navbar,
.sidebar-nav,
.table,
button,
.btn,
.form-control,
.select2-container {
  font-family: var(--app-font);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 600;
}

body,
p,
label,
td,
.form-control,
.custom-select,
.custom-file-label,
.input-group-text,
.dropdown-item,
.nav-link,
.sidebar-nav a,
.select2-container,
.select2-selection,
.select2-results__option,
.dataTables_wrapper,
.breadcrumb,
.page-titles,
.card-body,
small,
.small,
.btn-link,
form label {
  font-weight: var(--app-font-weight);
}

/* ---------- Scrollbar ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #9aa8b8 #eef2f6;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #eef2f6;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: #9aa8b8;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7b8b9c;
}

/* ---------- Skin / cards ---------- */
body.skin-blue {
  background: #f4f7fb;
}

.skin-blue .topbar {
  background: #0288d1;
  box-shadow: 0 2px 12px rgba(2, 136, 209, 0.18);
}

.page-wrapper {
  background: #f4f7fb;
}

.card {
  border: 0;
  border-radius: var(--app-radius);
  box-shadow: 0 4px 18px rgba(15, 34, 58, 0.06);
}

.card-title {
  font-weight: 700;
}

.btn {
  border-radius: 8px;
  font-weight: 600;
}

.alert {
  border-radius: var(--app-radius);
}

/* ---------- Header / sidebar alignment ---------- */
.fixed-layout .topbar,
.fixed-layout .left-sidebar {
  position: fixed;
}

.fixed-layout .topbar {
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-header-height);
  z-index: 50;
}

.fixed-layout .left-sidebar {
  top: 0;
  left: 0;
  height: 100%;
  width: var(--app-sidebar-width);
  padding-top: var(--app-header-height);
  z-index: 40;
}

.left-sidebar .scroll-sidebar {
  height: calc(100% - var(--app-header-height));
}

.topbar .navbar.top-navbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-height: var(--app-header-height);
  height: var(--app-header-height);
  padding: 0;
}

.topbar .top-navbar .navbar-header {
  display: flex;
  align-items: center;
  height: var(--app-header-height);
  line-height: var(--app-header-height);
  width: var(--app-sidebar-width);
  min-width: var(--app-sidebar-width);
  max-width: var(--app-sidebar-width);
  flex: 0 0 var(--app-sidebar-width);
  padding: 0 12px;
}

.topbar .top-navbar .navbar-header .navbar-brand {
  display: flex;
  align-items: center;
  height: var(--app-header-height);
  padding: 0;
  margin: 0;
  position: relative;
  width: 100%;
}

.topbar .top-navbar .navbar-header .navbar-brand b {
  line-height: 1;
  display: flex;
  align-items: center;
}

.topbar .top-navbar .navbar-header .navbar-brand .light-logo {
  display: inline-block;
}

.app-brand-text {
  display: inline-block;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  margin-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 2px;
}

.topbar .navbar-collapse {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  flex: 1 1 auto;
  flex-basis: auto !important;
  min-width: 0;
  width: auto !important;
  height: var(--app-header-height);
  padding: 0 8px 0 0;
}

.topbar-toggles {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: var(--app-header-height);
  margin: 0;
  padding: 0 2px;
}

.topbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: var(--app-header-height);
  color: #fff;
  padding: 0 !important;
  margin: 0;
  line-height: 1 !important;
  text-decoration: none;
}

.topbar-toggle:hover,
.topbar-toggle:focus {
  color: #fff;
}

.topbar-toggle i,
.topbar-toggle i:before {
  display: block;
  font-size: 20px;
  line-height: 1 !important;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.topbar-toggle-desktop {
  display: flex !important;
}

.topbar-toggle-mobile {
  display: none !important;
}

.topbar .navbar-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: var(--app-header-height);
}

.topbar .navbar-nav.navbar-nav-right {
  margin-left: auto;
  flex: 0 0 auto;
}

.topbar .top-navbar .navbar-nav > .nav-item {
  display: flex;
  align-items: center;
  height: var(--app-header-height);
}

.topbar .top-navbar .navbar-nav > .nav-item > .nav-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: var(--app-header-height);
  line-height: 1;
  padding: 0 14px;
  font-size: 18px;
}

.topbar .top-navbar .profile-pic {
  display: flex;
  align-items: center;
}

.topbar .top-navbar .profile-pic img {
  width: 32px;
  height: 32px;
  object-fit: cover;
}

.topbar .dropdown-menu {
  right: 0;
  left: auto;
}

.fixed-layout .page-wrapper {
  padding-top: var(--app-header-height);
}

@media (min-width: 768px) {
  .page-wrapper,
  .footer {
    margin-left: var(--app-sidebar-width);
  }

  .navbar-header {
    width: var(--app-sidebar-width);
    flex-shrink: 0;
  }
}

@media (min-width: 768px) {
  .mini-sidebar .top-navbar .navbar-header {
    width: var(--app-sidebar-mini-width);
    min-width: var(--app-sidebar-mini-width);
    max-width: var(--app-sidebar-mini-width);
    flex-basis: var(--app-sidebar-mini-width);
    text-align: center;
    padding-left: 0;
    padding-right: 0;
  }

  .mini-sidebar .app-brand-text {
    display: none;
  }

  .mini-sidebar .top-navbar .navbar-header .navbar-brand {
    justify-content: center;
  }

  .mini-sidebar .left-sidebar {
    width: var(--app-sidebar-mini-width);
  }

  .mini-sidebar .page-wrapper,
  .mini-sidebar .footer {
    margin-left: var(--app-sidebar-mini-width);
  }

  .mini-sidebar .scroll-sidebar {
    height: calc(100vh - var(--app-header-height));
  }
}

@media (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
  }

  .topbar .top-navbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }

  .topbar .top-navbar .navbar-header {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
    padding-left: 0;
  }

  .topbar .top-navbar .navbar-header .navbar-brand {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .app-brand-text,
  .navbar-brand span.app-brand-text {
    display: inline-block !important;
    font-size: 14px;
    max-width: 42vw;
  }

  .topbar-toggle-mobile {
    display: flex !important;
  }

  .topbar-toggle-desktop {
    display: none !important;
  }

  .topbar .navbar-collapse {
    width: auto !important;
    flex: 0 0 auto;
    padding: 0;
    margin-left: 0 !important;
  }

  .page-wrapper,
  .footer {
    margin-left: 0;
  }

  .fixed-layout .left-sidebar,
  .fixed-layout.mini-sidebar .left-sidebar {
    left: calc(-1 * var(--app-sidebar-width));
    width: var(--app-sidebar-width);
    transition: left 0.25s ease;
  }

  .fixed-layout.show-sidebar .left-sidebar,
  .fixed-layout.mini-sidebar.show-sidebar .left-sidebar {
    left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 34, 58, 0.4);
    z-index: 35;
  }

  .show-sidebar .sidebar-overlay {
    display: block;
  }

  .show-sidebar {
    overflow: hidden;
  }
}

@media (max-width: 1023px) {
  .topbar .d-flex,
  .topbar .d-flex.justify-content-end,
  .dashboard-modern .d-flex {
    display: flex !important;
  }
}

/* ---------- Sidebar nav icons ---------- */
.sidebar-nav ul li ul li a i {
  margin-right: 8px;
  width: 16px;
  display: inline-block;
  text-align: center;
}

.sidebar-nav #sidebarnav > li > a {
  display: flex;
  align-items: center;
}

.sidebar-nav #sidebarnav > li > a i {
  margin-right: 8px;
}

/* ---------- Tables ---------- */
.table th,
.table td {
  padding: 0.4rem 0.65rem;
  vertical-align: middle;
}

.table thead th {
  padding: 0.5rem 0.65rem;
  font-weight: 700;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-family: var(--app-font);
}

/* ---------- Modal add/edit labels ---------- */
.modal-body table.table tr > td:first-child {
  width: 30%;
  vertical-align: middle;
  font-weight: 600;
}

.modal-body table.table tr > td:nth-child(2) {
  width: 70%;
}

/* ---------- Filter ---------- */
.filter-card .card-title {
  margin-bottom: 1rem;
}

.filter-submit-col {
  display: flex;
  align-items: flex-end;
}

.filter-submit-col .btn[name="s"] {
  min-width: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-submit-col .btn[name="s"] i {
  margin-right: 6px;
}

@media (max-width: 767px) {
  form label:has(+ br + button[name="s"]),
  form label:has(+ br + input[name="s"]) {
    display: none;
  }

  form label:has(+ br + button[name="s"]) + br,
  form label:has(+ br + input[name="s"]) + br {
    display: none;
  }

  form label:has(+ br + button[name="s"]) ~ button[name="s"],
  form label:has(+ br + input[name="s"]) ~ input[name="s"],
  form label:has(+ br + input[name="s"]) ~ button[name="s"] {
    float: right;
  }

  .filter-submit-col {
    justify-content: flex-end;
  }

  .filter-submit-col.col-lg-12 .btn[name="s"] {
    float: right;
    margin-left: auto;
  }
}

.filter-submit-col.col-lg-12 {
  justify-content: flex-end;
}

.filter-submit-col.col-lg-12 .btn[name="s"] {
  float: right;
}

/* ---------- Dashboard ---------- */
.dashboard-modern > h3 {
  font-weight: 700;
  font-size: 16px;
  margin: 2px 0 8px;
}

.dashboard-modern hr {
  margin: 6px 0 12px;
}

.dashboard-modern .card {
  margin-bottom: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-modern .card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 34, 58, 0.08);
}

.dashboard-modern .card .card-body {
  padding: 10px 12px;
}

.dashboard-modern .card .d-flex.flex-row {
  align-items: center;
}

.dashboard-modern .round {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  line-height: 1;
  border-radius: 10px;
  flex-shrink: 0;
}

.dashboard-modern .round i {
  font-size: 15px;
  line-height: 1;
}

.dashboard-modern .card .m-l-10 {
  margin-left: 10px !important;
  min-width: 0;
}

.dashboard-modern .card h4 {
  font-size: 13px;
  line-height: 1.2;
  margin: 0 0 2px !important;
}

.dashboard-modern .card h3 {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0 !important;
}

.dashboard-modern .card p {
  font-size: 12px;
  line-height: 1.25;
  margin: 1px 0 0 !important;
  color: #6c757d;
}

.dashboard-modern .card h5 {
  font-size: 12px;
  line-height: 1.25;
  margin: 2px 0 0 !important;
  font-weight: 500;
}

.dashboard-modern .card h4 u {
  text-decoration: none;
  border-bottom: 1px solid rgba(3, 169, 243, 0.35);
}

/* ---------- Login ---------- */
body.login-body {
  min-height: 100vh;
  background: #eef4fa;
}

body.login-body .preloader {
  background: #eef4fa;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(2, 136, 209, 0.16), transparent 55%),
    radial-gradient(800px 420px at 108% 112%, rgba(2, 136, 209, 0.12), transparent 52%),
    #eef4fa;
}

.login-shell {
  width: 100%;
  max-width: 880px;
  min-height: 500px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 34, 58, 0.12);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
  color: #fff;
  background: linear-gradient(165deg, #039be5 0%, #0277bd 52%, #01579b 100%);
}

.login-brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 20px;
}

.login-brand-title {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.login-brand-copy {
  margin: 12px 0 0;
  max-width: 280px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  line-height: 1.5;
}

.login-panel {
  display: flex;
  align-items: center;
  padding: 40px 36px;
}

.login-card {
  width: 100%;
}

.login-card-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: #17324d;
}

.login-card-subtitle {
  margin: 6px 0 22px;
  color: #6b7c8d;
  font-size: 14px;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #31475c;
}

.login-field {
  position: relative;
}

.login-field > i {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 2;
  color: #7b8b9c;
  font-size: 14px;
  transform: translateY(-50%);
  pointer-events: none;
}

.login-field .form-control {
  height: 46px;
  padding: 10px 42px 10px 40px;
  border: 1px solid #d7e1ea;
  border-radius: 10px;
  box-shadow: none;
  background: #f8fbfe;
}

.login-field .form-control:focus {
  border-color: #0288d1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(2, 136, 209, 0.12);
}

.login-toggle-password {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 42px;
  height: 46px;
  border: 0;
  background: transparent;
  color: #7b8b9c;
  cursor: pointer;
}

.login-toggle-password:hover {
  color: #0288d1;
}

.login-submit {
  height: 46px;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  background: #0288d1;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-submit:hover,
.login-submit:focus {
  background: #0277bd;
}

.login-card .alert {
  margin-bottom: 16px;
  padding: 10px 36px 10px 14px;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
}

@media (max-width: 767px) {
  .login-page {
    padding: 16px 12px;
    align-items: stretch;
  }

  .login-shell {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .login-brand {
    align-items: center;
    padding: 28px 24px 22px;
    text-align: center;
  }

  .login-brand-copy {
    max-width: none;
  }

  .login-panel {
    padding: 24px 20px 28px;
  }
}
