body {
  background: #f8f9fc;
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
}

/* Topbar style */
.topbar {
  background: #e3eafc;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 0 !important;
  padding-right: 32px;
  border-bottom: 1px solid #e3e6f0;
}
.topbar .brand {
  margin-left: 32px; 
  color: #2e384d;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 1px;
}

.logout-link {
  color: #224abe !important;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s;
}
.logout-link:hover {
  color: #224abe !important;
  text-decoration: underline;
}
.wrapper {
  display: flex;
}

/* Sidebar */
.sidebar {
  min-width: 250px;
  max-width: 260px;
  background: #f8f9fc;
  min-height: 100vh;
  padding: 24px 0 0 0;
  border-right: 1px solid #e3e6f0;
}

/* Sidebar nav */
.sidebar .nav {
  flex-direction: column;
}
.sidebar .nav-link {
  color: #4e73df;
  font-weight: 500;
  padding: 14px 28px 14px 32px;
  margin-bottom: 2px;
  border-radius: 8px;
  transition: 0.2s;
  display: flex;
  align-items: center;
  font-size: 1rem;
  background: transparent;
}
.sidebar .nav-link i,
.sidebar .sidebar-dropdown-toggle i {
    margin-right: 12px !important; 
    font-size: 1.25em;
    display: inline-block;
    vertical-align: middle;
}
.sidebar .nav-link.active,
.sidebar .nav-link:focus,
.sidebar .nav-link:hover {
  background: #e3eafc;
  color: #224abe !important;
  font-weight: 700;
  box-shadow: 0 0 0 2px #dde6f7;
}
.sidebar .dropdown-menu {
  background: #f8f9fc;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-left: 12px;
}
.sidebar .dropdown-item {
  color: #858796;
  padding: 10px 40px;
  border-radius: 8px;
  background: transparent;
}
.sidebar .dropdown-item:hover,
.sidebar .dropdown-item.active {
  background: #e3eafc;
  color: #224abe;
  font-weight: 600;
}
.sidebar-section-label {
  color: #b7b9cc;
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0 32px;
  margin-top: 24px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.main-content {
  flex: 1;
  background: #f8f9fc;
}
.content-wrapper {
  padding: 36px 36px 24px 36px;
}

@media (max-width: 991px) {
  .wrapper { flex-direction: column; }
  .sidebar { min-width: 100vw; max-width: 100vw; }
  .main-content { padding: 24px 8px; }
  .content-wrapper { padding: 18px 8px 12px 8px; }
  .topbar { padding: 0.7rem 1rem; }
}

/* Sidebar dropdown */
.sidebar .sidebar-dropdown { position: relative; }
.sidebar .sidebar-dropdown-menu {
  display: none;
  position: static;
  background: transparent;
  box-shadow: none;
  padding-left: 1.5rem;
}
.sidebar .sidebar-dropdown.open > .sidebar-dropdown-menu {
  display: block;
}
.sidebar .sidebar-dropdown .sidebar-dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: inherit;
  padding: 14px 28px 14px 32px;
  font-size: 1rem;
}
.sidebar .sidebar-dropdown-menu .nav-link {
  padding-left: 2.5rem;
  font-size: 0.98em;
}
/* Custom caret */
.sidebar-dropdown-toggle .caret {
  margin-left: auto;
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  transition: transform 0.3s;
  font-size: 1em;
}
.sidebar-dropdown-toggle .caret::after {
  content: "";
  display: inline-block;
  border-right: 2px solid #4e73df;
  border-bottom: 2px solid #4e73df;
  width: 0.5em;
  height: 0.5em;
  transform: rotate(-45deg);
  margin-left: 2px;
  margin-top: 2px;
}
.sidebar-dropdown.open .sidebar-dropdown-toggle .caret::after {
  transform: rotate(45deg);
  margin-top: 0;
}

/* ======================= TABLES ======================= */
.table thead th {
  font-weight: 700 !important;
  color: #224abe !important;
  background-color: #e3eafc !important;
  border-bottom: 2px solid #b8c4ea !important;
  text-align: center;
  vertical-align: middle !important;
  white-space: nowrap;
  /* header default tidak wrap */
}

/* Header kolom panjang agar wrap jika melebihi width */
.table th.kolom-wrap {
  white-space: normal !important;
  min-width: 120px;
  max-width: 220px;
}

/* Lebar kolom kode dan aksi lebih lebar, biar gak pecah */
.table th.kode, .table td.kode { min-width: 60px; max-width: 90px; }
.table th.aksi, .table td.aksi { min-width: 85px; width: 90px; text-align: center; }

/* Header dan cell default, semua border wajib muncul */
.table th, .table td {
  border: 1px solid #dee2e6 !important;
  padding: 10px 12px !important;
  font-size: 1.05em;
  background: #fff;
  word-break: break-word;
  vertical-align: middle !important;
}

/* Cell yang boleh wrap (untuk isi panjang) */
.table td.kolom-wrap {
  white-space: normal !important;
}

/* Responsive border tetap kelihatan */
.table-bordered th, .table-bordered td {
  border: 1px solid #dee2e6 !important;
}

/* Hilangkan border dan background pada kolom rowspan tersembunyi */
.table-bordered > tbody > tr > td[style*="display:none"] {
  border-left: 1px solid #dee2e6 !important;
  border-right: 1px solid #dee2e6 !important;
  background: #fff !important;
  padding: 0 !important;
  width: 0.01%;
  min-width: 1px !important;
}

.table td.aksi .btn {
  margin-bottom: 3px;
}

/* Wrap hanya jika sangat panjang */
.table th, .table td {
  word-break: break-word;
}

/* badge-mk, option select.*/
.badge-mk {
  display: inline-block;
  white-space: normal !important;
  max-width: 120px;
  word-break: break-word;
  text-align: left;
  line-height: 1.2;
  font-size: 0.9em;
  margin-bottom: 3px;
}
select.form-select option {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  display: block;
  max-width: 300px; 
}

/* Extra fix for horizontal scroll if overflow (optional) */
.table-responsive { overflow-x: auto; }

.topbar, .sidebar, .main-content, .main-content .container-fluid {
  margin-left: 0 !important;
  padding-left: 0 !important;
}
.table td.cpl-nowrap, .table th.cpl-nowrap {
    white-space: nowrap !important;
    vertical-align: middle !important;
}
table .tr-total-bobot th,
table .tr-total-bobot td {
  background: #e3eafc  !important;
}


/* Untuk body login */
body {
    background: linear-gradient(135deg, #e6eeff 0%, #f4f6fb 100%);
}

/* Card & layout */
.login-card {
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px rgba(36, 82, 255, 0.10);
    border: none;
    padding: 2.8rem 2.3rem;
    background: #fff;
    min-width: 380px;
    max-width: 750px;
    width: 100%;
    transition: box-shadow 0.2s;
}
.login-card:hover {
    box-shadow: 0 18px 48px rgba(36, 82, 255, 0.14);
}
.login-flex-row {
    display: flex;
    gap: 2.4rem;
    align-items: center;
    justify-content: center;
}
.login-left {
    text-align: center;
    min-width: 210px;
}
.login-logo {
    width: 175px;
    border-radius: 1rem;
    filter: drop-shadow(0 4px 18px #2a569e22);
    background: #fff;
    margin-bottom: 0.4rem;
}
.login-label {
    font-size: 1.22rem;
    color: #2553a2;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.35;
}
.login-form-col {
    flex: 1;
    min-width: 270px;
}
.login-title {
    font-size: 2.1rem;
    font-weight: 600;
    color: #2359c7;
    margin-bottom: 1.7rem;
    letter-spacing: 0.03em;
}

/* Form & Input */
.login-form label {
    color: #465477;
    font-weight: 500;
}
.login-form .form-control {
    border-radius: 0.65rem;
    border: 1.5px solid #b6c4e6;
    background: #f8faff;
    transition: border 0.2s, box-shadow 0.2s;
    font-size: 1.1rem;
}
.login-form .form-control:focus {
    border: 2px solid #1F51FF;
    background: #fff;
    box-shadow: 0 0 0 1.5px #2952ff22;
    outline: none;
}

/* Tombol Login Outline Biru Calm */
.btn-login {
    border: 2px solid #1F51FF;
    color: #1F51FF;
    background: #fff;
    border-radius: 1.3rem;
    font-size: 1.12rem;
    font-weight: 600;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
    transition: all 0.22s;
    box-shadow: 0 2px 18px #3c6df01b;
    letter-spacing: 0.02em;
}
.btn-login:focus {
    outline: none;
    border-color: #1F51FF;
}
.btn-login:hover,
.btn-login:active {
    background: linear-gradient(90deg,#1F51FF 0%, #1F51FF 100%);
    color: #fff;
    border-color: #2158cd;
    box-shadow: 0 4px 18px #2952ff23;
}
.btn-login:disabled {
    background: #b3ccff;
    color: #eaf0ff;
    border-color: #b3ccff;
    cursor: not-allowed;
}

/* Flash Message/Login Error */
.login-flash-error {
    color: #b3261e;
    background: #fdeaea;
    border: 1.5px solid #f7b1a8;
    border-radius: 0.7rem;
    padding: 10px 14px;
    margin-bottom: 1.4rem;
    font-size: 1rem;
    text-align: center;
}
.login-flash-success {
    color: #185f2e;
    background: #e8fce7;
    border: 1.5px solid #a9e3b3;
    border-radius: 0.7rem;
    padding: 10px 14px;
    margin-bottom: 1.4rem;
    font-size: 1rem;
    text-align: center;
}

@media (max-width: 900px) {
    .login-flex-row {
        flex-direction: column;
        gap: 1.4rem;
    }
    .login-left img {
        width: 120px;
    }
    .login-card {
        padding: 2rem 1.2rem;
        min-width: unset;
    }
    .login-title {
        font-size: 1.45rem;
    }
}
table.table td, table.table th {
  white-space: normal !important;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 300px; /* sesuaikan kebutuhan */
}


/* Responsive for small screens */
@media (max-width: 480px) {
    .login-card {
        padding: 1.1rem 0.2rem;
    }
    .login-logo {
        width: 90px;
    }
}
/* mk-cpl-cpmk */
.table-pemetaan th.cpl-header,
    .table-pemetaan td.cpl-cell {
        width: 110px; 
        min-width: 110px;
        vertical-align: top; 
    }
    .table-pemetaan .mk-column {
        min-width: 250px;
    }