:root {
  --bg-soft: #f6f7fb;
  --card-radius: 18px;
}
table {
  width: 100%;
  table-layout: auto !important; /* ini yang bikin ngikutin isi */
  border-collapse: collapse !important; /* optional */
}

/* Supaya teks gak dipaksa wrap (biar lebar kolom ikut panjang teks) */
table th,
table td {
  white-space: nowrap !important; /* kalau mau wrap, hapus ini */
}
.bg-soft {
  background: var(--bg-soft);
  min-height: 100dvh;
}
.card.rounded-4 {
  border-radius: var(--card-radius) !important;
}
.nav-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 10px;
  z-index: 1030;
}
.nav-bottom a {
  text-decoration: none;
  color: #6c757d;
  font-size: 0.72rem;
}
.nav-bottom a .bi {
  font-size: 1.1rem;
  display: block;
  line-height: 1.1;
}
.nav-bottom a.active {
  color: #0d6efd;
  font-weight: 600;
}
/* ===== App Layout (Flexbox) ===== */
.app-layout {
  display: flex;
  min-height: 100dvh;
}

/* ===== Sidebar ===== */
.sidebar {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  width: 210px;
  min-width: 210px;
  padding: 0;
  background: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  /* overflow changes: moved auto scrolling into an inner wrapper so absolute toggle doesn't get clipped */
  flex-direction: column;
  transition: width 0.25s ease, min-width 0.25s ease;
  z-index: 200;
}
@media (min-width: 768px) {
  .sidebar {
    display: flex;
  }
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

/* Collapsed State */
.sidebar.collapsed {
  width: 62px;
  min-width: 62px;
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-text {
  display: none;
}
.sidebar.collapsed .brand-section {
  justify-content: center;
  padding: 16px 10px 10px;
}
.sidebar.collapsed .nav-link-custom {
  justify-content: center;
  padding: 10px 0;
}
.sidebar.collapsed .nav-link-custom i {
  font-size: 1.2rem;
  width: auto;
  margin: 0 auto;
}
.sidebar.collapsed .nav-section {
  padding: 4px 6px;
}
.sidebar.collapsed .sidebar-toggle {
  right: -12px;
}
.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

/* Toggle Button — absolute at right edge of sidebar */
.sidebar-toggle {
  position: absolute;
  right: -12px;
  top: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  z-index: 210;
  padding: 0;
}
.sidebar-toggle:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.sidebar-toggle i {
  transition: transform 0.25s ease;
  line-height: 1;
}

/* Brand Section */
.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 12px;
  white-space: nowrap;
  /* position: relative; */
}
.brand-logo {
  height: 38px;
  width: 38px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #1e293b;
  line-height: 1.2;
  transition: opacity 0.2s ease;
}
.brand-text p {
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
}

/* Nav Sections */
.nav-section {
  padding: 4px 12px;
  margin-bottom: 4px;
}
.nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px 4px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.nav-section-bottom {
  margin-top: auto;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 8px;
}

/* Nav Links */
.nav-link-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  white-space: nowrap;
}
.nav-link-custom i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.nav-text {
  transition: opacity 0.2s ease;
}
.nav-link-custom:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.nav-link-custom.active {
  background: linear-gradient(135deg, #e9f1ff, #dbeafe);
  color: #0d6efd;
  font-weight: 600;
}
.nav-link-custom.active i {
  color: #0d6efd;
}
.nav-link-custom.text-danger:hover {
  background: #fef2f2;
}

/* ===== Main Area ===== */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Top Header Bar */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.top-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-header-info {
  text-align: right;
}
.top-header-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}
.top-header-meta {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.2;
}
.top-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.content {
  padding: 16px 12px 80px; /* bottom nav space */
}
@media (min-width: 992px) {
  .content {
    padding: 22px 22px 22px;
  }
}
.dashboard-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.badge-soft {
  background: #eef2ff;
  color: #1e40af;
  font-weight: 600;
}

/* ZIP04 monitoring tiles */
.icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 110, 253, 0.08);
  flex: 0 0 auto;
}
.kpi-tile {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 10px 12px;
  background: #fff;
}

/* ZIP06 polishing */
.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: 0.2px;
}
.table-responsive {

  overflow-x: auto;
}
.table > :not(caption) > * > * {
  vertical-align: middle;
}
.btn.rounded-4 {
  border-radius: 16px !important;
}
.icon-box {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 110, 253, 0.08);
  color: #0d6efd;
  flex: 0 0 auto;
}
.card a,
a.card {
  color: inherit;
}
/* ===== Dashboard Modern Gradient ===== */
:root {
  --c1: #0d6efd;
  --c2: #6f42c1;
  --c3: #20c997;
  --c4: #ff6b6b;
  --soft: #f6f8fc;
}

.bg-soft {
  background:
    radial-gradient(
      1200px 600px at 10% 10%,
      rgba(13, 110, 253, 0.1),
      transparent 45%
    ),
    radial-gradient(
      900px 500px at 90% 15%,
      rgba(111, 66, 193, 0.1),
      transparent 45%
    ),
    radial-gradient(
      900px 500px at 80% 90%,
      rgba(32, 201, 151, 0.1),
      transparent 50%
    ),
    var(--soft) !important;
  min-height: 100dvh !important;
}

.dash-wrap {
  max-width: 980px;
  margin: 0 auto;
}

.card-soft {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(17, 24, 39, 0.06);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
}

.kpi-card {
  position: relative;
  overflow: hidden;
}
.kpi-card:before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    500px 200px at 20% 0%,
    rgba(255, 255, 255, 0.8),
    transparent 50%
  );
  pointer-events: none;
}
.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.g1 {
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
}
.g2 {
  background: linear-gradient(135deg, #20c997, #0d6efd);
}
.g3 {
  background: linear-gradient(135deg, #ff6b6b, #f59f00);
}
.g4 {
  background: linear-gradient(135deg, #6f42c1, #20c997);
}

.badge-soft {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  border: 1px solid rgba(13, 110, 253, 0.15);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
}

.cc-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.cc-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #20c997, #0d6efd, #6f42c1);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.menu-tile {
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 25px rgba(17, 24, 39, 0.04);
}
.menu-tile:hover {
  transform: translateY(-1px);
  transition: 0.15s ease;
}
.menu-tile .ticon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.menu-tile .title {
  font-weight: 700;
  margin-top: 10px;
}
.menu-tile .desc {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.55);
}

@media (min-width: 992px) {
  .menu-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ===== Modern UI Additions ===== */

/* Modern Card */
.card-modern {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

/* Breadcrumb Modern */
.breadcrumb-modern {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}
.breadcrumb-modern a {
  text-decoration: none;
  color: #64748b;
  transition: color 0.2s;
}
.breadcrumb-modern a:hover {
  color: #0d6efd;
}
.breadcrumb-modern .separator {
  margin: 0 8px;
  color: #cbd5e1;
}
.breadcrumb-modern .active {
  color: #0d6efd;
  font-weight: 600;
}

/* KPI Gradients */
.bg-gradient-blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.bg-gradient-amber {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.bg-gradient-emerald {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}
.bg-gradient-indigo {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: #5b21b6;
}

.card-kpi {
  padding: 20px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}
.card-kpi .kpi-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 4px;
}
.card-kpi .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}
.card-kpi .kpi-sub {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 4px;
}
.card-kpi .icon-wrapper {
  position: absolute;
  right: 15px;
  top: 15px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.4);
  font-size: 1.25rem;
}

/* Utilities */
.text-purple {
  color: #7c3aed !important;
}

.table-modern {
  width: 100%;
  border-collapse: collapse;
}
.table-modern thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.table-modern tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}
.table-modern tbody tr:last-child td {
  border-bottom: none;
}

@media (min-width: 768px) {
  .border-end-md {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
  }
}
