/**
 * Public BMN Dashboard Shell — sidebar + dashboard content (tanpa auth admin).
 */

:root {
  --pub-navy: #071426;
  --pub-navy-alt: #081a2f;
  --pub-blue: #2563eb;
  --pub-green: #16a34a;
  --pub-yellow: #d97706;
  --pub-red: #dc2626;
  --pub-bg: #f8fafc;
  --pub-text: #0f172a;
  --pub-muted: #64748b;
  --pub-border: #e5e7eb;
}

/* ===== SHELL ===== */
.public-dashboard-body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--pub-bg);
  color: var(--pub-text);
  -webkit-font-smoothing: antialiased;
}

.public-shell {
  min-height: 100vh;
  display: flex;
  background: var(--pub-bg);
}

/* ===== SIDEBAR ===== */
.public-sidebar {
  width: 280px;
  min-height: 100vh;
  background: var(--pub-navy);
  color: #e5e7eb;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.public-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.public-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
}

.public-brand-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.public-brand-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 6px;
  letter-spacing: 0;
  text-transform: none;
}

.public-menu {
  flex: 1;
}

.public-menu-title {
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 18px 12px 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.public-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.public-menu a i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.public-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.public-menu a.active {
  background: var(--pub-blue);
  color: #ffffff;
}

.public-sidebar-footer {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
  margin-top: 12px;
}

.public-sidebar-copy {
  margin-top: 10px;
  font-size: 11px;
  color: #94a3b8;
}

/* ===== MAIN ===== */
.public-main {
  flex: 1;
  margin-left: 280px;
  padding: 28px 36px 36px;
  overflow-x: hidden;
  min-width: 0;
}

.public-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.public-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.public-sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--pub-border);
  border-radius: 10px;
  background: #fff;
  color: var(--pub-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.public-topbar-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  color: var(--pub-text);
}

.public-breadcrumb {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--pub-muted);
}

.public-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-notif-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--pub-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pub-muted);
  font-size: 20px;
  cursor: default;
}

.public-notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pub-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--pub-blue);
  color: #fff !important;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s ease;
}

.public-login-btn:hover {
  background: #1d4ed8;
  color: #fff !important;
}

.public-page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--pub-text);
  margin: 0 0 24px;
  line-height: 1.2;
}

/* ===== STAT CARDS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
  border: 1px solid var(--pub-border);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-body {
  min-width: 0;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pub-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--pub-text);
  line-height: 1.2;
}

.stat-sub {
  font-size: 12px;
  color: var(--pub-muted);
  margin-top: 2px;
}

.bg-blue { background: var(--pub-blue); }
.bg-green { background: var(--pub-green); }
.bg-yellow { background: var(--pub-yellow); }
.bg-red { background: var(--pub-red); }
.bg-navy { background: #0f2a4a; }

/* ===== CONTENT GRID ===== */
.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 22px;
  margin-bottom: 28px;
}

.dashboard-card {
  background: #ffffff;
  border: 1px solid var(--pub-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
  height: 100%;
}

.dashboard-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 18px;
  color: var(--pub-text);
}

/* Donut summary */
.service-donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.service-donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(
    var(--pub-blue) 0deg 90deg,
    var(--pub-green) 90deg 180deg,
    var(--pub-yellow) 180deg 270deg,
    #0f2a4a 270deg 360deg
  );
  position: relative;
  flex-shrink: 0;
}

.service-donut::after {
  content: "4";
  position: absolute;
  inset: 28px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--pub-text);
}

.service-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  min-width: 160px;
}

.service-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--pub-muted);
}

.service-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Notifications */
.notif-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.notif-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.notif-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.notif-icon.green { background: rgba(22, 163, 74, 0.12); color: var(--pub-green); }
.notif-icon.yellow { background: rgba(217, 119, 6, 0.12); color: var(--pub-yellow); }
.notif-icon.blue { background: rgba(37, 99, 235, 0.12); color: var(--pub-blue); }

.notif-text {
  font-size: 13px;
  color: var(--pub-text);
  line-height: 1.45;
}

.notif-text small {
  display: block;
  color: var(--pub-muted);
  margin-top: 2px;
}

/* Mini service bars */
.mini-service-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-service-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--pub-border);
  border-radius: 12px;
  text-decoration: none !important;
  color: var(--pub-text) !important;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.mini-service-item:hover {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  color: var(--pub-text) !important;
}

.mini-service-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.mini-service-item span {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.mini-service-item i.ti-arrow-right {
  color: var(--pub-muted);
  font-size: 16px;
}

/* ===== SERVICE TABLE ===== */
.service-table-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--pub-border);
  padding: 24px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}

.service-table-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 4px;
}

.service-table-card .card-sub {
  font-size: 13px;
  color: var(--pub-muted);
  margin-bottom: 20px;
}

.service-table {
  width: 100%;
  border-collapse: collapse;
}

.service-table thead th {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pub-muted);
  border-bottom: 1px solid var(--pub-border);
  text-align: left;
}

.service-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  vertical-align: middle;
}

.service-table tbody tr:last-child td {
  border-bottom: none;
}

.service-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.service-table-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.pub-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pub-badge-blue { background: rgba(37, 99, 235, 0.12); color: var(--pub-blue); }
.pub-badge-green { background: rgba(22, 163, 74, 0.12); color: var(--pub-green); }
.pub-badge-yellow { background: rgba(217, 119, 6, 0.12); color: var(--pub-yellow); }
.pub-badge-navy { background: rgba(15, 42, 74, 0.12); color: #0f2a4a; }

.btn-pub-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: background 0.15s ease;
}

.btn-pub-primary {
  background: var(--pub-blue);
  color: #fff !important;
}

.btn-pub-primary:hover {
  background: #1d4ed8;
  color: #fff !important;
}

.btn-pub-outline {
  background: #fff;
  color: var(--pub-blue) !important;
  border-color: var(--pub-blue);
}

.btn-pub-outline:hover {
  background: rgba(37, 99, 235, 0.06);
}

/* ===== OVERLAY (mobile drawer) ===== */
.public-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1035;
}

.public-sidebar-overlay.show {
  display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .public-sidebar-toggle {
    display: inline-flex;
  }

  .public-sidebar {
    transform: translateX(-100%);
  }

  .public-sidebar.open {
    transform: translateX(0);
  }

  .public-main {
    margin-left: 0;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .public-shell {
    display: block;
  }

  .public-sidebar {
    width: 280px;
    min-height: auto;
  }

  .public-main {
    padding: 20px 16px 28px;
  }

  .public-page-title {
    font-size: 22px;
  }

  .service-table-wrap {
    overflow-x: auto;
  }

  .service-table {
    min-width: 640px;
  }
}

@media (max-width: 576px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .public-topbar-right .public-login-btn span {
    display: none;
  }
}

/* ==========================================================================
   Menu Layanan BMN — icon/banner card grid (di atas stat-grid)
   ========================================================================== */
.public-icon-menu-section {
  margin: 0 0 28px;
}

.public-section-heading {
  margin-bottom: 16px;
}

.public-section-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
}

.public-section-heading p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 14px;
}

.public-icon-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.public-icon-menu-card {
  display: block;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  min-height: 150px;
  text-decoration: none;
  color: inherit;
}

.public-icon-menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  border-color: #2563eb;
}

.public-icon-menu-card img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.public-icon-menu-title {
  padding: 14px 18px;
  font-weight: 800;
  color: #0f172a;
  background: #ffffff;
  font-size: 15px;
}

/* Fallback bila image gagal dimuat: card tetap rapi, judul jadi banner */
.public-icon-menu-card.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
}

.public-icon-menu-card.no-image .public-icon-menu-title {
  background: transparent;
  color: #ffffff;
  font-size: 20px;
  text-align: center;
  padding: 24px;
}

@media (max-width: 992px) {
  .public-icon-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .public-icon-menu-grid {
    grid-template-columns: 1fr;
  }

  .public-icon-menu-card img {
    height: 140px;
  }

  .public-section-heading h2 {
    font-size: 19px;
  }
}
