/* Modern look for dashboard & inner pages. Scoped to .main-content so the sidebar menu is untouched. */
.main-content {
  --brand: #082b58;
  --brand-2: #0d3f80;
  --accent: #ff9800;
  --accent-2: #e68900;
  --surface: #ffffff;
  --bg: #f3f6fb;
  --text: #1c2a3d;
  --muted: #6b7a90;
  --line: #e4eaf3;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(8, 43, 88, 0.07);
  --shadow-hover: 0 10px 28px rgba(8, 43, 88, 0.14);
  color: var(--text);
}

/* Cards */
.main-content .card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease, transform .2s ease;
}
.main-content .card .card-header {
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius) var(--radius) 0 0;
}
.main-content .card .card-header h4,
.main-content .card h4 {
  color: var(--brand);
  font-weight: 700;
}
.main-content .card .card-header h4::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  margin-inline-end: 8px;
  vertical-align: -2px;
  border-radius: 2px;
  background: var(--accent);
}
.main-content .card-statistic-1 .card-header h4::before { display: none; }

/* Dashboard statistic cards */
.main-content a:hover { text-decoration: none; }
.main-content .card-statistic-1,
.main-content .card-statistic-2 {
  overflow: hidden;
  border-top: 0;
  position: relative;
}
.main-content .card-statistic-1::after,
.main-content .card-statistic-2::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: .85;
}
.main-content a:hover > .card-statistic-1,
.main-content a:hover > .card-statistic-2 {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.main-content .card-statistic-1 .card-icon {
  border-radius: 12px;
  margin: 18px;
  width: 58px;
  height: 58px;
  line-height: 58px;
  box-shadow: 0 6px 14px rgba(8, 43, 88, .18);
}
.main-content .card-statistic-1 .card-icon.bg-primary,
.main-content .card-statistic-1 .card-icon.bg-info,
.main-content .card-statistic-1 .card-icon.bg-dark,
.main-content .card-statistic-1 .card-icon.bg-secondary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important;
}
.main-content .card-statistic-1 .card-icon.bg-warning,
.main-content .card-statistic-1 .card-icon.bg-danger,
.main-content .card-statistic-1 .card-icon.bg-success {
  background: linear-gradient(135deg, var(--accent), #ffb84d) !important;
}
.main-content .card-statistic-1 .card-icon em,
.main-content .card-statistic-1 .card-icon i { color: #fff; }
.main-content .card-statistic-1 .card-header h4 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.main-content .card-statistic-1 .card-body {
  color: var(--brand);
  font-size: 26px;
  font-weight: 800;
}

/* Section titles */
.main-content .section .section-header h1,
.main-content .section-title {
  color: var(--brand);
  font-weight: 800;
}

/* Buttons */
.main-content .btn {
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: all .18s ease;
}
.btn.btn-primary.form-control,
.btn.btn-info.form-control,
.btn.btn-success.form-control {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
  height: auto;
}
.btn.btn-primary.form-control:hover,
.btn.btn-info.form-control:hover,
.btn.btn-success.form-control:hover {
  background: var(--brand-2) !important;
  border-color: var(--brand-2) !important;
}
.main-content .btn-primary,
.main-content .btn-info,
.main-content .btn-success {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(8, 43, 88, .22);
}
.main-content .btn-primary:hover,
.main-content .btn-primary:focus,
.main-content .btn-info:hover,
.main-content .btn-success:hover {
  background: var(--brand-2) !important;
  border-color: var(--brand-2) !important;
  transform: translateY(-1px);
}
.main-content .btn-warning,
.main-content .btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 152, 0, .3);
}
.main-content .btn-warning:hover {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
  color: #fff;
}
.main-content .btn-outline-primary {
  color: var(--brand);
  border-color: var(--brand);
}
.main-content .btn-outline-primary:hover {
  background: var(--brand);
  color: #fff;
}

/* Forms */
.main-content .form-control,
.main-content .custom-select,
.main-content .select2-container--default .select2-selection--single {
  border: 1px solid #d5deeb;
  border-radius: 10px;
  background: #fbfcfe;
  min-height: 42px;
  transition: border-color .15s, box-shadow .15s;
}
.main-content .form-control:focus,
.main-content .custom-select:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, .18);
}
.main-content .control-label,
.main-content label {
  color: var(--brand);
  font-weight: 600;
}

/* Tables (bootstrap-table) */
.main-content .table {
  color: var(--text);
}
.main-content .table thead th,
.main-content .fixed-table-container thead th {
  background: var(--brand);
  color: #fff;
  border: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.main-content .fixed-table-container thead th .th-inner { color: #fff; }
.main-content .fixed-table-container {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.main-content .table td {
  border-color: var(--line);
  vertical-align: middle;
}
.main-content .table-striped tbody tr:nth-of-type(odd) { background: #f7f9fd; }
.main-content .table-hover tbody tr:hover { background: rgba(255, 152, 0, .08); }

/* Pagination, tabs, badges */
.main-content .page-item.active .page-link {
  background: var(--brand);
  border-color: var(--brand);
}
.main-content .page-link { color: var(--brand); border-radius: 8px; margin: 0 2px; }
.main-content .nav-pills .nav-link.active,
.main-content .nav-pills .show > .nav-link {
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(8, 43, 88, .22);
}
.main-content .nav-tabs .nav-link.active {
  color: var(--brand);
  border-bottom: 3px solid var(--accent);
}
.main-content .badge-primary { background: var(--brand); }
.main-content .badge-warning { background: var(--accent); color: #fff; }

/* Modals */
.modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(8, 43, 88, .25);
}
.modal-header {
  background: var(--brand, #082b58);
  color: #fff;
  border-radius: 16px 16px 0 0;
}
.modal-header .modal-title,
.modal-header .close { color: #fff; opacity: 1; }

/* Links inside content */
.main-content a:not(.btn):not(.page-link):not(.dropdown-item):not(.nav-link) { color: var(--brand); }
.main-content a:not(.btn):not(.page-link):not(.dropdown-item):not(.nav-link):hover { color: var(--accent-2); }

/* Sticky top navigation */
.navbar-bg { position: fixed; z-index: 880; }
.main-navbar { position: fixed; z-index: 890; }
body.sidebar-gone .main-navbar, body.sidebar-mini .main-navbar { z-index: 890; }

/* Navbar height = sidebar logo block height */
:root { --nav-h: 85px; }
.navbar-bg, .main-navbar { height: var(--nav-h) !important; }
.main-navbar { min-height: var(--nav-h); }
.main-content { padding-top: calc(var(--nav-h) + 30px) !important; }

.navbar-bg, .main-navbar, .main-content { transition: height .2s ease, padding-top .2s ease; }

/* ===== Modern sidebar menu (colors + shape only; structure/behaviour untouched) ===== */
body .main-sidebar {
  background: linear-gradient(180deg, #082b58 0%, #061f40 100%);
  box-shadow: 4px 0 24px rgba(8, 43, 88, 0.18);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
body .main-sidebar .sidebar-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body .main-sidebar .sidebar-menu li a {
  color: rgba(255, 255, 255, 0.82);
  transition: background-color .2s ease, color .2s ease, padding .2s ease;
}
body .main-sidebar .sidebar-menu li a em,
body .main-sidebar .sidebar-menu li a i {
  color: rgba(255, 255, 255, 0.6);
  transition: color .2s ease;
}

/* Rounded pill items (expanded sidebar only) */
body:not(.sidebar-mini) .main-sidebar .sidebar-menu > li > a {
  height: 44px;
  margin: 3px 12px;
  width: calc(100% - 24px);
  padding: 0 14px;
  border-radius: 10px;
}
body:not(.sidebar-mini) .main-sidebar .sidebar-menu > li > a:hover {
  padding-inline-start: 18px;
}
body:not(.sidebar-mini) .main-sidebar .sidebar-menu li ul.dropdown-menu li a {
  margin: 1px 12px;
  width: calc(100% - 24px);
  border-radius: 8px;
  padding-left: 52px;
  min-height: 38px;
}

/* Hover */
body .main-sidebar .sidebar-menu li a:hover,
body .main-sidebar .sidebar-menu li ul.dropdown-menu li a:hover,
body .main-sidebar .sidebar-menu > li.active > ul.dropdown-menu > li > a:hover,
body .main-sidebar .sidebar-menu > li.active > ul.dropdown-menu > li > a:focus {
  background-color: rgba(255, 255, 255, 0.09);
  color: #fff;
}
body .main-sidebar .sidebar-menu li a:hover em,
body .main-sidebar .sidebar-menu li a:hover i {
  color: #ff9800;
}

/* Active: parent items with a dropdown get a soft tint + orange edge, plain items get solid orange */
body .main-sidebar .sidebar-menu > li.active {
  background-color: transparent;
  color: #fff;
}
body .main-sidebar .sidebar-menu > li.active > a {
  color: #fff;
  font-weight: 600;
}
body .main-sidebar .sidebar-menu > li.active > a.has-dropdown {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 0 #ff9800;
}
body .main-sidebar .sidebar-menu > li.active > a:not(.has-dropdown) {
  background: linear-gradient(135deg, #ff9800, #ffb347);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.35);
}
body .main-sidebar .sidebar-menu > li.active > a em,
body .main-sidebar .sidebar-menu > li.active > a i {
  color: #ff9800;
}
body .main-sidebar .sidebar-menu > li.active > a:not(.has-dropdown) em,
body .main-sidebar .sidebar-menu > li.active > a:not(.has-dropdown) i {
  color: #fff;
}

/* Submenu */
body .main-sidebar .sidebar-menu > li.active > ul.dropdown-menu,
body .main-sidebar .sidebar-menu li ul.dropdown-menu {
  background-color: transparent;
}
body .main-sidebar .sidebar-menu li ul.dropdown-menu li a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}
body .main-sidebar .sidebar-menu li ul.dropdown-menu li.active > a {
  color: #ff9800;
  font-weight: 600;
  background: rgba(255, 152, 0, 0.12);
}
body .main-sidebar .sidebar-menu li ul.dropdown-menu li.active > a em,
body .main-sidebar .sidebar-menu li ul.dropdown-menu li.active > a i {
  color: #ff9800;
}

/* Collapsed (mini) sidebar flyout submenu */
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu {
  background: #082b58;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(8, 43, 88, 0.35);
}
body.sidebar-mini .main-sidebar .sidebar-menu > li.active > a {
  background: linear-gradient(135deg, #ff9800, #ffb347);
}

/* Thin scrollbar */
body .main-sidebar #sidebar-wrapper::-webkit-scrollbar,
body .main-sidebar::-webkit-scrollbar { width: 6px; }
body .main-sidebar #sidebar-wrapper::-webkit-scrollbar-thumb,
body .main-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 6px; }

/* ===== Mini sidebar fixes ===== */
body.sidebar-mini .main-sidebar,
body.sidebar-mini .main-sidebar #sidebar-wrapper {
  overflow: visible !important;
}
body.sidebar-mini .main-sidebar { z-index: 895; }
body.sidebar-mini .main-sidebar .sidebar-menu > li { position: relative; }
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu {
  left: 100%;
  top: 0;
  margin-left: 6px;
  padding: 6px;
  z-index: 900;
  box-shadow: 0 10px 28px rgba(8, 43, 88, 0.35);
}
body.sidebar-mini .main-sidebar .sidebar-menu li:hover > ul.dropdown-menu { display: block !important; }
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu li a {
  height: 40px;
  min-height: 40px;
  margin: 1px 0;
  width: 100%;
  padding: 0 14px;
  border-radius: 8px;
  background-color: transparent;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu li.active > a {
  background-color: rgba(255, 152, 0, 0.18) !important;
  color: #ff9800;
}
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu .dropdown-title {
  padding: 8px 14px 6px;
  color: #ff9800;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  list-style: none;
}
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu .dropdown-title ~ .dropdown-title { display: none; }
body.sidebar-mini .main-sidebar .sidebar-menu > li > a { margin: 3px 0; width: 100%; padding: 0; border-radius: 10px; }

/* Expanded: the active submenu must stay open even after a mini/expand toggle (JS leaves an inline display:none) */
body:not(.sidebar-mini) .main-sidebar .sidebar-menu li.active > ul.dropdown-menu { display: block !important; }
body:not(.sidebar-mini) .main-sidebar .sidebar-menu .dropdown-title { display: none; }

/* Mini sidebar: submenus hidden unless hovering the parent item (also for the active one) */
body.sidebar-mini .main-sidebar .sidebar-menu li ul.dropdown-menu,
body.sidebar-mini .main-sidebar .sidebar-menu li.active > ul.dropdown-menu,
body.sidebar-mini .main-sidebar .sidebar-menu > li.active > ul.dropdown-menu { display: none !important; }
body.sidebar-mini .main-sidebar .sidebar-menu li:hover > ul.dropdown-menu { display: block !important; }

.main-sidebar .sidebar-brand a { display: block; line-height: 0; }
:root { --nav-h: 76px; }

/* Parent tab stays highlighted when one of its sub items is the current page */
body .main-sidebar .sidebar-menu > li.has-current > a {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #ff9800;
}
body .main-sidebar .sidebar-menu > li.has-current > a em,
body .main-sidebar .sidebar-menu > li.has-current > a i { color: #ff9800; }
body.sidebar-mini .main-sidebar .sidebar-menu > li.has-current > a {
  background: linear-gradient(135deg, #ff9800, #ffb347);
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.35);
}
body.sidebar-mini .main-sidebar .sidebar-menu > li.has-current > a em,
body.sidebar-mini .main-sidebar .sidebar-menu > li.has-current > a i { color: #fff; }

/* ===== Enhancement layer ===== */
body, body.layout-3 { background: #f3f6fb; }
.navbar-bg { background: linear-gradient(120deg, #082b58 0%, #0d3f80 70%, #12509f 100%) !important; box-shadow: 0 6px 24px rgba(8, 43, 88, .18); }
.main-navbar .nav-link, .main-navbar .nav-link i, .main-navbar .nav-link em { color: #fff; }
.main-navbar .nav-link:hover { color: #ffb84d; }

/* Page header */
.main-content .section .section-header {
  background: #fff;
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 22px;
  margin-bottom: 26px;
  min-height: 0;
}
.main-content .section .section-header h1 { font-size: 20px; }
.main-content .section .section-header h1 i, .main-content .section .section-header h1 em { color: var(--accent); margin-inline-end: 8px; }
.main-content .section-header .breadcrumb-item a { color: var(--brand); font-weight: 600; }

/* Cards */
.main-content .card:hover { box-shadow: var(--shadow-hover); }
.main-content .card .card-footer { background: #fafcff; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }

/* Toolbars / search in tables */
.main-content .fixed-table-toolbar .search input, .main-content .fixed-table-toolbar .form-control { border-radius: 10px; }
.main-content .fixed-table-toolbar .btn-secondary, .main-content .fixed-table-toolbar .btn-default {
  background: #fff; color: var(--brand); border: 1px solid var(--line); box-shadow: none;
}
.main-content .fixed-table-toolbar .btn-secondary:hover { background: var(--brand); color: #fff; }
.main-content .fixed-table-pagination .page-list .btn { background: #fff; color: var(--brand); border: 1px solid var(--line); box-shadow: none; }

/* Table action buttons */
.main-content .table .btn-sm, .main-content .table .btn-xs { border-radius: 8px; padding: 4px 9px; box-shadow: none; }
.main-content .table .btn-danger { background: #e5484d; border-color: #e5484d; }
.main-content .table .btn-icon { width: 32px; height: 32px; padding: 0; line-height: 32px; }

/* Badges */
.main-content .badge { border-radius: 20px; padding: 5px 11px; font-weight: 600; letter-spacing: .2px; }
.main-content .badge-success { background: #e6f6ee; color: #16955c; }
.main-content .badge-danger { background: #fdeaea; color: #d23a3f; }
.main-content .badge-info { background: #e7f0fb; color: var(--brand); }
.main-content .badge-secondary { background: #eef1f6; color: var(--muted); }

/* Alerts */
.main-content .alert { border: 0; border-radius: 12px; box-shadow: var(--shadow); }
.main-content .alert-success { background: #e6f6ee; color: #16955c; }
.main-content .alert-danger { background: #fdeaea; color: #d23a3f; }
.main-content .alert-info { background: #e7f0fb; color: var(--brand); }
.main-content .alert-warning { background: #fff3df; color: #b36b00; }

/* Switch / checkboxes / radios */
.main-content .custom-switch-input:checked ~ .custom-switch-indicator { background: var(--accent); }
.main-content .custom-control-input:checked ~ .custom-control-label::before,
.main-content .selectgroup-input:checked + .selectgroup-button { background: var(--brand); border-color: var(--brand); color: #fff; }
.main-content input[type=checkbox], .main-content input[type=radio] { accent-color: var(--brand); }

/* Select2 */
.select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted { background: var(--brand) !important; color: #fff; }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--brand); color: #fff; border: 0; border-radius: 6px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #fff; }
.select2-dropdown { border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-hover); }

/* Dropdowns */
.dropdown-menu { border: 0; border-radius: 12px; box-shadow: 0 12px 32px rgba(8, 43, 88, .18); }
.dropdown-item:hover, .dropdown-item.active { background: rgba(255, 152, 0, .12); color: var(--brand); }

/* Modals footer */
.modal-footer { border-top: 1px solid #e4eaf3; background: #fafcff; border-radius: 0 0 16px 16px; }
.modal-body { background: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c3cee0; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent, #ff9800); }

/* Footer */
.main-footer { background: transparent; border-top: 1px solid #e4eaf3; color: #6b7a90; }

/* Login / auth pages */
body .card-primary { border-top: 3px solid #ff9800; }
.login-brand, .auth-card h4 { color: #082b58; }
