:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --sidebar: #0b1220;
  --sidebar-2: #111827;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

body,
h1, h2, h3, h4, h5,
select, input, textarea, option,
#tokenfield, .tokenfield, .form-control {
  font-family: "BPG Glaho", sans-serif;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
iframe,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

.bootstrap-select {
  width: 100% !important;
}

.tokenfield,
.tokenfield .token-input {
  max-width: 100%;
}

.box-body,
.panel-body,
.content,
.form-group,
.row {
  max-width: 100%;
}

.login-page.loginBg {
  background:
    radial-gradient(900px 500px at 12% 18%, rgba(37, 99, 235, 0.35), transparent 55%),
    linear-gradient(160deg, #070c18, #0f172a 55%, #111827);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 920px;
  border-radius: 24px;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45));
}

.login-shell-sm {
  max-width: 460px;
}

.login-card {
  display: flex;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, #1d4ed8, #0b1220);
  min-height: 460px;
}

.login-card-single {
  display: block;
  min-height: 0;
  background: #fff;
}

.login-aside {
  width: 42%;
  padding: 42px 36px;
  background: linear-gradient(180deg, #1d4ed8, #0b1220);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.login-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

.login-aside h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.login-aside p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.55;
}

.login-page .login-box {
  width: 58%;
  margin: 0;
  background: #fff;
}

.login-box-body {
  padding: 42px 40px;
  box-shadow: none;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.login-box-msg {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  text-align: left;
}

.login-box-sub {
  color: var(--muted);
  margin-bottom: 28px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.login-input {
  position: relative;
}

.login-input i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.login-box .form-control {
  height: 48px;
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: none;
  padding-left: 40px;
}

.login-box .form-control:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-submit,
.login-box .btn-primary {
  height: 48px;
  border-radius: 12px;
  font-weight: 700;
  width: 100%;
  margin-top: 8px;
}

.login-submit i {
  margin-left: 6px;
}

.login-forgot {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--brand);
  font-weight: 600;
}

.login-forgot:hover,
.login-forgot:focus {
  color: var(--brand-dark);
}

.login-card-single .login-box,
.login-card-single .login-box-body {
  width: 100% !important;
}

.login-actions {
  display: flex;
  gap: 10px;
}

.login-actions .btn {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  font-weight: 700;
}

.skin-blue .wrapper,
.skin-blue .content-wrapper,
.skin-blue .main-footer {
  background: var(--bg);
}

.skin-blue .main-header {
  box-shadow: 0 1px 0 var(--line);
}

.skin-blue .main-header .logo,
.skin-blue .main-header .navbar {
  background: var(--surface) !important;
  color: var(--ink) !important;
}

.skin-blue .main-header .logo {
  border-right: 1px solid var(--line);
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 16px;
}

.skin-blue .main-header .logo .logo-lg,
.skin-blue .main-header .logo .logo-mini {
  color: var(--ink) !important;
}

.skin-blue .main-header .logo:hover {
  background: #f8fafc !important;
}

.skin-blue .main-header .navbar .sidebar-toggle,
.skin-blue .main-header .navbar .nav > li > a {
  color: #334155 !important;
}

.skin-blue .main-header .navbar .sidebar-toggle:hover,
.skin-blue .main-header .navbar .nav > li > a:hover,
.skin-blue .main-header .navbar .nav > li > a:focus {
  background: #f1f5f9;
  color: var(--ink);
}

.skin-blue .main-sidebar,
.skin-blue .left-side {
  background: var(--sidebar);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.06);
}

.skin-blue .sidebar-menu > li.header {
  color: #94a3b8;
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 18px 8px;
}

.skin-blue .sidebar-menu > li > a {
  color: #cbd5e1;
  border-radius: 10px;
  margin: 3px 10px;
  padding: 10px 12px;
}

.skin-blue .sidebar-menu > li:hover > a,
.skin-blue .sidebar-menu > li.active > a {
  background: #1e293b;
  color: #fff;
  border-left: 0;
}

.skin-blue .sidebar-menu > li > a > .fa {
  width: 22px;
  color: #93c5fd;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 10px;
  color: #e2e8f0;
}

.avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.avatar-initials.lg {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.sidebar-user strong {
  display: block;
  font-size: 13px;
}

.sidebar-user small {
  color: #94a3b8;
}

.sms-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #122033;
  color: #93c5fd;
  font-size: 12px;
}

@media (min-width: 768px) {
  .sidebar-mini.sidebar-collapse .sidebar-user > div,
  .sidebar-mini.sidebar-collapse .sms-chip {
    display: none !important;
  }

  .sidebar-mini.sidebar-collapse .sidebar-user {
    justify-content: center;
    padding: 14px 0 8px;
    overflow: hidden;
  }

  .sidebar-mini.sidebar-collapse .sidebar-user .avatar-initials {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a {
    margin: 2px 4px;
    padding: 12px 0;
    text-align: center;
    border-radius: 8px;
  }

  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > .fa {
    width: auto;
    margin: 0;
    float: none;
  }

  .sidebar-mini.sidebar-collapse .main-header .logo {
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-mini.sidebar-collapse .main-header .logo > .logo-mini {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0;
  }
}

.content-wrapper {
  min-height: calc(100vh - 50px);
}

.content-header {
  padding: 22px 20px 8px;
}

.content-header h1,
.content-header > h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.content {
  padding: 12px 20px 28px;
}

.box {
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}

.box.box-primary {
  border-top-color: var(--line);
}

.btn {
  border-radius: 10px;
  font-weight: 600;
}

.btn-primary,
.btn-primary:focus,
.btn-primary:active {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
}

.btn-primary:hover {
  background: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
}

.form-control {
  border-radius: 10px;
  border-color: var(--line);
  box-shadow: none;
  height: 40px;
}

textarea.form-control {
  height: auto;
  min-height: 96px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.bootstrap-select > .dropdown-toggle,
.bootstrap-select > .dropdown-toggle:hover,
.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select > .dropdown-toggle:active {
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  height: 40px;
  box-shadow: none !important;
  color: var(--ink) !important;
}

.tokenfield {
  border-radius: 10px;
  border: 1px solid var(--line);
  min-height: 40px;
  box-shadow: none;
  padding-top: 4px;
}

.table > thead > tr > th,
table.dataTable thead th,
table.dataTable thead td {
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid var(--line) !important;
  font-weight: 600;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.table > tbody > tr > td {
  vertical-align: middle;
}

.table-hover > tbody > tr:hover {
  background: #f8fafc;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
}

.dt-buttons .btn,
.dt-buttons .dt-button {
  border-radius: 10px !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  color: #334155 !important;
  margin-left: 6px;
}

.dt-export-row {
  margin-bottom: 8px;
}

.dt-export-row .dt-buttons {
  float: none !important;
}

.main-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  min-height: 148px;
  position: relative;
  overflow: hidden;
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  margin-bottom: 14px;
}

.stat-card h3 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.stat-card p {
  margin: 4px 0 12px;
  color: var(--muted);
}

.stat-card a {
  color: var(--brand);
  font-weight: 600;
}

.stat-card.blue .stat-icon { background: #2563eb; }
.stat-card.green .stat-icon { background: #059669; }
.stat-card.amber .stat-icon { background: #d97706; }
.stat-card.rose .stat-icon { background: #dc2626; }

.quick-card {
  display: flex;
  align-items: center;
  min-height: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.quick-card:hover {
  border-color: #bfdbfe;
  text-decoration: none;
  color: var(--ink);
}

.quick-card i {
  color: var(--brand);
  margin-right: 8px;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.panel-card h4 {
  margin: 0 0 12px;
  font-weight: 700;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: #334155;
}

.info-row span {
  color: var(--muted);
  flex: 0 1 auto;
}

.info-row strong {
  text-align: right;
  white-space: nowrap;
}

.info-row:last-child {
  border-bottom: 0;
}

.navbar-nav > .user-menu > a {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table td {
  overflow-wrap: break-word;
  word-break: normal;
}

.box-header:has(.box-tools:empty):not(:has(h3)):not(:has(.box-title)):not(:has(.btn)) {
  display: none;
}

.table td.text-center,
.table td .btn {
  white-space: nowrap;
}

.table td .btn {
  display: inline-block;
  margin: 2px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.photo-grid a {
  display: block;
}

.photo-grid img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.navbar-nav > .user-menu .dropdown-menu {
  border-radius: 14px;
  overflow: hidden;
  border: 0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.navbar-nav > .user-menu .dropdown-menu > .user-footer {
  background: #f8fafc;
}

.skin-blue .user-header {
  background: #0b1220 !important;
}

.user-header .avatar-initials {
  margin: 10px auto;
}

.login-page:not(.loginBg) .login-box {
  width: 100%;
  max-width: 420px;
  margin: 7% auto;
  padding: 0 16px;
}

@media (max-width: 1199px) {
  .content-header,
  .content {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 991px) {
  .login-card {
    display: block;
    min-height: 0;
    background: #fff;
  }

  .login-shell {
    border-radius: 24px;
  }

  .login-aside,
  .login-page.loginBg .login-box {
    width: 100%;
  }

  .login-aside {
    min-height: 160px;
    padding: 24px;
  }

  .login-box-body {
    padding: 28px 22px;
  }

  .page-hero {
    display: block;
  }

  .stat-card {
    min-height: 0;
  }
}

@media (max-width: 767px) {
  .login-page.loginBg {
    align-items: flex-start;
    padding: 12px;
  }

  .login-card {
    border-radius: 18px;
  }

  .login-aside {
    min-height: 0;
    padding: 20px;
  }

  .login-aside h1 {
    font-size: 22px;
  }

  .login-box-msg {
    font-size: 22px;
  }

  .login-box-body {
    padding: 22px 18px 26px;
  }

  .skin-blue .main-header .logo {
    border-right: 0;
  }

  .content-header {
    padding: 16px 12px 4px;
  }

  .content-header h1,
  .content-header > h1 {
    font-size: 20px;
    line-height: 1.3;
  }

  .content {
    padding: 8px 12px 24px;
  }

  .panel-card,
  .stat-card,
  .quick-card {
    padding: 14px;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .info-row strong {
    text-align: left;
    white-space: normal;
  }

  .login-actions {
    flex-direction: column;
  }

  .text-right {
    text-align: left !important;
  }

  .text-right .btn,
  .form-group .btn {
    margin: 0 6px 8px 0;
  }

  .box-body {
    padding: 12px;
  }

  .box-header {
    padding: 12px;
  }

  .main-footer {
    padding: 12px;
    text-align: left;
    margin-left: 0 !important;
  }

  .main-footer .pull-right {
    float: none !important;
    display: block;
    margin-top: 6px;
  }

  input.form-control,
  select.form-control,
  textarea.form-control,
  .bootstrap-select .filter-option,
  .bootstrap-select .dropdown-toggle {
    font-size: 16px !important;
  }

  .dataTables_wrapper .row {
    margin-left: 0;
    margin-right: 0;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate,
  .dataTables_wrapper .dt-buttons {
    float: none !important;
    display: block;
    width: 100%;
    text-align: left !important;
    margin: 0 0 10px;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    margin-left: 0 !important;
    display: block;
  }

  .dataTables_wrapper .dataTables_length select {
    display: inline-block;
    width: auto;
    min-width: 80px;
  }

  .dt-buttons .btn,
  .dt-buttons .dt-button {
    margin: 0 6px 8px 0 !important;
  }

  .dataTables_paginate .pagination {
    display: flex;
    flex-wrap: wrap;
  }

  .navbar-custom-menu > .navbar-nav > li > .dropdown-menu {
    right: 8px;
    left: auto;
    width: min(280px, calc(100vw - 16px));
  }

  .user-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .user-footer .pull-left,
  .user-footer .pull-right {
    float: none !important;
  }

  .sidebar-user {
    padding-right: 12px;
  }

  body.sidebar-open .content-wrapper::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 810;
  }

  .content-wrapper,
  .right-side {
    margin-left: 0 !important;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .login-aside p {
    font-size: 13px;
  }

  .stat-card h3 {
    font-size: 24px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .photo-grid img {
    height: 110px;
  }

  .btn-sm {
    padding: 5px 8px;
  }
}
