/* Custom theme overrides for Silamijakon */

/* Typography */
html, body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

/* Brand colors (primary/secondary based on design) */
:root {
  /* Primary: Orange */
  --bs-primary: #f37021;
  --bs-primary-rgb: 243, 112, 33;

  /* Secondary: Darker Orange */
  --bs-secondary: #c05621;
  --bs-secondary-rgb: 192, 86, 33;
  /* Sidebar tints */
  --sila-orange: #F36A14;
  --sila-orange-light: #FFF0E6; /* light orange for parent group */
}

/* Buttons - override Bootstrap vars for consistent shades */
.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #f37021;
  --bs-btn-border-color: #f37021;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #e16217;
  --bs-btn-hover-border-color: #dc5d15;
  --bs-btn-focus-shadow-rgb: 243, 112, 33;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #dc5d15;
  --bs-btn-active-border-color: #d75914;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #f37021;
  --bs-btn-disabled-border-color: #f37021;
}

.btn-secondary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #c05621;
  --bs-btn-border-color: #c05621;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #a84a1d;
  --bs-btn-hover-border-color: #9f461c;
  --bs-btn-focus-shadow-rgb: 192, 86, 33;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #9f461c;
  --bs-btn-active-border-color: #963f19;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #c05621;
  --bs-btn-disabled-border-color: #c05621;
}

/* Utility classes tied to brand */
.text-primary { color: #f37021 !important; }
.bg-primary { background-color: #f37021 !important; }
.border-primary { border-color: #f37021 !important; }

.text-secondary { color: #c05621 !important; }
.bg-secondary { background-color: #c05621 !important; }
.border-secondary { border-color: #c05621 !important; }

/* Active menu highlight */
.metismenu a.mm-active,
.metismenu a.active {
  color: #fff !important;
  background-color: var(--sila-orange) !important;
}

/* Sidebar color variables (remove default blue) */
:root {
  --bs-sidebar-menu-item-active-color: #383c40; /* neutral text when section expanded */
  --bs-sidebar-menu-item-active-bg-color: var(--sila-orange-light); /* lighter orange tint for expanded parent */
}

/* Keep icons white only when the link itself is marked active */
.metismenu a.mm-active i,
.metismenu a.active i {
  color: #fff !important; /* active icon stays white */
}

/* Hover color for icons in general (non-active) */
.metismenu a:hover i,
.vertical-menu #sidebar-menu a:hover i {
  color: var(--bs-sidebar-menu-item-hover-color, inherit) !important;
}

/* Ensure active item icon does not turn black on hover */
.metismenu a.mm-active:hover i,
.metismenu a.active:hover i {
  color: #fff !important;
}

/* Note: Do NOT force icons white for li.mm-active (expanded groups).
   Keep icons white only when the actual link is active. */

/* Default: icons inherit link color */
.metismenu a i,
.vertical-menu #sidebar-menu a i {
  color: inherit;
}

/* Sidebar: make expanded parent (“mother”) light orange */
.vertical-menu #sidebar-menu > ul > li.mm-active > a.has-arrow,
.vertical-menu #sidebar-menu > ul > li > a[aria-expanded="true"] {
  background-color: var(--sila-orange-light) !important;
  color: var(--sila-orange) !important;
  border-radius: 8px;
  margin: 0px 12px; /* align width with parent container */
  margin-bottom: 8px;
}
.vertical-menu #sidebar-menu > ul > li.mm-active > a.has-arrow i,
.vertical-menu #sidebar-menu > ul > li > a[aria-expanded="true"] i {
  color: var(--sila-orange) !important;
}

/* Sidebar: selected child same width as parent */
.vertical-menu #sidebar-menu .sub-menu li > a.active,
.vertical-menu #sidebar-menu .sub-menu li.mm-active > a {
  background-color: var(--sila-orange) !important;
  color: #fff !important;
  border-radius: 8px;
  margin: 0 12px; /* keep same side padding as parent tile */
}

/* Optional: keep hover subtle without stretching full width */
.vertical-menu #sidebar-menu .sub-menu li > a:hover {
  border-radius: 8px;
  margin: 0 12px;
}

/* Card headers/section accents if needed */
.card-title, .page-title-box .page-title {
  font-weight: 600;
}

/* Form controls focus ring in brand color */
.form-control:focus, .form-select:focus {
  border-color: rgba(var(--bs-primary-rgb), 0.6);
  box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15);
}

/* Login background styling */
body.authentication-bg {
  position: relative;
  min-height: 100vh;
  /* Apply fade as a background layer so it covers the full viewport */
  background:
    linear-gradient(rgba(255,255,255,.78), rgba(255,255,255,.78)),
    url('../images/background-login.jpg') center center / cover no-repeat fixed;
}

/* Remove template margins and center the login vertically without forcing page scroll */
body.authentication-bg .account-pages {
  margin: 0 !important;               /* remove .my-5 margins */
  min-height: 100vh;                  /* fill viewport height */
  display: flex;                      /* vertical centering */
  align-items: center;
}

/* On small screens, let content start a little lower */
@media (max-width: 575.98px) {
  body.authentication-bg .account-pages {
    align-items: flex-start;
    padding-top: 2rem;
  }
}
/* Ensure page content sits above overlay */
body.authentication-bg .account-pages,
body.authentication-bg .container,
body.authentication-bg .card {
  position: relative;
  z-index: 1;
}
/* Elevate the login card a bit */
body.authentication-bg .card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 6px 18px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Utility: explicit font-size 32px for icons/text */
.font-size-28 {
  font-size: 28px !important; /* ensure it overrides template defaults */
  line-height: 1;             /* keep icons vertically balanced */
}

/* Extra breathing room above footer divider */
.page-content { padding-bottom: 90px !important; }

.mobile-tab-selector {
  margin-bottom: 2rem;
}

@media (max-width: 767.98px) {
  .tab-section-row {
    --bs-gutter-y: 2rem;
    margin-top: 0 !important;
  }
}

/* ======================
   Dashboard: Stat Cards
   ====================== */
.custom-card {
  width: 100%;
  height: 180px;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0px 4px 8px -2px rgba(0, 0, 0, 0.1),
              0px 2px 4px -2px rgba(0, 0, 0, 0.06);
  background: radial-gradient(102.27% 343.75% at 102.27% 3.89%,
              #FF5C00 0%, #FE8D4D 57.05%, #FE6A16 100%);
  color: #FFDFCC; /* inherit for all inner text */
  font-family: 'Inter', sans-serif;
}

.custom-card--white {
  width: 100%;
  height: 180px;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0px 4px 8px -2px rgba(0, 0, 0, 0.1),
              0px 2px 4px -2px rgba(0, 0, 0, 0.06);
  background: #ffffff;
  color: #111827; /* gray-900 */
  border: 1px solid rgba(0,0,0,0.06);
  font-family: 'Inter', sans-serif;
}

/* Title */
.card-title-custom {
  font-weight: 600;
  font-size: 16px;
  line-height: 150%;
  text-shadow: 0px 32px 64px rgba(0, 0, 0, 0.4);
}

/* Main number */
.card-main-text {
  font-weight: 500;
  font-size: 56px !important;
  line-height: 120%;
  text-align: right;
  letter-spacing: -0.01em;
  color: currentColor; /* inherit from card */
  text-shadow: 0px 32px 64px rgba(0, 0, 0, 0.4);
}

/* Extra specificity to avoid template overrides */
.custom-card .card-main-text,
.custom-card--white .card-main-text {
  font-size: 56px !important;
}

/* Bottom text */
.card-bottom-text {
  font-weight: 600;
  font-size: 14px;
  line-height: 150%;
  color: currentColor; /* inherit from card */
  text-shadow: 0px 32px 64px rgba(0, 0, 0, 0.4);
}

/* Ensure spacing in Bootstrap grid looks even for fixed-height cards */
@media (min-width: 1200px) {
  .custom-card, .custom-card--white { margin: 0; }
}

/* ======================
    Donut Legend Pills
   ====================== */

#chart-paket-status .apexcharts-legend-series {
  display: inline-flex;
  align-items: center;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 8px 12px;
  margin: 8px 0px !important;
  box-shadow: none !important;
  transition: none !important;
}

#chart-paket-status .apexcharts-legend-series:hover {
  background: #f3f4f6 !important; /* keep static on hover */
}

#chart-paket-status .apexcharts-legend-text {
  color: #111827 !important; /* gray-900 */
  font-weight: 500 !important;
}

#chart-paket-status .apexcharts-legend-series:before,
#chart-paket-status .apexcharts-legend-series:after { display: none !important; }

/* Force donut center label colors (avoid theme overrides) */
#chart-paket-status .apexcharts-datalabels-group .apexcharts-datalabel-label {
  fill: #4D504F !important; /* Total Paket label */
}
#chart-paket-status .apexcharts-datalabels-group .apexcharts-datalabel-value {
  fill: #111827 !important; /* numeric value color */
}

/* Mobile: hide donut legend so the chart can occupy the width */
@media (max-width: 576px) {
#chart-paket-status .apexcharts-legend { display: none !important; }
}

/* ======================
   Pengguna: Table styling
   ====================== */
.table-pengguna thead th {
  background-color: #F36A14; /* orange header */
  color: #ffffff;
  border-color: #E6E9ED;
  font-weight: 600;
}

.table-pengguna tbody td,
.table-pengguna tbody th {
  border-top: 1px solid #E6E9ED;
}

/* ======================
   Paket: Table styling
   ====================== */
.table-paket thead th {
  background-color: #F36A14;
  /* orange header */
  color: #ffffff;
  border-color: #E6E9ED;
  font-weight: 600;
}

.table-paket tbody td,
.table-paket tbody th {
  border-top: 1px solid #E6E9ED;
}

/* Make Paket table text more readable */
.table-paket td, .table-paket th { font-size: 15px; }
.table-paket .badge { font-size: 14px; padding: 8px 14px; border-radius: 18px; }
.table-paket .list-inline-item i { font-size: 20px; }

.btn-orange {
  background-color: #F36A14;
  color: #fff;
  border-color: #F36A14;
}
.btn-orange:hover {
  background-color: #d95e12;
  border-color: #d95e12;
  color: #fff;
}

/* ======================
   Pengguna Detail Page
   ====================== */
.user-detail .detail-title { font-size: 32px; font-weight: 700; }
.user-detail .section-title { font-size: 24px; font-weight: 600; }
.user-detail .section-subtitle { margin-bottom: 24px; }
.user-detail .field-label { font-size: 14px; margin-bottom: 4px; }
.user-detail .field-value { font-size: 16px; color: #111827; }
.user-detail .card-body { padding: 24px 28px; position: relative; }

/* Back button next to title (Figma-like) */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #F36A14;
  border-radius: 8px;
  color: #F36A14;
  background: #fff;
  text-decoration: none;
}
.btn-back:hover { background: #fff7f1; color: #d95e12; border-color: #d95e12; }
.btn-back i { font-size: 20px; line-height: 1; }

/* Mobile layout adjustments for Detail Pengguna */
@media (max-width: 576px) {
  .user-detail .header-actions { position: absolute; top: 28px; right: 28px; }
  .user-detail .card-body { padding-top: 92px; } /* space above title for button */
  .user-detail .detail-header { margin-bottom: 12px; }
  /* Extra spacing as requested */
  .user-detail .intro-column { margin-top: 28px;}
  .user-detail .main-column .section:first-child { margin-top: 32px; }
}

/* Align password and email inputs on edit page for desktop */
@media (min-width: 768px) {
  .user-edit .email-align { margin-top: 6px; }
  .user-edit .phone-help { margin-top: 6px; display: block; }
}

/* Password strength meter */
.pw-meter-bar { height: 6px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.pw-meter-bar span { display:block; height:100%; width:10%; transition: width .2s ease; }
.pw-meter-bar span.lvl-0 { background:#ef4444; }
.pw-meter-bar span.lvl-1 { background:#f59e0b; }
.pw-meter-bar span.lvl-2 { background:#fbbf24; }
.pw-meter-bar span.lvl-3 { background:#10b981; }
.pw-meter-bar span.lvl-4 { background:#059669; }

/* ======================
   Breadcrumb: keep visible on mobile
   ====================== */
@media (max-width: 576px) {
  .page-title-box { flex-direction: column; align-items: flex-start !important; gap: 6px; }
  .page-title-box .page-title-right { display: block !important; width: 100%; }
  .page-title-box .breadcrumb { display: flex !important; flex-wrap: wrap; gap: 6px; margin-bottom: 0; }
  .page-title-box .breadcrumb .breadcrumb-item + .breadcrumb-item::before { padding-right: .4rem; }
}

/* Search input with icon (keeps icon inside on the right) */
.search-box { position: relative; }
.search-box .form-control { padding-right: 2.25rem; }
.search-box .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  pointer-events: none;
  font-size: 18px;
}

/* Pagination styled to match Figma */
/* Target CI default_full markup (ul.pagination > li > a) */
.pagination-figma .pagination { display: flex; gap: 12px; padding-left: 0; margin: 0; }
.pagination-figma .pagination li { list-style: none; }
.pagination-figma .pagination li a {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #E5E7EB; border-radius: 8px; background: #fff;
  color: #111827; text-decoration: none; padding: 0; line-height: 1;
}
.pagination-figma .pagination li.active a { border-color: #F36A14; color: #F36A14; background: #fff; font-weight: 600; }
.pagination-figma .pagination li a:hover { border-color: #cbd5e1; color: #111827; background: #fff; }

/* First/Prev/Next/Last chevrons and disabled look */
.pagination-figma .pagination li a[aria-label="Previous"],
.pagination-figma .pagination li a[aria-label="First"],
.pagination-figma .pagination li a[aria-label="Next"],
.pagination-figma .pagination li a[aria-label="Last"] { font-size: 0; color: #6b7280; }
.pagination-figma .pagination li a[aria-label="Previous"]::before { content: '\2039'; font-size: 18px; }
.pagination-figma .pagination li a[aria-label="First"]::before { content: '\2039'; font-size: 18px; opacity: .4; }
.pagination-figma .pagination li a[aria-label="Next"]::before { content: '\203A'; font-size: 18px; }
.pagination-figma .pagination li a[aria-label="Last"]::before { content: '\203A'; font-size: 18px; opacity: .4; }

/* Disabled state approximation: when prev/first not available, CI omits them; no disabled element is printed.
   If you later add a custom template with disabled items, these can be styled too: */
.pagination-figma .pagination li.disabled a { background: #E5E7EB; color: #9CA3AF; border-color: #E5E7EB; }

/* ======================
   Create Paket: Tabs underline & switches
   ===================== */
.tabs-underline { border-bottom: 2px solid #e5e7eb; gap: 16px; }
.tabs-underline .nav-link {
  border: none !important; background: transparent !important; color: #111827; border-radius: 0; font-weight: 600;
}
.tabs-underline .nav-link.active { color: #111827; position: relative; }
.tabs-underline .nav-link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: #F36A14; border-radius: 3px;
}

/* Large, orange form switch */
.form-switch-lg.form-switch .form-check-input {
  width: 3.25rem; height: 1.75rem; border-radius: 2rem; background-color: #e5e7eb;
}
.form-switch-lg.form-switch .form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(243, 112, 33, .15); }
.form-switch-lg.form-switch .form-check-input:checked { background-color: #F36A14; border-color: #F36A14; }
.form-switch-lg.form-switch .form-check-input { cursor: pointer; }

/* Currency input: hide number spinners and style Rp prefix */
input[type=number].no-spinner::-webkit-outer-spin-button,
input[type=number].no-spinner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number].no-spinner { -moz-appearance: textfield; appearance: textfield; }
.input-group .input-group-text.rp {
  background: #f8fafc; border-color: #e5e7eb; color: #111827; font-weight: 600;
}

/* Lampiran block styling */
.lampiran-block { padding: 0; }
.lampiran-block + .lampiran-block { border-top: none; }
.lampiran-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.lampiran-subtitle { margin-bottom: 12px; color: #6b7280; font-size: 0.9375rem; }
.lampiran-header { margin-bottom: 16px; }
.lampiran-field { margin-bottom: 16px; }
.lampiran-field:last-child { margin-bottom: 0; }
.lampiran-field-label { font-size: 0.875rem; text-transform: none; letter-spacing: normal; color: #6b7280; font-weight: 600; margin-bottom: 6px; }
.lampiran-field-value { color: #111827; font-size: 1rem; font-weight: 500; }
.lampiran-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px; font-size: 0.875rem; font-weight: 600; }
.lampiran-pill .mdi { font-size: 16px; line-height: 1; }
.lampiran-pill-url { background: rgba(16, 185, 129, 0.12); color: #047857; }
.lampiran-pill-file { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.lampiran-pill-empty { background: #f3f4f6; color: #6b7280; }
.lampiran-meta-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06); }
.lampiran-meta-card .lampiran-field { margin-bottom: 16px; }
.lampiran-meta-card .lampiran-field:last-child { margin-bottom: 0; }
.lampiran-meta-list { display: grid; gap: 8px; }
.lampiran-meta-list .icon { font-size: 18px; color: #9ca3af; }
.lampiran-link { color: #2563eb; font-weight: 600; word-break: break-all; }
.lampiran-link:hover { color: #1d4ed8; }
.lampiran-action { font-weight: 600; }
.lampiran-badge-group { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.lampiran-list { display: grid; gap: 32px; }
.lampiran-list .lampiran-block { background: #fff; border: none; border-radius: 0; box-shadow: none; padding: 24px; transition: background-color 0.2s ease; }
.lampiran-list .lampiran-block.lampiran-removed { opacity: 0.6; }
.lampiran-toolbar { padding: 0; }

.progress-card { border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.progress-card .progress-thumb { display: block; background: #f8fafc; border-bottom: 1px solid #e5e7eb; padding: 0; }
.progress-card .progress-thumb .ratio { width: 100%; display: block; }
.progress-card .progress-thumb .ratio-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.progress-card .progress-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.progress-card .card-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 16px; }
.progress-card .card-text { margin-bottom: 0; }
.progress-card .btn { margin-top: auto; }

@media (max-width: 575.98px) {
  .progress-card .progress-thumb .ratio { --bs-aspect-ratio: 56%; }
  .progress-card .progress-thumb .ratio-inner i { font-size: 2.5rem; }
  .progress-card .card-body { padding: 12px 16px 14px; gap: 8px; }
  .progress-card .card-title { font-size: 1rem; }
}

.table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}
.table-sort-link:hover,
.table-sort-link:focus {
  color: inherit;
  text-decoration: none;
}
.table-sort-link .sort-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  line-height: 1;
  color: currentColor;
  transition: opacity 0.2s ease;
}
.table-sort-link .sort-indicator.sort-indicator--inactive {
  opacity: 0.55;
}
.text-center .table-sort-link {
  justify-content: center;
}

.btn-excel {
  background-color: #217346;
  border-color: #217346;
  color: #fff;
}
.btn-excel.dropdown-toggle::after {
  display: none;
}
.btn-excel:hover,
.btn-excel:focus {
  background-color: #195f32;
  border-color: #195f32;
  color: #fff;
}
.btn-excel:active {
  background-color: #144a28;
  border-color: #144a28;
  color: #fff;
}

.btn-excel-dropdown {
  position: relative;
}

.btn-excel-dropdown .dropdown-menu {
  min-width: 220px;
  padding: 0.5rem 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(33, 115, 70, 0.25);
  box-shadow: 0px 12px 32px rgba(17, 24, 39, 0.18);
}

.btn-excel-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
  color: #111827;
  font-weight: 500;
}

.btn-excel-dropdown .dropdown-item i {
  color: #217346;
  font-size: 1rem;
}

.btn-excel-dropdown .dropdown-item:hover,
.btn-excel-dropdown .dropdown-item:focus {
  background-color: rgba(33, 115, 70, 0.08);
  color: #0f172a;
}

.btn-excel-dropdown .dropdown-item:active {
  background-color: rgba(33, 115, 70, 0.15);
  color: #0f172a;
}

.btn-excel-dropdown .dropdown-item-label {
  flex: 1;
}

.btn-excel-chevron {
  font-size: 1rem;
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

.btn-excel[aria-expanded="true"] .btn-excel-chevron {
  transform: rotate(180deg);
}

@media (max-width: 575.98px) {
  .btn-excel-dropdown {
    width: 100%;
  }
  .btn-excel-dropdown .btn-excel {
    width: 100%;
    justify-content: center;
  }
  .btn-excel-dropdown .dropdown-menu {
    left: 50% !important;
    transform: translateX(-50%);
    margin-top: 0.5rem;
  }
}

