/* ==========================================================================
   LEXCORP LEGAL & HR — ADMIN PORTAL STYLESHEET (v5 - Legal & Absensi)
   ========================================================================== */

:root {
  --bg-page: #F3F5F9;
  --bg-surface: #FFFFFF;
  --bg-sidebar: #F8FAFC;
  --bg-pill-active: #E2E8F2;
  --bg-hover: #EDF1F7;
  --border-subtle: #DCE3EC;
  --border-strong: #C3CEDA;

  --gold-primary: #1E3A5F;
  --gold-dark: #142842;
  --gold-light: #3B6998;
  --gold-soft: rgba(30, 58, 95, 0.12);

  --text-primary: #131C2B;
  --text-secondary: #4E5D73;
  --text-muted: #7C8B9E;

  --success-bg: #E6F4EA;
  --success-text: #1E6E3D;
  --warning-bg: #FEF3C7;
  --warning-text: #92400E;
  --danger-bg: #FEE2E2;
  --danger-text: #B91C1C;
  --info-bg: #E0F2FE;
  --info-text: #075985;

  --sidebar-width: 248px;
  --topbar-height: 60px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(19, 28, 43, 0.04);
  --shadow-md: 0 8px 24px rgba(19, 28, 43, 0.08);
  --shadow-drawer: 8px 0 32px rgba(15, 23, 42, 0.18);
}

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

html, body {
  min-height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ==========================================================================
   FIXED STACKING CONTEXT: SIDEBAR OVERLAY (z-index: 998) & SIDEBAR (z-index: 999)
   Sidebar berada di luar .main-wrapper & .topbar agar tidak pernah terhalang
   ========================================================================== */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background:
    radial-gradient(circle at 92% 4%, rgba(59, 105, 152, 0.14) 0%, rgba(59, 105, 152, 0) 44%),
    radial-gradient(circle at 8% 96%, rgba(30, 58, 95, 0.11) 0%, rgba(30, 58, 95, 0) 48%),
    linear-gradient(172deg, #FFFFFF 0%, #F4F7FB 54%, #E8EEF6 100%);
  border-right: 1px solid #CBD5E1;
  box-shadow: 4px 0 24px rgba(19, 28, 43, 0.05);
  z-index: 999; /* Selalu di atas .sidebar-overlay (998) */
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid rgba(203, 213, 225, 0.65);
  flex-shrink: 0;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2B5282 0%, var(--gold-dark) 100%);
  color: #FFFDF9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: 0 4px 10px rgba(20, 40, 66, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-text span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-close-btn {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-close-btn:hover {
  background: #FFFFFF;
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(30, 58, 95, 0.22);
  border-radius: 999px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.26);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12.5px;
  line-height: 1.35;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(203, 213, 225, 0.75);
  color: var(--text-primary);
  box-shadow: 0 3px 10px rgba(19, 28, 43, 0.045);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, #FFFFFF 0%, #E7EEF8 100%);
  border-color: rgba(59, 105, 152, 0.55);
  color: var(--gold-dark);
  font-weight: 600;
  box-shadow:
    0 4px 12px rgba(30, 58, 95, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(203, 213, 225, 0.65);
  box-shadow: 0 1px 3px rgba(19, 28, 43, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-item:hover .nav-icon {
  background: #FFFFFF;
  border-color: var(--gold-light);
  color: var(--gold-dark);
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.11);
}

.nav-item.active .nav-icon {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  border-color: transparent;
  color: #FFFDF9;
  box-shadow: 0 3px 8px rgba(20, 40, 66, 0.28);
}

.nav-icon i {
  width: 14px;
  height: 14px;
  font-size: 14px;
}

.nav-chevron {
  width: 14px;
  height: 14px;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.22s ease, color 0.18s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-item.active .nav-chevron {
  color: var(--gold-dark);
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 3px 0 4px 22px;
  padding: 2px 0 2px 10px;
  border-left: 1.5px solid rgba(59, 105, 152, 0.35);
}

.nav-group.open .nav-submenu {
  display: flex;
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.18s ease;
}

.nav-subitem::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.nav-subitem:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(203, 213, 225, 0.6);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-subitem:hover::before {
  background: var(--gold-primary);
}

.nav-subitem.active {
  background: linear-gradient(135deg, #FFFFFF 0%, #E6EDF7 100%);
  border-color: rgba(59, 105, 152, 0.5);
  color: var(--gold-dark);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.nav-subitem.active::before {
  background: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.18);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(203, 213, 225, 0.7);
  background: rgba(232, 238, 246, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-profile-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(244, 247, 251, 0.9) 100%);
  border: 1px solid rgba(203, 213, 225, 0.75);
  box-shadow: 0 2px 8px rgba(19, 28, 43, 0.04);
}

.admin-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #FFFDF9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  box-shadow: 0 2px 6px rgba(20, 40, 66, 0.24);
  flex-shrink: 0;
}

.admin-info strong {
  display: block;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.2;
}

.admin-info span {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.btn-logout {
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid #F1C4C4;
  background: linear-gradient(180deg, #FFFDFD 0%, #FFF2F2 100%);
  color: var(--danger-text);
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(185, 28, 28, 0.06);
  transition: all 0.18s ease;
}

.btn-logout:hover {
  background: linear-gradient(180deg, #FEE2E2 0%, #FECACA 100%);
  border-color: #FCA5A5;
  box-shadow: 0 3px 8px rgba(185, 28, 28, 0.12);
}

.sidebar-close-btn i {
  font-size: 16px;
}

.btn-logout i {
  font-size: 15px;
}

/* ==========================================================================
   MAIN SHELL & TOPBAR
   ========================================================================== */

.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-brand-mobile {
  display: none;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-brand-mobile .brand-icon {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.topbar-brand-mobile .brand-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb span.current {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 6px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-user-pill .mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-pill-active);
  color: var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.burger-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.burger-btn:hover {
  background: var(--bg-hover);
  border-color: var(--gold-primary);
}

/* ==========================================================================
   CONTENT CONTAINER, HEADERS, CARDS & BUTTONS
   ========================================================================== */

.content {
  padding: 18px 22px;
  max-width: 1340px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-title-group h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.page-title-group p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s;
}

.btn-icon svg {
  width: 13.5px;
  height: 13.5px;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--gold-dark);
  border-color: var(--gold-light);
}

.btn-icon.danger:hover {
  background: #FEE2E2;
  color: var(--danger-text);
  border-color: #FCA5A5;
}

/* KPI Grid (Proportional & Compact) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.kpi-card:hover {
  border-color: #B8C6D8;
  box-shadow: 0 4px 14px rgba(19, 28, 43, 0.05);
  transform: translateY(-1px);
}

.kpi-meta {
  min-width: 0;
  flex: 1;
}

.kpi-meta span {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-meta strong {
  display: block;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 3px 0 2px;
}

.kpi-meta small {
  display: block;
  font-size: 10.5px;
  color: var(--success-text);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-meta small.is-neutral {
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #EEF3FA 0%, #DCE6F4 100%);
  border: 1px solid rgba(203, 213, 225, 0.75);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-box svg {
  width: 17px;
  height: 17px;
}

/* Panel & Table (Compact & Minimalist) */
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-box input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--gold-primary);
  background: var(--bg-surface);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.data-table th {
  padding: 9px 13px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: #F6F8FC;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12.2px;
  line-height: 1.4;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table td strong {
  font-weight: 600;
}

.data-table tbody tr:hover {
  background: #F9FBFD;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Fixed (Sticky Right) Action Column */
.data-table th.col-action,
.data-table td.col-action {
  position: sticky;
  right: 0;
  width: 82px;
  min-width: 82px;
  border-left: 1px solid var(--border-subtle);
  text-align: center;
  transition: box-shadow 0.18s ease, background-color 0.16s ease;
}

.data-table th.col-action {
  z-index: 3;
  background: #F6F8FC;
}

.data-table td.col-action {
  z-index: 2;
  background: var(--bg-surface);
}

.data-table tbody tr:hover td.col-action {
  background: #F9FBFD;
}

.table-responsive.has-scroll-right .data-table th.col-action,
.table-responsive.has-scroll-right .data-table td.col-action {
  box-shadow: -6px 0 14px -4px rgba(19, 28, 43, 0.11);
}

.data-table td.col-action .action-group {
  justify-content: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.badge-info    { background: var(--info-bg);    color: var(--info-text); }

.action-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Universal Pagination */
.pagination-bar {
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: #F6F8FC;
}

.pagination-info {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.16s;
}

.page-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--gold-primary);
}

.page-btn.active {
  background: var(--gold-primary);
  color: #FFFFFF;
  border-color: var(--gold-primary);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================================================
   DEDICATED FORM WORKSPACE (SOFT, MINIMALIST & PROPORTIONAL)
   ========================================================================== */

.form-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(265px, 0.95fr);
  gap: 18px;
  align-items: start;
  max-width: 1120px;
}

.form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.form-card-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #FFFFFF 0%, #EFF4FA 100%);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.form-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #FFFDF9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(20, 40, 66, 0.22);
  flex-shrink: 0;
}

.form-card-header-left h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.form-card-header-left p {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.form-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(59, 105, 152, 0.45);
  color: var(--gold-dark);
}

.form-mode-pill .mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-primary);
}

.form-mode-pill.is-edit {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

.form-mode-pill.is-edit .mode-dot {
  background: #2563EB;
}

.form-card-body {
  padding: 18px 20px;
}

.form-section-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-primary);
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border-subtle);
}

.form-section-label.mt-section {
  margin-top: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.form-group label {
  font-size: 11.8px;
  font-weight: 600;
  color: #26354A;
  line-height: 1.3;
}

.form-group label .req-star {
  color: #C2410C;
  margin-left: 2px;
}

.field-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-control {
  width: 100%;
  height: 35px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid #D5DEE9;
  background: #F9FBFD;
  color: var(--text-primary);
  font-size: 12.2px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

textarea.form-control {
  height: auto;
  min-height: 76px;
  padding: 8px 11px;
  resize: vertical;
}

.form-control::placeholder {
  color: #8A99AD;
  font-size: 11.8px;
}

.form-control:hover {
  border-color: #AEBECD;
  background: #FFFFFF;
}

.form-control:focus {
  border-color: var(--gold-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.10);
}

.form-actions {
  padding: 12px 20px;
  background: #F6F8FC;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.form-actions-note {
  font-size: 11px;
  color: var(--text-muted);
}

.form-actions-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.form-actions .btn,
.page-header .btn-compact {
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: 8px;
}

/* Right Side Panel: Live Preview & Tips */
.form-side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-preview-card,
.form-tips-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.side-card-head {
  padding: 11px 15px;
  background: #F6F8FC;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.side-card-head span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.live-pulse-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--success-text);
  background: var(--success-bg);
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.live-pulse-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #16A34A;
}

.preview-card-body {
  padding: 14px 15px;
}

.preview-highlight-box {
  padding: 12px;
  border-radius: 9px;
  background: linear-gradient(135deg, #FFFFFF 0%, #EDF2F9 100%);
  border: 1px solid rgba(203, 213, 225, 0.75);
  margin-bottom: 12px;
}

.preview-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.preview-code-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-dark);
}

.preview-main-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.preview-meta-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.preview-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #EAEFF6;
  font-size: 11.5px;
}

.preview-meta-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.preview-meta-row span {
  color: var(--text-muted);
  flex-shrink: 0;
}

.preview-meta-row strong {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.tips-list {
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: none;
}

.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.tips-list li svg {
  width: 14px;
  height: 14px;
  color: var(--gold-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==========================================================================
   SOFT MINIMALIST SELECT2 COMPONENT (.hs2-*)
   ========================================================================== */

.hs2-hidden-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none;
}

.hs2-container {
  position: relative;
  width: 100%;
  display: block;
}

.hs2-selection {
  width: 100%;
  height: 35px;
  padding: 0 30px 0 11px;
  border-radius: 8px;
  border: 1px solid #D5DEE9;
  background: #F9FBFD;
  color: var(--text-primary);
  font-size: 12.2px;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.hs2-selection:hover {
  border-color: #AEBECD;
  background: #FFFFFF;
}

.hs2-container.is-open .hs2-selection,
.hs2-selection:focus {
  border-color: var(--gold-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.10);
}

.hs2-container.is-disabled .hs2-selection {
  opacity: 0.6;
  cursor: not-allowed;
  background: #F3EFE6;
}

.hs2-selection-rendered {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.hs2-selection-rendered.is-placeholder {
  color: #8A99AD;
}

.hs2-selection-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  color: var(--text-muted);
  transition: all 0.14s ease;
}

.hs2-selection-clear:hover {
  background: #E2E8F2;
  color: var(--text-primary);
}

.hs2-selection-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
  transition: transform 0.18s ease, color 0.16s ease;
}

.hs2-container.is-open .hs2-selection-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: var(--gold-primary);
}

.hs2-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 1050;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(19, 28, 43, 0.12);
  display: none;
  overflow: hidden;
  animation: hs2FadeIn 0.14s ease-out;
}

.hs2-container.open-above .hs2-dropdown {
  top: auto;
  bottom: calc(100% + 5px);
}

.hs2-container.is-open .hs2-dropdown {
  display: block;
}

@keyframes hs2FadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hs2-search-wrap {
  position: relative;
  padding: 7px 8px;
  background: #F6F8FC;
  border-bottom: 1px solid var(--border-subtle);
}

.hs2-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.hs2-search-field {
  width: 100%;
  height: 30px;
  padding: 4px 9px 4px 27px;
  border-radius: 7px;
  border: 1px solid #D5DEE9;
  background: #FFFFFF;
  color: var(--text-primary);
  font-size: 11.8px;
  outline: none;
  transition: border-color 0.15s ease;
}

.hs2-search-field:focus {
  border-color: var(--gold-primary);
}

.hs2-results {
  list-style: none;
  max-height: 196px;
  overflow-y: auto;
  padding: 4px;
}

.hs2-results::-webkit-scrollbar {
  width: 4px;
}

.hs2-results::-webkit-scrollbar-thumb {
  background: rgba(30, 58, 95, 0.25);
  border-radius: 999px;
}

.hs2-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.hs2-result-item.is-highlighted {
  background: #EEF3FA;
  color: var(--text-primary);
}

.hs2-result-item.is-selected {
  background: var(--bg-pill-active);
  color: var(--gold-dark);
  font-weight: 600;
}

.hs2-result-item.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hs2-check {
  display: inline-flex;
  align-items: center;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.hs2-result-empty {
  padding: 12px 10px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   DASHBOARD CHARTS, MONITORING PANELS & QUICK MODULES (PROPORTIONAL)
   ========================================================================== */

.panel-heading-group strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.panel-heading-group p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
  line-height: 1.35;
}

.dashboard-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1.08fr);
  gap: 16px;
  margin-bottom: 18px;
}

.chart-card-body {
  padding: 14px 16px 12px;
}

.chart-legend-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.chart-legend-items {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--text-secondary);
}

.chart-legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.chart-legend-dot i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.chart-legend-dot.is-dashed i {
  width: 11px;
  height: 0;
  border-radius: 0;
  border-top: 2px dashed #26354A;
}

.chart-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 8px;
  background: #EDF2F8;
  border: 1px solid var(--border-subtle);
}

.chart-toggle-btn {
  padding: 4px 9px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chart-toggle-btn:hover {
  color: var(--text-primary);
}

.chart-toggle-btn.active {
  background: #FFFFFF;
  color: var(--gold-dark);
  box-shadow: 0 1px 4px rgba(19, 28, 43, 0.08);
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 192px;
}

.chart-hover-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  z-index: 20;
  background: rgba(19, 28, 43, 0.94);
  color: #FFFDF9;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 10.5px;
  line-height: 1.4;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.chart-hover-tooltip .tip-title {
  font-weight: 700;
  color: #BFD3EA;
  margin-bottom: 2px;
}

.chart-hover-tooltip .tip-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chart-hover-tooltip .tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Doughnut Package Breakdown */
.donut-layout {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  flex: 1;
}

.donut-canvas-box {
  position: relative;
  width: 152px;
  height: 152px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-canvas-box canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.donut-center-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 0 14px;
}

.donut-center-label strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.donut-center-label span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.15;
  margin-top: 3px;
}

.donut-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #F9FBFD;
  border: 1px solid #E3E9F2;
  font-size: 11.2px;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.donut-legend-item:hover {
  background: #E8EFF8;
  border-color: #CBD5E1;
}

.donut-legend-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.donut-swatch {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.donut-legend-name {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-legend-val {
  font-weight: 700;
  color: var(--gold-dark);
  white-space: nowrap;
  flex-shrink: 0;
}

.panel-footer-bar {
  padding: 9px 16px;
  border-top: 1px solid var(--border-subtle);
  background: #F6F8FC;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.panel-footer-bar strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Dashboard Lower Grid (Jadwal Kloter + Akses Cepat) */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-grid > .panel-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.quick-module-card {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: #F9FBFD;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  transition: all 0.16s ease;
}

.quick-module-card:hover {
  border-color: var(--gold-primary);
  background: var(--bg-pill-active);
  transform: translateY(-1px);
}

.quick-module-card span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-primary);
  text-transform: uppercase;
  line-height: 1.2;
}

.quick-module-card strong {
  font-size: 11.8px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (MOBILE & TABLET)
   ========================================================================== */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-drawer);
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-brand-mobile {
    display: flex;
  }

  .breadcrumb {
    display: none;
  }

  .burger-btn {
    display: inline-flex;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-charts-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .form-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 16px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar-user-pill span.user-label {
    display: none;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
  }

  .donut-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .donut-canvas-box {
    margin: 0 auto;
  }
}
