/*
 * Custom Theme — Kemenangan
 * Dual theme: Light & Dark with toggle support
 * Dark theme aktif ketika body memiliki class "dark-theme"
 * Light theme adalah default
 */

/* ═══════════════════════════════════════════════════════════════
   SHARED / BASE
   ═══════════════════════════════════════════════════════════════ */

/* Theme toggle button */
.theme-toggle-btn {
  cursor: pointer;
  padding: 6px 12px;
  font-size: 14px;
  border: none;
  background: transparent;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle-btn i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover i {
  transform: rotate(30deg);
}

/* Smooth theme transition */
body,
body *,
.gray-bg,
.white-bg,
.ibox-title,
.ibox-content,
.ibox-footer,
.navbar-static-top,
.navbar-default,
.footer,
.form-control,
.modal-content,
.table,
.btn-white,
.breadcrumb,
.panel,
.nav > li > a,
.dataTables_wrapper {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
  background: #c0c4cc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a4ac;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME (default — modern & clean)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Page Background ─── */
.gray-bg,
.bg-muted {
  background-color: #eef1f6 !important;
}

body {
  background-color: #eef1f6;
  color: #3a3f51;
}

/* ─── Top Navbar ─── */
.navbar-static-top.white-bg,
.white-bg {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e4e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.navbar-static-top .welcome-message {
  color: #6b7a99 !important;
}

.navbar-top-links > li > a {
  color: #6b7a99 !important;
}

.navbar-top-links > li > a:hover {
  color: #3a3f51 !important;
}

.row.border-bottom {
  border-bottom: 1px solid #e4e8f0 !important;
}

/* ─── Sidebar ─── */
.navbar-default.navbar-static-side {
  background-color: #2c3345 !important;
}

@media (min-width: 768px) {
  .navbar-static-side {
    position: fixed !important;
    height: 100vh !important;
  }
}

.nav-header {
  background-color: #2c3345 !important;
}

.nav > li > a {
  color: #a8b2c7 !important;
}

.nav > li > a:hover,
.nav > li > a:focus {
  background-color: #353d52 !important;
  color: #ffffff !important;
}

.nav > li.active > a {
  background-color: #353d52 !important;
  color: #ffffff !important;
  border-left: 3px solid #4a90d9;
}

.nav-second-level li a {
  color: #8a94ab !important;
  padding-left: 40px !important;
}

.nav-second-level li a:hover {
  color: #ffffff !important;
}

.logo-element {
  background-color: #4a90d9 !important;
  color: #ffffff !important;
}

.profile-element .dropdown-toggle span.block {
  color: #d0d6e2 !important;
}

.nav-header .dropdown-menu {
  background-color: #ffffff;
  border: 1px solid #e4e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.nav-header .dropdown-menu a {
  color: #3a3f51 !important;
}

.nav-header .dropdown-menu a:hover {
  background-color: #f5f7fa !important;
  color: #1a1f2e !important;
}

/* ─── iBox (Card) Panels ─── */
.ibox-title {
  background-color: #ffffff !important;
  border-color: #4a90d9 !important;
  color: #3a3f51 !important;
}

.ibox-title h5 {
  color: #2c3345 !important;
}

.ibox-content {
  background-color: #ffffff !important;
  border-color: #e4e8f0 !important;
  color: #3a3f51 !important;
}

.ibox-footer {
  background-color: #fafbfc !important;
  border-top: 1px solid #e4e8f0 !important;
  color: #6b7a99 !important;
}

.ibox-tools a {
  color: #a0a8be !important;
}

.ibox-tools a:hover {
  color: #4a90d9 !important;
}

/* ─── Footer ─── */
.footer {
  background-color: #ffffff !important;
  border-top: 1px solid #e4e8f0 !important;
  color: #6b7a99 !important;
}

.footer strong {
  color: #3a3f51;
}

/* ─── Tables ─── */
.table {
  color: #3a3f51;
}

.table > thead > tr > th {
  border-bottom: 2px solid #e4e8f0 !important;
  color: #6b7a99;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tfoot > tr > td,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > thead > tr > th {
  border-top: 1px solid #e4e8f0 !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #f8f9fc !important;
}

.table-hover > tbody > tr:hover {
  background-color: #edf1f7 !important;
}

.table-bordered {
  border: 1px solid #e4e8f0 !important;
}

.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
  background-color: #f5f7fa !important;
}

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
  border: 1px solid #e4e8f0 !important;
}

/* ─── Forms ─── */
.form-control {
  background-color: #ffffff !important;
  border: 1px solid #d5dbe5 !important;
  color: #3a3f51 !important;
}

.form-control:focus {
  border-color: #4a90d9 !important;
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 217, 0.15) !important;
}

.form-control::placeholder {
  color: #a0a8be !important;
}

label,
.col-form-label {
  color: #3a3f51 !important;
}

/* ─── Buttons ─── */
.btn-primary {
  background-color: #4a90d9 !important;
  border-color: #4a90d9 !important;
}

.btn-primary:hover {
  background-color: #3a7ec5 !important;
  border-color: #3a7ec5 !important;
}

.btn-white {
  background-color: #ffffff !important;
  border: 1px solid #d5dbe5 !important;
  color: #3a3f51 !important;
}

.btn-white:hover {
  background-color: #f5f7fa !important;
  color: #2c3345 !important;
}

/* ─── Panels ─── */
.panel {
  background-color: #ffffff;
  border-color: #e4e8f0;
}

.panel-default > .panel-heading {
  background-color: #f5f7fa;
  border-color: #e4e8f0;
  color: #3a3f51;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
  background-color: #ffffff !important;
}

/* ─── Modal ─── */
.modal-content {
  background-color: #ffffff !important;
  border: 1px solid #e4e8f0 !important;
  color: #3a3f51 !important;
}

.modal-header {
  border-bottom: 1px solid #e4e8f0 !important;
}

.modal-footer {
  border-top: 1px solid #e4e8f0 !important;
}

/* ─── DataTables ─── */
.dataTables_wrapper {
  color: #3a3f51 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #3a3f51 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f5f7fa !important;
  border-color: #d5dbe5 !important;
  color: #2c3345 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: #4a90d9 !important;
  border-color: #4a90d9 !important;
  color: #ffffff !important;
}

/* ─── Select2 ─── */
.select2-container--default .select2-selection--single {
  background-color: #ffffff !important;
  border-color: #d5dbe5 !important;
  color: #3a3f51 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #3a3f51 !important;
}

.select2-dropdown {
  background-color: #ffffff !important;
  border-color: #d5dbe5 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #4a90d9 !important;
}

.select2-container--default .select2-results__option {
  color: #3a3f51 !important;
}

.select2-search__field {
  background-color: #ffffff !important;
  border: 1px solid #d5dbe5 !important;
  color: #3a3f51 !important;
}

/* ─── Misc Light ─── */
a {
  color: #4a90d9;
}

a:hover {
  color: #3a7ec5;
}

.minimalize-styl-2 {
  color: #ffffff !important;
}

.page-heading {
  border-bottom: 1px solid #e4e8f0 !important;
}

/* Light theme toggle button */
.theme-toggle-btn {
  color: #6b7a99;
}

.theme-toggle-btn:hover {
  color: #3a3f51;
}

/* ═══════════════════════════════════════════════════════════════
   DARK THEME (body.dark-theme)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Page Background ─── */
body.dark-theme,
body.dark-theme .gray-bg,
body.dark-theme .bg-muted {
  background-color: #1a1f2e !important;
  color: #d0d4dc;
}

/* ─── Top Navbar ─── */
body.dark-theme .navbar-static-top.white-bg,
body.dark-theme .white-bg {
  background-color: #212738 !important;
  border-bottom: 1px solid #2d3348 !important;
  box-shadow: none;
}

body.dark-theme .navbar-static-top .welcome-message {
  color: #a0a8be !important;
}

body.dark-theme .navbar-top-links > li > a {
  color: #a0a8be !important;
}

body.dark-theme .navbar-top-links > li > a:hover {
  color: #ffffff !important;
}

body.dark-theme .row.border-bottom {
  border-bottom: 1px solid #2d3348 !important;
}

/* ─── Sidebar ─── */
body.dark-theme .navbar-default.navbar-static-side {
  background-color: #151929 !important;
}

@media (min-width: 768px) {
  body.dark-theme .navbar-static-side {
    position: fixed !important;
    height: 100vh !important;
  }
}

body.dark-theme .nav-header {
  background-color: #151929 !important;
}

body.dark-theme .nav > li > a {
  color: #8e97b0 !important;
}

body.dark-theme .nav > li > a:hover,
body.dark-theme .nav > li > a:focus {
  background-color: #1e2436 !important;
  color: #ffffff !important;
}

body.dark-theme .nav > li.active > a {
  background-color: #1e2436 !important;
  color: #ffffff !important;
  border-left: 3px solid #4a90d9;
}

body.dark-theme .nav-second-level li a {
  color: #7a849c !important;
}

body.dark-theme .nav-second-level li a:hover {
  color: #ffffff !important;
}

body.dark-theme .profile-element .dropdown-toggle span.block {
  color: #c8cdd8 !important;
}

body.dark-theme .nav-header .dropdown-menu {
  background-color: #212738;
  border: 1px solid #2d3348;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.dark-theme .nav-header .dropdown-menu a {
  color: #a0a8be !important;
}

body.dark-theme .nav-header .dropdown-menu a:hover {
  background-color: #1e2436 !important;
  color: #ffffff !important;
}

/* ─── iBox (Card) Panels ─── */
body.dark-theme .ibox-title {
  background-color: #212738 !important;
  border-color: #4a90d9 !important;
  color: #d0d4dc !important;
}

body.dark-theme .ibox-title h5 {
  color: #e0e4ec !important;
}

body.dark-theme .ibox-content {
  background-color: #212738 !important;
  border-color: #2d3348 !important;
  color: #c8cdd8 !important;
}

body.dark-theme .ibox-footer {
  background-color: #212738 !important;
  border-top: 1px solid #2d3348 !important;
  color: #a0a8be !important;
}

body.dark-theme .ibox-tools a {
  color: #6b7590 !important;
}

body.dark-theme .ibox-tools a:hover {
  color: #4a90d9 !important;
}

/* ─── Footer ─── */
body.dark-theme .footer {
  background-color: #151929 !important;
  border-top: 1px solid #2d3348 !important;
  color: #6b7590 !important;
}

body.dark-theme .footer strong {
  color: #8e97b0;
}

/* ─── Tables ─── */
body.dark-theme .table {
  color: #c8cdd8;
}

body.dark-theme .table > thead > tr > th {
  border-bottom: 2px solid #2d3348 !important;
  color: #a0a8be;
}

body.dark-theme .table > tbody > tr > td,
body.dark-theme .table > tbody > tr > th,
body.dark-theme .table > tfoot > tr > td,
body.dark-theme .table > tfoot > tr > th,
body.dark-theme .table > thead > tr > td,
body.dark-theme .table > thead > tr > th {
  border-top: 1px solid #2d3348 !important;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #1a1f2e !important;
}

body.dark-theme .table-hover > tbody > tr:hover {
  background-color: #252c3f !important;
}

body.dark-theme .table-bordered {
  border: 1px solid #2d3348 !important;
}

body.dark-theme .table-bordered > thead > tr > th,
body.dark-theme .table-bordered > thead > tr > td {
  background-color: #1a1f2e !important;
}

body.dark-theme .table-bordered > thead > tr > th,
body.dark-theme .table-bordered > tbody > tr > th,
body.dark-theme .table-bordered > tfoot > tr > th,
body.dark-theme .table-bordered > thead > tr > td,
body.dark-theme .table-bordered > tbody > tr > td,
body.dark-theme .table-bordered > tfoot > tr > td {
  border: 1px solid #2d3348 !important;
}

/* ─── Forms ─── */
body.dark-theme .form-control {
  background-color: #1a1f2e !important;
  border: 1px solid #2d3348 !important;
  color: #d0d4dc !important;
}

body.dark-theme .form-control:focus {
  border-color: #4a90d9 !important;
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 217, 0.15) !important;
}

body.dark-theme .form-control::placeholder {
  color: #5a6478 !important;
}

body.dark-theme label,
body.dark-theme .col-form-label {
  color: #a0a8be !important;
}

body.dark-theme select.form-control {
  background-color: #1a1f2e !important;
  color: #d0d4dc !important;
}

/* ─── Buttons ─── */
body.dark-theme .btn-white {
  background-color: #212738 !important;
  border: 1px solid #2d3348 !important;
  color: #c8cdd8 !important;
}

body.dark-theme .btn-white:hover {
  background-color: #2d3348 !important;
  color: #ffffff !important;
}

body.dark-theme .btn-default {
  background-color: #2d3348 !important;
  border-color: #3a4158 !important;
  color: #c8cdd8 !important;
}

/* ─── Panels ─── */
body.dark-theme .panel {
  background-color: #212738;
  border-color: #2d3348;
}

body.dark-theme .panel-default > .panel-heading {
  background-color: #1a1f2e;
  border-color: #2d3348;
  color: #a0a8be;
}

/* ─── Breadcrumb ─── */
body.dark-theme .breadcrumb {
  background-color: #212738 !important;
  color: #a0a8be;
}

/* ─── Modal ─── */
body.dark-theme .modal-content {
  background-color: #212738 !important;
  border: 1px solid #2d3348 !important;
  color: #c8cdd8 !important;
}

body.dark-theme .modal-header {
  border-bottom: 1px solid #2d3348 !important;
}

body.dark-theme .modal-footer {
  border-top: 1px solid #2d3348 !important;
}

body.dark-theme .modal-header .close {
  color: #a0a8be !important;
}

/* ─── DataTables ─── */
body.dark-theme .dataTables_wrapper {
  color: #a0a8be !important;
}

body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #a0a8be !important;
}

body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: #2d3348 !important;
  border-color: #3a4158 !important;
  color: #ffffff !important;
}

body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: #4a90d9 !important;
  border-color: #4a90d9 !important;
  color: #ffffff !important;
}

body.dark-theme .dataTables_wrapper .dataTables_filter input,
body.dark-theme .dataTables_wrapper .dataTables_length select {
  background-color: #1a1f2e !important;
  border: 1px solid #2d3348 !important;
  color: #d0d4dc !important;
}

/* ─── Select2 ─── */
body.dark-theme .select2-container--default .select2-selection--single {
  background-color: #1a1f2e !important;
  border-color: #2d3348 !important;
  color: #d0d4dc !important;
}

body.dark-theme .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #d0d4dc !important;
}

body.dark-theme .select2-dropdown {
  background-color: #212738 !important;
  border-color: #2d3348 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.dark-theme .select2-container--default .select2-results__option {
  color: #c8cdd8 !important;
}

body.dark-theme .select2-search__field {
  background-color: #1a1f2e !important;
  border: 1px solid #2d3348 !important;
  color: #d0d4dc !important;
}

/* ─── Alerts ─── */
body.dark-theme .alert-warning {
  background-color: #3d3020 !important;
  border-color: #5c4a2c !important;
  color: #f8d98a !important;
}

body.dark-theme .alert-info {
  background-color: #1a2e3d !important;
  border-color: #2a4a5c !important;
  color: #8cd4f8 !important;
}

/* ─── Scrollbar (dark) ─── */
body.dark-theme ::-webkit-scrollbar-track {
  background: #1a1f2e;
}

body.dark-theme ::-webkit-scrollbar-thumb {
  background: #3a4158;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
  background: #4a5268;
}

/* ─── Misc Dark ─── */
body.dark-theme .text-muted {
  color: #6b7590 !important;
}

body.dark-theme a {
  color: #5da0e8;
}

body.dark-theme a:hover {
  color: #7db8f5;
}

body.dark-theme hr {
  border-top: 1px solid #2d3348;
}

body.dark-theme .minimalize-styl-2 {
  color: #a0a8be !important;
}

body.dark-theme .page-heading {
  border-bottom: 1px solid #2d3348 !important;
}

/* Dark theme toggle button */
body.dark-theme .theme-toggle-btn {
  color: #a0a8be;
}

body.dark-theme .theme-toggle-btn:hover {
  color: #ffffff;
}

/* Date picker */
body.dark-theme .datepicker {
  background-color: #212738 !important;
  color: #c8cdd8 !important;
}

body.dark-theme .datepicker table tr td,
body.dark-theme .datepicker table tr th {
  color: #c8cdd8 !important;
}

body.dark-theme .datepicker table tr td.active,
body.dark-theme .datepicker table tr td.active:hover {
  background-color: #4a90d9 !important;
}
