/*
 * GGIP style shell inspired by the provided AdminLTE screenshot.
 * Loaded last so it can tune the existing shared theme without touching page logic.
 */
:root {
  --mesi-sidebar: #20263a;
  --mesi-sidebar-deep: #171d2e;
  --mesi-sidebar-soft: #2a3149;
  --mesi-text: #18243a;
  --mesi-muted: #7b8495;
  --mesi-blue: #007bff;
  --mesi-cyan: #17d5e6;
  --mesi-green: #28a745;
  --mesi-teal: #17a2b8;
  --mesi-bg: #f4f6fa;
  --mesi-line: #e7ebf2;
}

body:not(.login-page) {
  background: var(--mesi-bg);
  color: var(--mesi-text);
  font-family: "Pyidaungsu", "Myanmar Text", "Noto Sans Myanmar", "Segoe UI", Arial, sans-serif;
}

body:not(.login-page) .wrapper,
body:not(.login-page) .content-wrapper {
  background: var(--mesi-bg);
}

.content-wrapper {
  min-height: calc(100vh - 47px) !important;
}

.content-header {
  padding: 24px 16px 10px;
}

.content-header h1 {
  margin: 0;
  color: #27364c;
  font-size: 1.48rem;
  font-weight: 500;
  letter-spacing: 0;
}

.breadcrumb {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.main-header.mesi-topbar {
  min-height: 47px;
  background: #ffffff;
  border-bottom: 0;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
}

.mesi-topbar .nav-link {
  min-height: 47px;
  display: inline-flex;
  align-items: center;
  color: #5d6675;
}

.mesi-topbar .nav-link:hover {
  color: var(--mesi-blue);
}

.mesi-topbar-brand {
  color: var(--mesi-blue) !important;
  font-size: 0.96rem;
  font-weight: 800;
  white-space: nowrap;
}

.mesi-account-link {
  gap: 8px;
  color: #222936 !important;
}

.mesi-account-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  color: #ffffff;
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.35);
}

.mesi-account-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
}

.app-sidebar,
.app-sidebar::before {
  width: 232px;
  background: var(--mesi-sidebar);
  box-shadow: 8px 0 26px rgba(20, 26, 41, 0.16);
}

.app-sidebar .brand-link {
  min-height: 44px;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 12px;
  background: var(--mesi-sidebar-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.app-sidebar .brand-mark {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  overflow: hidden;
  color: inherit;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: none;
}

.app-sidebar .brand-mark::before {
  display: none;
}

.app-sidebar .brand-mark-inner {
  position: static;
  width: 29px;
  height: 29px;
  color: inherit;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.app-sidebar .brand-mark-inner img {
  width: 29px !important;
  height: 29px !important;
  max-width: 29px !important;
  max-height: 29px !important;
  object-fit: contain;
}

.app-sidebar .brand-copy {
  min-width: 0;
  text-align: left;
}

.app-sidebar .brand-text {
  color: #ffffff;
  font-size: 1.22rem;
  font-weight: 900 !important;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.app-sidebar .sidebar {
  padding: 10px 7px 16px;
}

.mesi-user-panel {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 62px;
  margin: 0 3px 12px;
  padding: 10px 12px;
  background: var(--mesi-sidebar-soft);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.mesi-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.mesi-user-avatar img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.mesi-user-meta {
  min-width: 0;
}

.mesi-user-meta strong,
.mesi-user-meta span {
  display: block;
}

.mesi-user-meta strong {
  color: #dce4f2;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.mesi-user-meta span {
  margin-top: 2px;
  color: #8893a8;
  font-size: 0.72rem;
}

.mesi-user-meta i {
  color: #28c765;
  font-size: 0.48rem;
}

.app-sidebar .nav-header {
  margin: 12px 2px 5px;
  padding: 0;
  color: rgba(225, 232, 244, 0.45);
  font-size: 0.65rem;
  font-weight: 800;
}

.app-sidebar .nav-sidebar > .nav-item {
  margin-bottom: 2px;
}

.app-sidebar .nav-sidebar .nav-link {
  min-height: 36px;
  padding: 7px 10px;
  color: #b8c1d3;
  background: transparent;
  border-radius: 8px;
  box-shadow: none;
}

.app-sidebar .nav-sidebar .nav-link p {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: normal;
}

.app-sidebar .nav-sidebar > .nav-item > .nav-link .nav-icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  margin: 0 8px 0 0;
  color: #9ba7bc;
  background: transparent;
  border-radius: 0;
  font-size: 0.9rem;
}

.app-sidebar .nav-sidebar .nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.app-sidebar .nav-sidebar > .nav-item.menu-open > .nav-link,
.app-sidebar .nav-sidebar > .nav-item > .nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #45a9f4 0%, var(--mesi-cyan) 100%);
  box-shadow: 0 6px 14px rgba(15, 181, 226, 0.2);
}

.app-sidebar .nav-sidebar > .nav-item.menu-open > .nav-link .nav-icon,
.app-sidebar .nav-sidebar > .nav-item > .nav-link.active .nav-icon {
  color: #ffffff;
  background: transparent;
}

.app-sidebar .nav-sidebar .nav-link > p > .right {
  color: rgba(255, 255, 255, 0.58);
}

.app-sidebar .nav-treeview {
  margin: 3px 0 5px 14px;
  padding: 2px 0 2px 8px !important;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.app-sidebar .nav-treeview > .nav-item > .nav-link {
  min-height: 30px;
  padding: 5px 8px;
  color: #aab4c7;
  border-radius: 7px;
}

.app-sidebar .nav-treeview > .nav-item > .nav-link .nav-icon {
  width: 14px;
  min-width: 14px;
  margin-right: 7px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.48rem;
}

.app-sidebar .nav-treeview > .nav-item > .nav-link.active,
.app-sidebar .nav-treeview > .nav-item > .nav-link.active:hover {
  color: #ffffff;
  background: rgba(23, 213, 230, 0.18);
  box-shadow: none;
}

.card {
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.09);
}

.card-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--mesi-teal) 0%, var(--mesi-green) 100%);
  border-bottom: 0;
}

.card-header::after {
  display: none;
}

.card-header .card-title,
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4 {
  margin: 0;
  color: #ffffff;
  font-weight: 850;
}

.card-header .card-title {
  font-size: 1.08rem;
}

.card-header .card-tools {
  margin-left: auto;
}

.card-header .btn {
  border-color: rgba(255, 255, 255, 0.35);
}

.card-body {
  padding: 20px 28px 28px;
  background: #ffffff;
}

.table-responsive {
  border-radius: 0;
}

.table {
  color: #17233a;
}

.table thead th {
  color: #536078;
  background: #f8f9fb;
  border-top: 0;
  border-bottom: 1px solid #dbe2ec;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  vertical-align: middle;
}

.table tbody td,
.table tbody th {
  border-top: 1px solid var(--mesi-line);
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: #f8fbff;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: #ffffff;
}

.btn {
  border-radius: 8px;
  font-weight: 750;
  letter-spacing: 0;
}

.btn-sm {
  border-radius: 999px;
  padding: 0.34rem 0.82rem;
}

.btn-primary,
.page-item.active .page-link {
  background-color: var(--mesi-blue);
  border-color: var(--mesi-blue);
}

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

.btn-info,
.btn-secondary {
  background-color: #687381;
  border-color: #687381;
}

.btn-danger {
  background-color: #e9354f;
  border-color: #e9354f;
}

.btn-warning {
  background-color: #ffb703;
  border-color: #ffb703;
}

.btn-default {
  background: #ffffff;
  border-color: #d8dee8;
  color: #5f6879;
}

.btn-default:hover {
  background: #f7f9fc;
  color: #263348;
}

.dataTables_wrapper .dt-buttons .btn {
  min-height: 32px;
  margin-right: 5px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  box-shadow: none;
}

.dataTables_wrapper .buttons-excel {
  background: #28a745 !important;
}

.dataTables_wrapper .buttons-pdf {
  background: #e9354f !important;
}

.dataTables_wrapper .buttons-print,
.dataTables_wrapper .buttons-colvis {
  background: #687381 !important;
}

.dataTables_wrapper .buttons-csv {
  background: #ffb703 !important;
}

.dataTables_filter label {
  color: #111827;
  font-weight: 500;
}

.dataTables_filter input,
.form-control,
.custom-select,
.select2-container--bootstrap4 .select2-selection {
  min-height: 36px;
  border-color: #dfe5ef;
  border-radius: 7px;
}

.dataTables_filter input:focus,
.form-control:focus,
.custom-select:focus,
.select2-container--bootstrap4.select2-container--focus .select2-selection {
  border-color: #89c7ff;
  box-shadow: 0 0 0 0.16rem rgba(0, 123, 255, 0.14);
}

.pagination .page-link {
  color: #5e6879;
  border-color: #dfe5ef;
}

.small-box {
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(31, 41, 55, 0.12);
}

.small-box .inner {
  min-height: 116px;
}

.small-box h3,
.small-box h4 {
  color: #ffffff;
  font-weight: 850;
}

.small-box p {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 650;
}

.small-box.bg-primary {
  background: linear-gradient(135deg, #007bff 0%, #36b4ff 100%) !important;
}

.small-box.bg-success {
  background: linear-gradient(135deg, #28a745 0%, #21c996 100%) !important;
}

.small-box.bg-info {
  background: linear-gradient(135deg, #17a2b8 0%, #17d5e6 100%) !important;
}

.small-box.bg-danger {
  background: linear-gradient(135deg, #e9354f 0%, #ff6b78 100%) !important;
}

.small-box.bg-warning {
  background: linear-gradient(135deg, #ffb703 0%, #ffd35c 100%) !important;
}

.alert {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.08);
}

.dropdown-menu {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(31, 41, 55, 0.16);
}

.modal-content {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(31, 41, 55, 0.18);
}

.modal-header {
  border-bottom-color: var(--mesi-line);
}

.sidebar-collapse .app-sidebar .brand-link {
  justify-content: center;
}

.sidebar-collapse .app-sidebar:not(:hover) .mesi-user-panel {
  display: none;
}

@media (min-width: 768px) {
  body:not(.sidebar-mini-md) .content-wrapper,
  body:not(.sidebar-mini-md) .main-footer,
  body:not(.sidebar-mini-md) .main-header {
    margin-left: 232px;
  }

  body.sidebar-collapse:not(.sidebar-mini-md) .content-wrapper,
  body.sidebar-collapse:not(.sidebar-mini-md) .main-footer,
  body.sidebar-collapse:not(.sidebar-mini-md) .main-header {
    margin-left: 0;
  }

  .layout-fixed .brand-link {
    width: 232px;
  }
}

.sidebar-collapse .app-sidebar,
.sidebar-collapse .app-sidebar::before {
  margin-left: -232px;
}

.sidebar-open .app-sidebar,
.sidebar-open .app-sidebar::before {
  margin-left: 0;
}

@media (max-width: 767.98px) {
  .app-sidebar,
  .app-sidebar::before {
    margin-left: -232px;
  }

  .content-header {
    padding: 18px 12px 8px;
  }

  .card-body {
    padding: 16px;
  }

  .card-header {
    min-height: 58px;
    align-items: flex-start;
    flex-direction: column;
  }

  .card-header .card-tools {
    width: 100%;
    margin-left: 0;
  }
}

@media print {
  .main-header,
  .main-sidebar {
    display: none !important;
  }

  .content-wrapper {
    margin-left: 0 !important;
    background: #ffffff !important;
  }
}
