/* =========================================================
   ONEPESANTREN UI
   Tema konsisten terinspirasi pola AdminLTE v4
   Letakkan sebagai: css/style.css
========================================================= */

:root {
  --op-primary: #14945f;
  --op-primary-hover: #0f7f50;
  --op-primary-soft: #e9f7f0;
  --op-secondary: #1874c9;
  --op-secondary-hover: #125fa6;
  --op-secondary-soft: #eaf3fc;
  --op-sidebar-bg: #123f4a;
  --op-sidebar-bg-2: #0d313a;
  --op-sidebar-text: #d5e4e7;
  --op-sidebar-muted: #8fb0b6;
  --op-sidebar-hover: rgba(255, 255, 255, 0.09);
  --op-sidebar-active: #14945f;
  --op-body-bg: #f4f6f9;
  --op-surface: #fff;
  --op-surface-soft: #f8fafc;
  --op-border: #dfe5eb;
  --op-text: #243142;
  --op-text-soft: #526173;
  --op-muted: #7b8794;
  --op-success: #198754;
  --op-danger: #dc3545;
  --op-warning: #f59e0b;
  --op-info: #0ea5e9;
  --op-purple: #7c3aed;
  --op-orange: #f97316;
  --op-cyan: #0891b2;
  --op-sidebar-width: 270px;
  --op-sidebar-mini-width: 78px;
  --op-topbar-height: 72px;
  --op-radius: 12px;
  --op-radius-lg: 18px;
  --op-radius-xl: 24px;
  --op-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --op-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --op-transition: 0.25s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--op-text);
  background: var(--op-body-bg);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
[onclick] {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--op-secondary);
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

/* ================= SIDEBAR ================= */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  width: var(--op-sidebar-width);
  height: 100vh;
  height: 100dvh;
  color: var(--op-sidebar-text);
  background:
    radial-gradient(
      circle at top left,
      rgba(32, 180, 126, 0.16),
      transparent 35%
    ),
    linear-gradient(180deg, var(--op-sidebar-bg), var(--op-sidebar-bg-2));
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 8px 0 30px rgba(8, 35, 43, 0.14);
  overflow-x: hidden;
  overflow-y: auto;
  transition:
    width var(--op-transition),
    transform var(--op-transition);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 13px;
  z-index: 3;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.17);
}

.logo {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 17px 22px;
  background: rgba(13, 49, 58, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.logo img {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 5px;
}

.logo h2,
.logo-text strong {
  display: block;
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.35px;
  white-space: nowrap;
}

.logo-text {
  min-width: 0;
}

.logo-text span {
  display: block;
  margin-top: 2px;
  color: var(--op-sidebar-muted);
  font-size: 11px;
  white-space: nowrap;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 16px 12px 26px;
}

.sidebar li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 3px 0;
  padding: 10px 14px;
  color: var(--op-sidebar-text);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  user-select: none;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.sidebar li:not(.sidebar-group-title):hover {
  color: #fff;
  background: var(--op-sidebar-hover);
  transform: translateX(2px);
}

.sidebar li i {
  flex: 0 0 21px;
  width: 21px;
  color: #9fc2c7;
  font-size: 15px;
  text-align: center;
}

.sidebar li:hover i,
.sidebar li.active i {
  color: #fff;
}

.sidebar li.active {
  color: #fff;
  background: linear-gradient(135deg, var(--op-sidebar-active), #0b7f50);
  box-shadow: 0 8px 20px rgba(14, 126, 79, 0.28);
}

.sidebar li.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: #8cf1c4;
  border-radius: 0 3px 3px 0;
}

.sidebar-group-title {
  min-height: auto !important;
  margin: 18px 8px 7px !important;
  padding: 0 7px !important;
  color: #7ea2a9 !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  cursor: default !important;
}

.sidebar-group-title:first-child {
  margin-top: 4px !important;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

/* ================= MAIN / TOPBAR ================= */
.main {
  min-height: 100vh;
  margin-left: var(--op-sidebar-width);
  transition: margin-left var(--op-transition);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--op-topbar-height);
  padding: 12px 26px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--op-border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 14px;
  min-width: 0;
}

.topbar-right {
  gap: 14px;
}

.topbar h1 {
  margin: 0;
  color: var(--op-text);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.45px;
}

.topbar-subtitle {
  min-height: 16px;
  margin: 3px 0 0;
  color: var(--op-muted);
  font-size: 11px;
}

.menu-toggle,
.notification {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--op-text-soft);
  background: var(--op-surface-soft);
  border: 1px solid var(--op-border);
  border-radius: 10px;
  cursor: pointer;
}

.menu-toggle:hover,
.notification:hover {
  color: var(--op-primary);
  background: var(--op-primary-soft);
  border-color: #b9e4cf;
}

.notification {
  position: relative;
}

.notification::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--op-danger);
  border: 2px solid #fff;
  border-radius: 50%;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 5px 6px 5px 9px;
  background: var(--op-surface-soft);
  border: 1px solid var(--op-border);
  border-radius: 12px;
}

.admin-profile > img,
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  color: #fff;
  background: linear-gradient(135deg, var(--op-secondary), var(--op-primary));
  border-radius: 10px;
  object-fit: cover;
}

.profile-info,
.admin-profile > div {
  min-width: 0;
}

.admin-profile h4,
.profile-info h4 {
  max-width: 170px;
  margin: 0;
  overflow: hidden;
  color: var(--op-text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-profile p,
.profile-info p {
  margin: 2px 0 0;
  color: var(--op-muted);
  font-size: 10px;
  line-height: 1.2;
}

.btn-logout-topbar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--op-danger);
  background: #fff1f2;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.btn-logout-topbar:hover {
  color: #fff;
  background: var(--op-danger);
}

/* ================= DASHBOARD ================= */
.dashboard-page {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(250px, 0.7fr);
  align-items: center;
  gap: 28px;
  min-height: 250px;
  margin-bottom: 24px;
  padding: 34px 38px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(
      circle at 85% 20%,
      rgba(255, 255, 255, 0.2),
      transparent 28%
    ),
    linear-gradient(125deg, #1669b2 0%, #118d67 58%, #0b7f50 100%);
  border-radius: var(--op-radius-xl);
  box-shadow: 0 20px 45px rgba(16, 111, 93, 0.2);
}

.dashboard-hero::before,
.dashboard-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.dashboard-hero::before {
  width: 360px;
  height: 360px;
  right: -120px;
  top: -155px;
}

.dashboard-hero::after {
  width: 230px;
  height: 230px;
  right: 100px;
  bottom: -150px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.dashboard-hero h2 {
  max-width: 760px;
  margin: 17px 0 11px;
  color: #fff;
  font-size: clamp(29px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: -1.2px;
}

.dashboard-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.dashboard-hero .btn {
  color: #0d7550;
  background: #fff;
  border-color: #fff;
}

.dashboard-hero .btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.dashboard-hero .btn-secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.25);
}

.dashboard-hero-right {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
}

.hero-circle-main {
  display: grid;
  place-items: center;
  width: 130px;
  height: 130px;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  font-size: 52px;
  box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.05);
}

.hero-mini-card {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--op-text);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 13px;
  box-shadow: var(--op-shadow);
}

.hero-mini-card > i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--op-primary);
  background: var(--op-primary-soft);
  border-radius: 10px;
}

.hero-mini-card strong,
.hero-mini-card span {
  display: block;
}

.hero-mini-card strong {
  font-size: 12px;
}

.hero-mini-card span {
  margin-top: 2px;
  color: var(--op-muted);
  font-size: 9px;
}

/* ================= BUTTON ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  color: #fff;
  background: var(--op-primary);
  border: 1px solid var(--op-primary);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn:hover {
  color: #fff;
  background: var(--op-primary-hover);
  border-color: var(--op-primary-hover);
  box-shadow: 0 7px 16px rgba(20, 148, 95, 0.18);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  color: var(--op-secondary);
  background: var(--op-secondary-soft);
  border-color: #c9def3;
}

.btn-secondary:hover {
  color: #fff;
  background: var(--op-secondary);
  border-color: var(--op-secondary);
}

.btn-danger {
  color: #fff;
  background: var(--op-danger);
  border-color: var(--op-danger);
}

.btn-warning {
  color: #3b2a00;
  background: var(--op-warning);
  border-color: var(--op-warning);
}

.btn-light {
  color: var(--op-text-soft);
  background: #fff;
  border-color: var(--op-border);
}

/* ================= QUICK MENU ================= */
.quick-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.quick-menu-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 19px;
  background: var(--op-surface);
  border: 1px solid var(--op-border);
  border-radius: var(--op-radius-lg);
  box-shadow: var(--op-shadow-sm);
  cursor: pointer;
  transition: 0.2s ease;
}

.quick-menu-card:hover {
  border-color: #c6d5df;
  box-shadow: var(--op-shadow);
  transform: translateY(-3px);
}

.quick-icon,
.panel-icon,
.mini-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 18px;
}

.quick-menu-card h3 {
  margin: 0;
  color: var(--op-text);
  font-size: 14px;
  font-weight: 750;
}

.quick-menu-card p {
  margin: 4px 0 0;
  color: var(--op-muted);
  font-size: 11px;
}

.green {
  color: var(--op-success) !important;
  background: #eaf7ef !important;
}

.blue {
  color: var(--op-secondary) !important;
  background: var(--op-secondary-soft) !important;
}

.orange {
  color: var(--op-orange) !important;
  background: #fff1e8 !important;
}

.red {
  color: var(--op-danger) !important;
  background: #fff0f2 !important;
}

.purple {
  color: var(--op-purple) !important;
  background: #f2edff !important;
}

.cyan {
  color: var(--op-cyan) !important;
  background: #e8f8fb !important;
}

/* ================= PANELS ================= */
.dashboard-panel {
  margin-bottom: 24px;
  padding: 23px;
  background: var(--op-surface);
  border: 1px solid var(--op-border);
  border-radius: var(--op-radius-lg);
  box-shadow: var(--op-shadow-sm);
}

.panel-header,
.table-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-header {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #edf0f3;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.panel-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 17px;
}

.panel-title h2,
.table-block-header h2 {
  margin: 0;
  color: var(--op-text);
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.25px;
}

.panel-title p,
.table-block-header p {
  margin: 4px 0 0;
  color: var(--op-muted);
  font-size: 11px;
}

.panel-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.panel-filter input,
.panel-filter select {
  min-height: 40px;
  padding: 8px 11px;
  color: var(--op-text-soft);
  background: #fff;
  border: 1px solid var(--op-border);
  border-radius: 9px;
  outline: none;
}

.panel-filter input:focus,
.panel-filter select:focus {
  border-color: var(--op-primary);
  box-shadow: 0 0 0 3px rgba(20, 148, 95, 0.1);
}

/* ================= STAT CARDS ================= */
.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.dashboard-stat-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stat-card {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 132px;
  padding: 17px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--op-border);
  border-top: 3px solid var(--op-primary);
  border-radius: 13px;
  box-shadow: var(--op-shadow-sm);
}

.dashboard-stat-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -20px;
  bottom: -28px;
  width: 90px;
  height: 90px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.055;
}

.dashboard-stat-card h3 {
  margin: 0 0 8px;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-stat-card p {
  margin: 0;
  color: var(--op-text);
  font-size: clamp(18px, 1.6vw, 25px);
  font-weight: 800;
  line-height: 1.15;
  word-break: break-word;
}

.dashboard-stat-card span {
  display: block;
  margin-top: 7px;
  color: var(--op-muted);
  font-size: 9px;
}

.dashboard-stat-card > i {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 24px;
  opacity: 0.75;
}

.stat-green {
  color: var(--op-success);
  border-top-color: var(--op-success);
}

.stat-red {
  color: var(--op-danger);
  border-top-color: var(--op-danger);
}

.stat-blue {
  color: var(--op-secondary);
  border-top-color: var(--op-secondary);
}

.stat-purple {
  color: var(--op-purple);
  border-top-color: var(--op-purple);
}

.stat-orange {
  color: var(--op-orange);
  border-top-color: var(--op-orange);
}

/* ================= MINI CARDS ================= */
.dashboard-mini-operasional {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.mini-operasional-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  background: var(--op-surface-soft);
  border: 1px solid var(--op-border);
  border-radius: 13px;
}

.mini-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 15px;
}

.mini-operasional-card h3 {
  margin: 0;
  color: var(--op-muted);
  font-size: 10px;
  font-weight: 700;
}

.mini-operasional-card p {
  margin: 4px 0 0;
  color: var(--op-text);
  font-size: 17px;
  font-weight: 800;
}

/* ================= TABLES ================= */
.table-block {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--op-border);
  border-radius: 14px;
}

.table-block-header {
  padding: 16px 18px;
  background: var(--op-surface-soft);
  border-bottom: 1px solid var(--op-border);
}

.table-container {
  width: 100%;
  overflow-x: auto;
  background: #fff;
}

.table-container::-webkit-scrollbar {
  height: 7px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #cbd5df;
  border-radius: 999px;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

thead {
  background: #f5f7f9;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #ebeff3;
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #4f5d6c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

td {
  color: var(--op-text-soft);
  font-size: 11px;
}

tbody tr {
  transition: background 0.16s ease;
}

tbody tr:hover {
  background: #f8fbfa;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ================= GENERIC FORM ================= */
input,
select,
textarea {
  color: var(--op-text);
  background: #fff;
  border: 1px solid var(--op-border);
  border-radius: 9px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--op-primary);
  box-shadow: 0 0 0 3px rgba(20, 148, 95, 0.1);
}

.form-control {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
}

textarea.form-control {
  min-height: 105px;
  resize: vertical;
}

/* ================= DESKTOP MINI SIDEBAR ================= */
@media (min-width: 769px) {
  body.sidebar-collapsed .sidebar {
    width: var(--op-sidebar-mini-width);
  }

  body.sidebar-collapsed .main {
    margin-left: var(--op-sidebar-mini-width);
  }

  body.sidebar-collapsed .logo {
    justify-content: center;
    padding-left: 12px;
    padding-right: 12px;
  }

  body.sidebar-collapsed .logo img {
    width: 44px;
    height: 44px;
  }

  body.sidebar-collapsed .logo h2,
  body.sidebar-collapsed .logo-text {
    display: none;
  }

  body.sidebar-collapsed .sidebar ul {
    padding-left: 10px;
    padding-right: 10px;
  }

  body.sidebar-collapsed .sidebar-group-title {
    display: none !important;
  }

  body.sidebar-collapsed .sidebar li:not(.sidebar-group-title) {
    justify-content: center;
    gap: 0;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 0;
  }

  body.sidebar-collapsed .sidebar li i {
    flex-basis: auto;
    width: auto;
    font-size: 17px;
  }

  body.sidebar-collapsed .sidebar li.active::before {
    left: -10px;
  }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1280px) {
  .dashboard-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-stat-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .quick-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: min(86vw, 300px);
    transform: translateX(-105%);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .sidebar-close {
    display: grid;
    place-items: center;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    min-height: 66px;
    padding: 10px 14px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar-subtitle {
    display: none;
  }

  .notification {
    display: none;
  }

  .admin-profile {
    background: transparent;
    border: 0;
    padding: 0;
  }

  .profile-info,
  .admin-profile > div:not(.profile-avatar) {
    display: none;
  }

  .btn-logout-topbar {
    width: 38px;
    height: 38px;
  }

  .dashboard-page {
    padding: 15px;
  }

  .dashboard-hero {
    display: block;
    min-height: auto;
    padding: 25px 22px;
    border-radius: 18px;
  }

  .dashboard-hero-right {
    display: none;
  }

  .dashboard-hero h2 {
    font-size: 29px;
  }

  .quick-menu-grid,
  .dashboard-stat-grid,
  .dashboard-stat-grid.four,
  .dashboard-mini-operasional {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-filter {
    width: 100%;
  }

  .panel-filter input,
  .panel-filter select {
    flex: 1 1 160px;
  }

  .dashboard-panel {
    padding: 17px;
    border-radius: 15px;
  }
}

@media (max-width: 520px) {
  .dashboard-hero h2 {
    font-size: 25px;
  }

  .dashboard-hero p {
    font-size: 12px;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .quick-menu-grid,
  .dashboard-stat-grid,
  .dashboard-stat-grid.four,
  .dashboard-mini-operasional {
    grid-template-columns: 1fr;
  }

  .quick-menu-card {
    padding: 15px;
  }

  .dashboard-stat-card {
    min-height: 112px;
  }

  .panel-title {
    align-items: flex-start;
  }

  .panel-filter .btn {
    flex: 1 1 100%;
  }

  .topbar-right {
    gap: 6px;
  }
}

@media print {
  .sidebar,
  .sidebar-backdrop,
  .topbar,
  .no-print {
    display: none !important;
  }

  .main {
    margin-left: 0 !important;
  }

  body {
    background: #fff !important;
  }

  .dashboard-page {
    max-width: none;
    padding: 0;
  }

  .dashboard-panel,
  .table-block {
    box-shadow: none !important;
    break-inside: avoid;
  }
}

/* ==================================================
   CONTENT HEADER — GAYA ADMINLTE ONEPESANTREN
================================================== */

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  margin-bottom: 22px;
  padding: 4px 2px;
}

.content-header-left {
  display: flex;
  align-items: center;
  gap: 14px;

  min-width: 0;
}

.page-icon {
  display: grid;
  place-items: center;

  flex: 0 0 48px;

  width: 48px;
  height: 48px;

  color: #ffffff;

  background: linear-gradient(135deg, var(--op-secondary), var(--op-primary));

  border-radius: 12px;

  box-shadow: 0 8px 20px rgba(20, 148, 95, 0.18);

  font-size: 18px;
}

.content-header h2 {
  margin: 0;

  color: var(--op-text);

  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.4px;
}

.content-header p {
  margin: 4px 0 0;

  color: var(--op-muted);

  font-size: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;

  padding: 9px 12px;

  background: #ffffff;

  border: 1px solid var(--op-border);
  border-radius: 9px;

  box-shadow: var(--op-shadow-sm);

  color: var(--op-muted);

  font-size: 11px;
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  color: var(--op-secondary);

  font-weight: 650;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--op-secondary-hover);
}

.breadcrumb > i {
  color: #a2adb9;
  font-size: 8px;
}

.breadcrumb span {
  color: var(--op-text-soft);
  font-weight: 650;
}

@media (max-width: 768px) {
  .content-header {
    align-items: flex-start;
    flex-direction: column;

    margin-bottom: 17px;
  }

  .page-icon {
    flex-basis: 42px;

    width: 42px;
    height: 42px;

    font-size: 16px;
  }

  .content-header h2 {
    font-size: 19px;
  }

  .breadcrumb {
    width: 100%;
  }
}

/* ==========================================================
   KONFIRMASI TOP UP WALI — TAMPILAN ADMIN
========================================================== */

.page-konfirmasi-topup .topup-santri-cell,
.page-konfirmasi-topup .topup-rekening-cell,
.page-konfirmasi-topup .topup-pengirim-cell,
.page-konfirmasi-topup .topup-nominal-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;

  min-width: 0;
}

.page-konfirmasi-topup .topup-santri-cell strong,
.page-konfirmasi-topup .topup-rekening-cell strong,
.page-konfirmasi-topup .topup-pengirim-cell strong,
.page-konfirmasi-topup .topup-nominal-cell strong {
  color: #1f2f3b;

  font-size: 12px;
  font-weight: 900;
}

.page-konfirmasi-topup .topup-santri-cell span,
.page-konfirmasi-topup .topup-rekening-cell span,
.page-konfirmasi-topup .topup-pengirim-cell span,
.page-konfirmasi-topup .topup-nominal-cell span {
  color: #687986;

  font-size: 9px;
}

.page-konfirmasi-topup .topup-santri-cell small,
.page-konfirmasi-topup .topup-rekening-cell small,
.page-konfirmasi-topup .topup-pengirim-cell small,
.page-konfirmasi-topup .topup-nominal-cell small {
  color: #81909a;

  font-size: 8px;
}

.page-konfirmasi-topup .topup-rekening-cell strong {
  color: #176f91;
}

.page-konfirmasi-topup .topup-nominal-cell small {
  color: #087458;

  font-weight: 850;
}

/* ==========================================================
   POPUP DETAIL
========================================================== */

.topup-admin-detail-popup,
.topup-admin-confirm-popup {
  border-radius: 22px !important;
}

.topup-admin-detail-container,
.topup-admin-confirm-container {
  overflow-x: hidden !important;
}

.detail-topup-admin {
  display: flex;
  flex-direction: column;
  gap: 12px;

  color: #263844;

  text-align: left;
}

.topup-detail-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;

  padding: 12px 14px;

  background: #f5f8fa;

  border: 1px solid #e0e8ed;
  border-radius: 12px;
}

.topup-detail-status > span {
  color: #647682;

  font-size: 10px;
  font-weight: 800;
}

.topup-detail-section {
  padding: 15px;

  background: #ffffff;

  border: 1px solid #dee7ec;
  border-radius: 14px;
}

.topup-detail-section.rekening {
  background: #eef7fb;
  border-color: #cce2ec;
}

.topup-detail-section.catatan-admin {
  background: #fff7e7;
  border-color: #edd7a5;
}

.topup-detail-section-title {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-bottom: 13px;
}

.topup-detail-section-title > i {
  display: grid;
  place-items: center;

  flex: 0 0 37px;

  width: 37px;
  height: 37px;

  color: #176f91;
  background: #e7f2f7;

  border-radius: 11px;
}

.topup-detail-section-title strong {
  display: block;

  color: #263844;

  font-size: 11px;
  font-weight: 900;
}

.topup-detail-section-title span {
  display: block;

  margin-top: 2px;

  color: #758590;

  font-size: 8px;
}

.topup-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.topup-detail-grid > div {
  padding: 10px 11px;

  background: #f7f9fa;

  border-radius: 10px;
}

.topup-detail-grid > div.full {
  grid-column: 1 / -1;
}

.topup-detail-grid span,
.topup-detail-nominal-grid span {
  display: block;

  margin-bottom: 4px;

  color: #758590;

  font-size: 8px;
}

.topup-detail-grid strong,
.topup-detail-nominal-grid strong {
  display: block;

  color: #263844;

  font-size: 10px;
  font-weight: 900;
}

.topup-detail-rekening {
  display: flex;
  align-items: center;
  gap: 13px;

  padding: 13px;

  color: #ffffff;

  background: linear-gradient(135deg, #176f91, #315eb0);

  border-radius: 13px;
}

.topup-detail-bank-icon {
  display: grid;
  place-items: center;

  flex: 0 0 48px;

  width: 48px;
  height: 48px;

  background: rgba(255, 255, 255, 0.14);

  border-radius: 13px;
}

.topup-detail-rekening span,
.topup-detail-rekening small {
  display: block;

  color: rgba(255, 255, 255, 0.72);

  font-size: 8px;
}

.topup-detail-rekening strong {
  display: block;

  margin-top: 3px;

  font-size: 12px;
}

.topup-detail-rekening b {
  display: block;

  margin: 4px 0;

  font-size: 18px;
  letter-spacing: 0.6px;
}

.topup-detail-nominal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;

  margin-top: 12px;
}

.topup-detail-nominal-grid > div {
  padding: 12px;

  background: #f4f7f9;

  border: 1px solid #e0e8ed;
  border-radius: 10px;
}

.topup-detail-nominal-grid > div.saldo-masuk {
  background: #eaf8f2;
  border-color: #c7e8d8;
}

.topup-detail-nominal-grid .saldo-masuk strong {
  color: #087458;
}

.topup-detail-note {
  padding: 11px 12px;

  color: #526775;
  background: #f5f8fa;

  border-radius: 10px;

  font-size: 9px;
  line-height: 1.6;
}

.bukti-topup-box {
  text-align: center;
}

.topup-bukti-link {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;

  color: #176f91;

  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.bukti-topup-img {
  display: block;

  width: 100%;
  max-height: 430px;

  object-fit: contain;

  background: #f3f6f8;

  border: 1px solid #dce5ea;
  border-radius: 13px;
}

.topup-bukti-kosong {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;

  padding: 27px;

  color: #8a5d00;
  background: #fff6df;

  border: 1px dashed #e5c46f;
  border-radius: 12px;
}

.topup-bukti-kosong i {
  font-size: 25px;
}

.topup-bukti-kosong strong {
  font-size: 11px;
}

.topup-bukti-kosong span {
  max-width: 430px;

  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

.topup-detail-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  padding: 12px 13px;

  color: #825600;
  background: #fff5dc;

  border: 1px solid #eccf87;
  border-radius: 12px;
}

.topup-detail-warning > i {
  margin-top: 2px;
}

.topup-detail-warning strong {
  display: block;

  margin-bottom: 3px;

  font-size: 10px;
}

.topup-detail-warning span {
  display: block;

  font-size: 8px;
  line-height: 1.5;
}

/* ==========================================================
   POPUP KONFIRMASI
========================================================== */

.topup-confirm-wrapper {
  color: #263844;

  text-align: left;
}

.topup-confirm-warning {
  display: flex;
  align-items: flex-start;
  gap: 11px;

  margin-bottom: 13px;
  padding: 13px;

  color: #805300;
  background: #fff4d8;

  border: 1px solid #ebcb79;
  border-radius: 12px;
}

.topup-confirm-warning > i {
  display: grid;
  place-items: center;

  flex: 0 0 35px;

  width: 35px;
  height: 35px;

  background: rgba(216, 144, 22, 0.13);

  border-radius: 10px;
}

.topup-confirm-warning strong {
  display: block;

  margin-bottom: 3px;

  font-size: 10px;
}

.topup-confirm-warning span {
  display: block;

  font-size: 8px;
  line-height: 1.55;
}

.topup-confirm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr);
  gap: 12px;
}

.topup-confirm-data {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.topup-confirm-santri,
.topup-confirm-rekening,
.topup-confirm-pengirim {
  padding: 12px;

  background: #f5f8fa;

  border: 1px solid #e0e8ed;
  border-radius: 11px;
}

.topup-confirm-rekening {
  color: #ffffff;

  background: linear-gradient(135deg, #176f91, #315eb0);

  border: 0;
}

.topup-confirm-santri span,
.topup-confirm-pengirim span {
  display: block;

  color: #748590;

  font-size: 8px;
}

.topup-confirm-rekening span,
.topup-confirm-rekening small {
  display: block;

  color: rgba(255, 255, 255, 0.72);

  font-size: 8px;
}

.topup-confirm-santri strong,
.topup-confirm-pengirim strong,
.topup-confirm-rekening strong {
  display: block;

  margin-top: 4px;

  font-size: 11px;
  font-weight: 900;
}

.topup-confirm-santri small {
  display: block;

  margin-top: 3px;

  color: #7c8b96;

  font-size: 8px;
}

.topup-confirm-rekening b {
  display: block;

  margin: 5px 0;

  font-size: 17px;
  letter-spacing: 0.5px;
}

.topup-confirm-nominal {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.topup-confirm-nominal > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 11px;

  background: #f5f8fa;

  border: 1px solid #e0e8ed;
  border-radius: 10px;
}

.topup-confirm-nominal > div.saldo-masuk {
  background: #eaf8f2;
  border-color: #c8e9d8;
}

.topup-confirm-nominal span {
  color: #748590;

  font-size: 8px;
}

.topup-confirm-nominal strong {
  color: #263844;

  font-size: 10px;
}

.topup-confirm-nominal .saldo-masuk strong {
  color: #087458;
}

.topup-confirm-bukti {
  padding: 11px;

  background: #f5f8fa;

  border: 1px solid #e0e8ed;
  border-radius: 12px;
}

.topup-confirm-bukti-title {
  display: block;

  margin-bottom: 9px;

  color: #415865;

  font-size: 9px;
  font-weight: 900;
}

.topup-confirm-bukti .bukti-topup-img {
  max-height: 330px;
}

.topup-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  margin-top: 13px;
  padding: 13px;

  background: #eaf8f2;

  border: 1px solid #c7e7d7;
  border-radius: 11px;

  cursor: pointer;
}

.topup-confirm-check input {
  width: 19px;
  height: 19px;
  margin-top: 1px;

  accent-color: #16a34a;
}

.topup-confirm-check strong {
  display: block;

  color: #17603e;

  font-size: 10px;
}

.topup-confirm-check small {
  display: block;

  margin-top: 3px;

  color: #567c69;

  font-size: 8px;
}

/* ==========================================================
   SUKSES
========================================================== */

.topup-success-admin {
  text-align: left;
}

.topup-success-icon {
  display: grid;
  place-items: center;

  width: 58px;
  height: 58px;
  margin: 0 auto 13px;

  color: #ffffff;
  background: #16a34a;

  border-radius: 50%;

  font-size: 25px;
}

.topup-success-santri {
  margin-bottom: 13px;

  text-align: center;
}

.topup-success-santri span {
  display: block;

  color: #748590;

  font-size: 9px;
}

.topup-success-santri strong {
  display: block;

  margin-top: 4px;

  color: #263844;

  font-size: 15px;
}

.topup-success-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.topup-success-grid > div {
  padding: 11px;

  background: #f5f8fa;

  border: 1px solid #e0e8ed;
  border-radius: 10px;
}

.topup-success-grid > div.saldo {
  background: #eaf8f2;
  border-color: #c6e7d6;
}

.topup-success-grid span {
  display: block;

  margin-bottom: 4px;

  color: #758590;

  font-size: 8px;
}

.topup-success-grid strong {
  display: block;

  color: #263844;

  font-size: 11px;
  font-weight: 900;
}

.topup-success-grid .saldo strong {
  color: #087458;
}

.topup-success-fee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;

  margin-top: 10px;
  padding: 10px;

  color: #607481;
  background: #eef4f7;

  border-radius: 9px;

  font-size: 8px;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 700px) {
  .topup-admin-detail-popup,
  .topup-admin-confirm-popup {
    width: calc(100% - 18px) !important;

    border-radius: 18px !important;
  }

  .topup-detail-grid,
  .topup-detail-nominal-grid {
    grid-template-columns: 1fr;
  }

  .topup-detail-grid > div.full {
    grid-column: auto;
  }

  .topup-confirm-layout {
    grid-template-columns: 1fr;
  }

  .topup-confirm-bukti .bukti-topup-img {
    max-height: 290px;
  }

  .topup-success-grid {
    grid-template-columns: 1fr;
  }

  .topup-success-fee {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ==========================================================
   MASTER PRODUK — PRODUK TANPA STOK
========================================================== */

.page-master-produk .produk-ringkasan-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.page-master-produk .produk-ringkasan-card.purple {
  color: #5b42a7;
  background: #f0edff;

  border-color: #ddd7fa;
}

.page-master-produk #stokProduk:disabled {
  color: #718096;
  background: #eef2f5;

  border-color: #d8e1e7;

  cursor: not-allowed;
}

.page-master-produk .master-produk-stock-info {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-top: 12px;
  padding: 11px 13px;

  color: #155f81;
  background: #eaf5fa;

  border: 1px solid #cae2ed;
  border-radius: 11px;

  font-size: 11px;
  font-weight: 650;
  line-height: 1.5;
}

.page-master-produk .master-produk-stock-info.is-tanpa-stok {
  color: #5b42a7;
  background: #f0edff;

  border-color: #ddd7fa;
}

.page-master-produk .product-stock-badge.tanpa-stok {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  color: #5b42a7;
  background: #f0edff;

  border: 1px solid #ddd7fa;
}

.page-master-produk .product-stock-note {
  display: block;

  max-width: 180px;
  margin-top: 6px;

  color: #7a8994;

  font-size: 10px;
  line-height: 1.45;
}

.page-master-produk #kodeProduk {
  text-transform: uppercase;
}

@media (max-width: 1250px) {
  .page-master-produk .produk-ringkasan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .page-master-produk .produk-ringkasan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-master-produk .master-produk-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .page-master-produk .produk-ringkasan-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   STRUK THERMAL ONEPESANTREN — 58 MM
========================================================== */

#thermalPrintArea {
  display: none;
}

@media print {
    /* Aturan print standar (jika ada) */
}

/* --- TATA LETAK TUJUAN SURAT (KEPADA YTH) --- */
.summons-letter-recipient {
    margin-left: 0 !important;
    text-align: left !important;
    width: 100% !important;
    padding-top: 15px; /* Memberi sedikit jarak dari tabel Perihal di atasnya */
}

/* Merapatkan spasi antar baris pada blok Kepada Yth */
.summons-letter-recipient p {
    margin: 0 0 3px 0 !important;
}

/* Action Button Mail */
.action-btn.mail {
    color: #6366f1 !important;
    background: #f0f1ff !important;
}
