/**
 * Liquid Glass Theme - Sistem Inventori Stor
 * Nota penyelenggaraan:
 * - Guna token di :root sebagai single source of truth
 * - Elak hardcode warna baru di komponen (guna token sedia ada)
 * - Komponen utama telah dikunci dalam gaya "premium glass"
 */
:root {
  --primary: #0b1220;
  --primary-light: #162035;
  --primary-dark: #070d18;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --accent-orange: #f59e0b;
  --accent-orange-hover: #d97706;
  --accent-red: #ef4444;
  --accent-soft: rgba(20, 184, 166, 0.2);
  --bg-body: #090f1b;
  --bg-card: rgba(9, 36, 42, 0.64);
  --bg-surface: rgba(8, 31, 37, 0.58);
  --bg-sidebar: rgba(5, 20, 26, 0.82);
  --text-primary: #f4f7ff;
  --text-secondary: #b4c2de;
  --text-muted: #7d8fb3;
  --border: rgba(173, 196, 255, 0.2);
  --shadow-sm: 0 10px 24px rgba(5, 10, 20, 0.26);
  --shadow: 0 16px 36px rgba(4, 8, 19, 0.34);
  --shadow-md: 0 26px 50px -18px rgba(2, 6, 16, 0.6);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-card: 16px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 56px;
  --content-max-width: 1280px;
  --top-strip-bg: linear-gradient(135deg, #050912, #040d1a);
  --glass-border: rgba(94, 234, 212, 0.24);
  --glass-highlight: rgba(255, 255, 255, 0.24);
  --glass-sheen: linear-gradient(115deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 24%, rgba(255, 255, 255, 0) 54%);
  --glass-glow: 0 0 0 1px rgba(94, 234, 212, 0.12), 0 10px 20px rgba(4, 40, 42, 0.2), 0 0 12px rgba(45, 212, 191, 0.08);
  --glass-surface-main: linear-gradient(160deg, rgba(14, 67, 74, 0.54), rgba(8, 43, 51, 0.44));
  --glass-surface-soft: linear-gradient(160deg, rgba(12, 58, 66, 0.5), rgba(7, 36, 43, 0.4));
  --glass-surface-table: linear-gradient(165deg, rgba(13, 63, 73, 0.5), rgba(8, 39, 47, 0.42));
  --card-glow: 0 0 0 1px rgba(94, 234, 212, 0.05), 0 8px 16px rgba(5, 30, 33, 0.2);
  --glass-shadow-strong: 0 18px 30px rgba(4, 10, 22, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--card-glow);
  --top-line-color: #ef4444;
  --sidebar-line-color: rgba(45, 212, 191, 0.24);
  /* Rujukan ukuran: halaman Dashboard */
  --sidebar-logo-size: 50px;
  --sidebar-title-font: 0.9rem;
  --sidebar-subtitle-font: 0.75rem;
  --nav-line-height: 1.4;
  --nav-padding-y: 0.625rem;
  --nav-padding-x: 1rem;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.5;
  background-image: none;
  background-attachment: fixed;
}

/* ----- Layout ----- */
.app-wrap {
  display: flex;
  height: 100vh;
  min-height: 0;
  position: relative;
}

/* ----- Sidebar (theme dark - selari topbar & content) ----- */
.sidebar-wrap {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, #0e1628 0%, #0b1322 100%);
  border-right: none;
  z-index: 1030;
  transition: width 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 10px 28px rgba(3, 8, 20, 0.36);
}

.sidebar-wrap.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-wrap .sidebar-brand {
  min-height: var(--topbar-height);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: var(--top-strip-bg);
  border-bottom: 1px solid var(--top-line-color);
  border-right: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  flex-shrink: 0;
}

.sidebar-wrap .sidebar-brand a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--sidebar-title-font);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 1.25;
  min-width: 0;
  letter-spacing: 0.01em;
}

.sidebar-wrap .sidebar-brand .flex-grow-1 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.sidebar-wrap .sidebar-brand a .text {
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
  font-weight: 600;
  line-height: 1.15;
}

.sidebar-wrap .sidebar-brand a i {
  font-size: 1.35rem;
  flex-shrink: 0;
  color: var(--accent);
}

/* Logo & teks - ukuran ikut rujukan Dashboard, sama di semua halaman */
.sidebar-wrap .sidebar-brand a .sidebar-logo {
  height: var(--sidebar-logo-size);
  width: var(--sidebar-logo-size);
  min-width: var(--sidebar-logo-size);
  max-width: var(--sidebar-logo-size);
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}

.sidebar-wrap .sidebar-page-title {
  display: block;
  font-size: var(--sidebar-subtitle-font);
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.1rem;
  line-height: 1.15;
}

.sidebar-wrap.collapsed .sidebar-page-title {
  display: none;
}

.sidebar-wrap.collapsed .sidebar-brand span.text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  flex: none;
}

.sidebar-nav {
  flex: 1;
  padding: 0.9rem 0 3.7rem 0;
  background: linear-gradient(180deg, rgba(9, 16, 30, 0.96), rgba(7, 14, 26, 0.92));
  border-right: 1px solid var(--sidebar-line-color);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(141, 177, 255, 0.22);
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(141, 177, 255, 0.34);
}

.sidebar-nav .nav-label {
  padding: 0.6rem var(--nav-padding-x) 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(180, 194, 222, 0.72);
  line-height: var(--nav-line-height);
  font-weight: 600;
}

.sidebar-nav .nav-label:not(:first-child) {
  margin-top: 0.35rem;
}

.sidebar-wrap.collapsed .nav-label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--nav-padding-y) var(--nav-padding-x);
  color: rgba(199, 212, 236, 0.9);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: var(--nav-line-height);
  transition: background 0.16s, color 0.16s, border-color 0.16s, transform 0.16s;
  border-left: 2px solid transparent;
  border-radius: 0 10px 10px 0;
  margin: 0.08rem 0.4rem 0.08rem 0;
  min-height: 42px;
}

.sidebar-nav .nav-link i {
  font-size: 1rem;
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.16s ease, transform 0.16s ease;
}

.sidebar-nav .nav-link:hover {
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.16), rgba(91, 140, 255, 0.06));
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateX(1px);
}

.sidebar-nav .nav-link:focus-visible,
.sidebar-submenu-link:focus-visible {
  outline: 2px solid rgba(157, 186, 255, 0.55);
  outline-offset: 1px;
}

.sidebar-nav .nav-link:hover i {
  color: var(--text-primary);
  transform: scale(1.05);
}

.sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.3), rgba(91, 140, 255, 0.14));
  color: #e6efff;
  border-left-color: #b8cdff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(120, 164, 255, 0.2);
}

.sidebar-nav .nav-link.active i {
  color: #9fc0ff;
  transform: scale(1.06);
}

.sidebar-wrap.collapsed .nav-link span.text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Collapsed mode: enterprise tooltip for icon-only navigation */
.sidebar-wrap.collapsed .sidebar-nav .nav-link,
.sidebar-wrap.collapsed .sidebar-nav .nav-link-toggle {
  position: relative;
  overflow: visible;
}

.sidebar-wrap.collapsed .sidebar-nav .nav-link .text,
.sidebar-wrap.collapsed .sidebar-nav .nav-link-toggle .text {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  width: max-content;
  min-width: 108px;
  max-width: 220px;
  padding: 0.42rem 0.62rem;
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(22, 34, 58, 0.96), rgba(15, 25, 42, 0.94));
  border: 1px solid rgba(214, 228, 255, 0.36);
  color: #eaf2ff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1045;
  opacity: 0;
  box-shadow: 0 12px 24px rgba(4, 10, 22, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.sidebar-wrap.collapsed .sidebar-nav .nav-link .text::before,
.sidebar-wrap.collapsed .sidebar-nav .nav-link-toggle .text::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(45deg);
  background: rgba(18, 30, 51, 0.95);
  border-left: 1px solid rgba(214, 228, 255, 0.28);
  border-bottom: 1px solid rgba(214, 228, 255, 0.28);
}

.sidebar-wrap.collapsed .sidebar-nav .nav-link:hover .text,
.sidebar-wrap.collapsed .sidebar-nav .nav-link:focus-visible .text,
.sidebar-wrap.collapsed .sidebar-nav .nav-link-toggle:hover .text,
.sidebar-wrap.collapsed .sidebar-nav .nav-link-toggle:focus-visible .text {
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}

.sidebar-wrap.collapsed .sidebar-nav .nav-link,
.sidebar-wrap.collapsed .sidebar-nav .nav-link-toggle {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  margin-right: 0.35rem;
}

.sidebar-wrap.collapsed .sidebar-nav .nav-link i,
.sidebar-wrap.collapsed .sidebar-nav .nav-link-toggle i {
  margin-right: 0;
}

.sidebar-wrap.collapsed .sidebar-nav .nav-link .nav-link-chevron,
.sidebar-wrap.collapsed .sidebar-nav .nav-link-toggle .nav-link-chevron {
  display: none;
}

.sidebar-nav .nav-link-toggle {
  border: none;
  cursor: pointer;
  background: transparent;
  font: inherit;
  color: var(--text-secondary);
}

.sidebar-nav .nav-link-toggle:hover {
  color: var(--text-primary);
}

.sidebar-nav .nav-link-toggle.active i {
  color: var(--accent);
}

.sidebar-nav .nav-link-chevron {
  font-size: 0.7rem;
  transition: transform 0.2s;
  width: auto;
  color: rgba(180, 194, 222, 0.75);
}

.sidebar-nav .nav-link-toggle[aria-expanded="true"] .nav-link-chevron {
  transform: rotate(180deg);
  color: var(--text-secondary);
}

.sidebar-menu-group { margin: 0; padding: 0; }

.sidebar-submenu {
  padding: 0.25rem 0.4rem 0.45rem 0;
  background: rgba(7, 12, 24, 0.36);
  border-left: 2px solid rgba(255,255,255,0.06);
  margin-left: 0.45rem;
  border-radius: 0 10px 10px 0;
}

.sidebar-submenu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.48rem var(--nav-padding-x) 0.48rem 1.6rem;
  color: rgba(188, 203, 230, 0.9);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: var(--nav-line-height);
  transition: background 0.16s, color 0.16s, transform 0.16s;
  border-radius: 0 8px 8px 0;
  min-height: 38px;
}

.sidebar-submenu-link i {
  font-size: 0.94rem;
  flex-shrink: 0;
  width: 1.05rem;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.16s ease, transform 0.16s ease;
}

.sidebar-submenu-link:hover {
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.14), rgba(91, 140, 255, 0.05));
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateX(1px);
}

.sidebar-submenu-link:hover i {
  color: var(--text-primary);
  transform: scale(1.05);
}

.sidebar-submenu-link.active {
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.24), rgba(91, 140, 255, 0.1));
  color: #cfe0ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(120, 164, 255, 0.16);
}

.sidebar-submenu-link.active i {
  color: #9fc0ff;
  transform: scale(1.04);
}

.sidebar-wrap.collapsed .sidebar-submenu-link span.text,
.sidebar-wrap.collapsed .sidebar-submenu,
.sidebar-wrap.collapsed .collapse {
  display: none !important;
}

/* Sidebar toggle button (bottom) */
.sidebar-wrap .sidebar-toggle-btn {
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  border: 0 !important;
  border-top: 1px solid rgba(214, 228, 255, 0.2) !important;
  border-radius: 0 !important;
  padding: 0 !important;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary) !important;
  background: linear-gradient(180deg, rgba(22, 34, 56, 0.7), rgba(14, 24, 42, 0.82));
  text-decoration: none !important;
  z-index: 3;
}

.sidebar-wrap .sidebar-toggle-btn i {
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-wrap .sidebar-toggle-btn:hover {
  background: linear-gradient(180deg, rgba(72, 111, 191, 0.26), rgba(44, 77, 150, 0.2));
  color: var(--text-primary) !important;
}

.sidebar-wrap .sidebar-mobile-close {
  color: var(--text-secondary) !important;
}

.sidebar-wrap .sidebar-mobile-close:hover {
  color: var(--text-primary) !important;
}

/* Topbar - tetap di atas, tidak ikut scroll */
.topbar {
  height: var(--topbar-height);
  background: var(--top-strip-bg);
  border-bottom: 1px solid var(--top-line-color);
  padding: 0 35px;
  display: block;
  flex-shrink: 0;
  z-index: 1020;
  margin-left: 0;
  transition: margin-left 0.2s ease;
  box-sizing: border-box;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

/* Lock exact same visual tone for topbar + sidebar head */
.topbar,
.sidebar-wrap .sidebar-brand {
  background: var(--top-strip-bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sidebar-wrap.collapsed ~ .main-content .topbar {
  margin-left: 0;
}

.topbar .topbar-inner {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar .user-menu {
  margin-left: auto;
}

.topbar .topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 1 auto;
  min-width: 0;
}

.topbar .topbar-toggle-icon {
  font-size: 1.5rem;
}

.topbar .topbar-user-icon {
  font-size: 1.25rem;
}

.topbar .page-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: visible;
}

.topbar .user-menu .btn,
.topbar .btn-link {
  color: #cbd5f5;
  font-size: 0.9rem;
}

.topbar .user-menu .btn:hover,
.topbar .btn-link:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(120, 164, 255, 0.35);
}

.topbar .dropdown-menu {
  background: linear-gradient(160deg, rgba(19, 30, 50, 0.9), rgba(16, 24, 42, 0.84));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(120, 164, 255, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar .dropdown-menu .dropdown-item {
  color: var(--text-primary);
}

.topbar .dropdown-menu .dropdown-item:hover {
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.22), rgba(91, 140, 255, 0.08));
  color: #eaf1ff;
}

.topbar .dropdown-menu .dropdown-item.text-danger {
  color: var(--accent-red) !important;
}

.topbar .dropdown-toggle::after { margin-left: 0.4rem; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
  background: var(--bg-body);
  overflow: hidden;
}

.content-area .content-inner {
  width: 100%;
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
}

.sidebar-wrap.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* Hanya content-area yang scroll; topbar kekal di atas */
/* Ukuran desktop: 35px kiri/kanan, 18px atas/bawah */
.content-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 35px;
  color: var(--text-primary);
  -webkit-overflow-scrolling: touch;
}

/* ----- Page & Form container (center, max-width, premium layout) ----- */
.page-container {
  width: 100%;
}

.form-container {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
  padding: 24px clamp(16px, 4vw, 32px);
}

.form-container .form-card .card-body {
  padding: 1.25rem 1.5rem;
}

.form-container .welcome-card {
  margin-bottom: 1rem;
}

.form-container .card + .card {
  margin-top: 0;
}

.form-container h6:not(.card-header *) {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
}

@media (max-width: 991.98px) {
  .form-container {
    padding: 20px 16px;
  }
}

@media (max-width: 575.98px) {
  .form-container {
    padding: 16px 12px;
  }
}

.content-area h4, .content-area .page-title {
  color: var(--text-primary);
}

.content-area .text-muted {
  color: var(--text-secondary) !important;
}

.content-area .text-secondary {
  color: var(--text-secondary) !important;
}

/* Shared UI sizing helpers (non-print screens) */
.ui-filter-input-sm { width: 180px; }
.ui-filter-input-md { width: 220px; }
.ui-filter-select-sm { width: 200px; }
.ui-filter-select-md { width: 220px; }
.ui-card-narrow,
.ui-card-compact,
.ui-card-medium {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.ui-card-narrow { max-width: 560px; }
.ui-card-compact { max-width: 620px; }
.ui-card-medium { max-width: 760px; }

.ui-card-narrow .card-body,
.ui-card-medium .card-body,
.ui-card-compact .card-body {
  padding: 1.25rem 1.5rem;
}

.ui-card-narrow .form-label,
.ui-card-medium .form-label,
.ui-card-compact .form-label {
  margin-bottom: 0.45rem;
}

/* Corporate form layout */
.ui-form-card .card-body {
  padding: 1.4rem 1.6rem;
}

.ui-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem 1rem;
}

.ui-form-field {
  margin: 0;
}

.ui-form-field--full {
  grid-column: 1 / -1;
}

.ui-form-card .form-label {
  font-weight: 600;
  color: #dbe6ff;
}

.ui-form-card .form-check {
  margin: 0.25rem 0 0;
  padding: 0.65rem 0.8rem 0.65rem 2rem;
  border: 1px solid rgba(173, 196, 255, 0.2);
  border-radius: 10px;
  background: rgba(16, 28, 48, 0.34);
}

.ui-form-actions {
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(173, 196, 255, 0.2);
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

/* Laporan page */
.laporan-links {
  max-width: 460px;
  margin-left: 0;
  margin-right: 0;
}

.laporan-export-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.laporan-export-panel {
  border: 1px solid rgba(173, 196, 255, 0.2);
  border-radius: 12px;
  background: rgba(13, 24, 43, 0.36);
  padding: 0.85rem;
  overflow: hidden;
}

.laporan-export-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #dbe6ff;
  margin-bottom: 0.65rem;
}

.laporan-export-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: end;
}

.laporan-export-form .form-label {
  margin-bottom: 0.35rem;
}

.laporan-export-form .form-control,
.laporan-export-form .form-select {
  min-width: 0;
  width: 100%;
}

.laporan-export-form .btn {
  white-space: nowrap;
}

.laporan-export-field-full {
  grid-column: 1 / -1;
}

.laporan-export-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.laporan-export-actions .btn {
  min-width: 132px;
}

.laporan-print-header {
  display: none;
}

@media (max-width: 767.98px) {
  .ui-filter-input-sm,
  .ui-filter-input-md,
  .ui-filter-select-sm,
  .ui-filter-select-md {
    width: 100%;
  }

  .ui-card-narrow .card-body,
  .ui-card-medium .card-body,
  .ui-card-compact .card-body {
    padding: 1rem;
  }

  .ui-form-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .ui-form-field--full {
    grid-column: auto;
  }

  .ui-form-actions {
    flex-wrap: wrap;
  }

  .laporan-export-grid {
    grid-template-columns: 1fr;
  }

  .laporan-export-form {
    grid-template-columns: 1fr;
  }

  .laporan-export-field-full,
  .laporan-export-actions {
    grid-column: auto;
  }

  .laporan-export-actions {
    justify-content: stretch;
  }

  .laporan-export-actions .btn {
    width: 100%;
  }
}

@media print {
  .laporan-print-header {
    display: block;
    text-align: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid #000;
  }

  .laporan-print-logo {
    height: auto;
    max-height: 110px;
    width: auto;
    max-width: 230px;
    object-fit: contain;
  }

  .laporan-print-hidden {
    display: none !important;
  }
}

/* Item detail page */
.item-detail-card .card-header {
  padding: 1rem 1.25rem;
}

.item-detail-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #eef4ff;
}

.item-detail-subtitle {
  margin-top: 0.2rem;
  font-size: 0.84rem;
  color: rgba(199, 212, 236, 0.86);
}

.item-detail-meta {
  border: 1px solid rgba(214, 228, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(29, 45, 73, 0.46), rgba(19, 31, 52, 0.34));
  overflow: hidden;
}

.item-detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.9rem;
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid rgba(214, 228, 255, 0.2);
}

.item-detail-row:last-child {
  border-bottom: none;
}

.item-detail-label {
  color: rgba(188, 203, 230, 0.9);
  font-weight: 600;
  font-size: 0.86rem;
  padding-right: 0.9rem;
  border-right: 1px solid rgba(214, 228, 255, 0.16);
}

.item-detail-value {
  color: #eaf2ff;
  font-size: 0.9rem;
  padding-left: 0.2rem;
}

.item-detail-actions {
  height: 100%;
  border: 1px solid rgba(214, 228, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(29, 45, 73, 0.44), rgba(19, 31, 52, 0.3));
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  justify-content: center;
}

@media (max-width: 767.98px) {
  .item-detail-row {
    grid-template-columns: 1fr;
    gap: 0.28rem;
    padding: 0.65rem 0.75rem;
  }

  .item-detail-label {
    border-right: none;
    padding-right: 0;
  }
}

/* Jadual senarai barang — grid kemas (semak awam, butiran & kelulusan permohonan) */
.ji-table-wrap,
.permohonan-items-table-wrap {
  border: 1px solid rgba(74, 140, 135, 0.65);
  border-radius: 10px;
  overflow: hidden;
  background: #132b32;
}

.semak-items-scroll {
  max-height: min(40vh, 280px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ji-items-grid,
.permohonan-items-grid {
  --bs-table-bg: transparent;
  --bs-table-color: #f8fafc;
  --bs-table-border-color: rgba(74, 140, 135, 0.72);
  border-collapse: collapse;
  margin-bottom: 0;
  color: #f1f5f9;
}

.ji-items-grid thead th,
.ji-items-grid tbody td,
.permohonan-items-grid thead th,
.permohonan-items-grid tbody td {
  border-color: rgba(74, 140, 135, 0.58) !important;
  vertical-align: middle;
  text-align: center;
  padding: 0.72rem 0.85rem;
}

.ji-items-grid thead th,
.permohonan-items-grid thead th {
  background: #1a1d21 !important;
  color: #fff !important;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(74, 140, 135, 0.65) !important;
}

.ji-items-grid tbody td,
.permohonan-items-grid tbody td {
  font-size: 0.9rem;
  color: #f1f5f9 !important;
  word-break: break-word;
}

.ji-items-grid tbody tr,
.permohonan-items-grid tbody tr {
  background: #132b32;
}

.ji-items-grid tbody tr:nth-child(even),
.permohonan-items-grid tbody tr:nth-child(even) {
  background: #163a42;
}

.ji-items-grid tbody td:first-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.permohonan-items-grid tbody td:first-child {
  font-weight: 600;
}

.semak-items-scroll .ji-items-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 rgba(74, 140, 135, 0.55);
}

.permohonan-items-grid tbody td .form-control {
  display: block;
  max-width: 9rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  background: rgba(17, 50, 58, 0.95);
  border: 1px solid rgba(74, 140, 135, 0.55);
  color: #f8fafc;
}

.permohonan-items-grid tbody td:nth-child(3),
.permohonan-items-grid tbody td:nth-child(4) {
  font-variant-numeric: tabular-nums;
}

/* ----- Cards dark surface ----- */
.card {
  background: var(--glass-surface-main);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-shadow-strong);
  color: var(--text-primary);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-sheen);
  background-size: 220% 220%;
  pointer-events: none;
  opacity: 0.28;
  animation: none;
}

.card-header {
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid var(--glass-border);
  font-weight: 600;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
}

/* Welcome card dashboard */
.welcome-card {
  background: var(--glass-surface-main);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--glass-shadow-strong);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-sheen);
  background-size: 220% 220%;
  pointer-events: none;
  opacity: 0.24;
  animation: none;
}

.welcome-card h5 {
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.welcome-card p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.9rem;
}

/* Action cards (grid - icon + title + desc + Buka) */
.action-card {
  background: var(--glass-surface-main);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  height: 100%;
  box-shadow: var(--glass-shadow-strong);
  transition: box-shadow 0.2s, border-color 0.2s;
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-sheen);
  background-size: 220% 220%;
  pointer-events: none;
  opacity: 0.24;
  animation: none;
}

.action-card:hover {
  box-shadow: 0 20px 34px rgba(4, 10, 22, 0.36), var(--card-glow), 0 0 14px rgba(45, 212, 191, 0.08);
  border-color: rgba(94, 234, 212, 0.32);
}

.action-card .action-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.action-card .action-title {
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.35rem;
}

.action-card .action-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.action-card .btn-buka {
  font-size: 0.875rem;
  padding: 0.4rem 0.9rem;
}

.action-card .btn-buka.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.action-card .btn-buka.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.action-card .btn-buka.btn-outline-dark-light {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.action-card .btn-buka.btn-outline-dark-light:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-color: var(--border);
}

/* Status summary cards (HANTAR, LULUS, TOLAK, DRAF) */
.status-summary-card {
  background: var(--glass-surface-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1rem;
  text-align: center;
  box-shadow: 0 14px 28px rgba(4, 10, 22, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.status-summary-card .status-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-summary-card .status-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.status-summary-card .status-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: 0.25rem;
  display: inline-block;
}

.status-summary-card .status-link:hover {
  color: var(--accent-hover);
}

/* Dashboard stat cards (legacy style - dark) */
.dashboard-card {
  background: var(--glass-surface-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: 0 18px 34px rgba(4, 10, 22, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  padding: 1.25rem;
  height: 100%;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
}

.dashboard-card .card-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  opacity: 0.9;
}

.dashboard-card .card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.dashboard-card .card-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.dashboard-card .card-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: 0.5rem;
  display: inline-block;
}

.dashboard-card .card-link:hover {
  color: var(--accent-hover);
}

/* Buttons */
.btn {
  --btn-radius: 10px;
  --btn-pad-y: 0.52rem;
  --btn-pad-x: 1rem;
  border-radius: var(--btn-radius);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  min-height: 40px;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.btn-primary {
  background: linear-gradient(145deg, rgba(124, 164, 255, 0.42), rgba(86, 130, 238, 0.3));
  border-color: rgba(203, 213, 245, 0.56);
  color: #fff;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.btn-primary:hover {
  background: linear-gradient(145deg, rgba(141, 177, 255, 0.56), rgba(96, 139, 242, 0.42));
  border-color: rgba(190, 208, 255, 0.58);
  color: #fff;
  box-shadow: 0 10px 22px rgba(24, 62, 142, 0.34), 0 0 0 1px rgba(173, 196, 255, 0.34), 0 0 24px rgba(91, 140, 255, 0.24);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(145deg, rgba(124, 164, 255, 0.46), rgba(86, 130, 238, 0.34));
  border-color: rgba(203, 213, 245, 0.58);
  color: #fff;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.btn-accent:hover {
  background: linear-gradient(145deg, rgba(141, 177, 255, 0.58), rgba(96, 139, 242, 0.44));
  border-color: rgba(190, 208, 255, 0.62);
  color: #fff;
  box-shadow: 0 10px 22px rgba(24, 62, 142, 0.36), 0 0 0 1px rgba(173, 196, 255, 0.36), 0 0 26px rgba(91, 140, 255, 0.28);
  transform: translateY(-1px);
}

.btn-outline-primary {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(91, 140, 255, 0.08);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.btn-outline-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-qr-action,
.btn-qr-action:hover,
.btn-qr-action:focus-visible {
  color: #ffffff !important;
}

.btn-danger {
  color: #fff !important;
  border-color: var(--accent-red);
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.42), rgba(185, 28, 28, 0.3));
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.btn-outline-danger {
  color: var(--accent-red);
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.08);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.btn-danger:hover, .btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-red);
  color: #fff;
  box-shadow: 0 8px 16px rgba(120, 24, 24, 0.25);
  transform: translateY(-1px);
}

.btn-outline-danger:hover {
  color: #fff;
}

.btn-outline-light,
.btn-outline-dark-light {
  color: #d5e2ff;
  border-color: rgba(203, 213, 245, 0.44);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.btn-outline-light:hover,
.btn-outline-dark-light:hover {
  color: #fff;
  border-color: rgba(214, 228, 255, 0.62);
  background: rgba(91, 140, 255, 0.24);
  box-shadow: 0 8px 18px rgba(24, 62, 142, 0.28);
  transform: translateY(-1px);
}

.btn-success,
.btn-info,
.btn-warning {
  color: #fff !important;
  border-color: rgba(214, 228, 255, 0.5);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.btn-success {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.46), rgba(5, 150, 105, 0.32));
}

.btn-success:hover {
  background: linear-gradient(145deg, rgba(34, 197, 142, 0.54), rgba(5, 150, 105, 0.42));
  border-color: rgba(187, 247, 208, 0.56);
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(8, 112, 79, 0.34);
  transform: translateY(-1px);
}

.btn-info {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.46), rgba(2, 132, 199, 0.32));
}

.btn-info:hover {
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.54), rgba(2, 132, 199, 0.42));
  border-color: rgba(186, 230, 253, 0.56);
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(10, 87, 138, 0.34);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.9), rgba(245, 158, 11, 0.84));
  border-color: rgba(254, 240, 138, 0.74);
  color: #111827 !important;
}

.btn-warning:hover {
  background: linear-gradient(145deg, rgba(253, 224, 71, 0.94), rgba(251, 191, 36, 0.9));
  border-color: rgba(254, 240, 138, 0.86);
  color: #111827 !important;
  box-shadow: 0 10px 22px rgba(194, 120, 16, 0.34);
  transform: translateY(-1px);
}

.btn-outline-success,
.btn-outline-info,
.btn-outline-warning {
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  background: rgba(255, 255, 255, 0.03);
}

.btn-outline-success {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.6);
}

.btn-outline-success:hover {
  color: #fff;
  border-color: rgba(167, 243, 208, 0.72);
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 8px 18px rgba(8, 112, 79, 0.28);
  transform: translateY(-1px);
}

.btn-outline-info {
  color: #67e8f9;
  border-color: rgba(103, 232, 249, 0.58);
}

.btn-outline-info:hover {
  color: #fff;
  border-color: rgba(186, 230, 253, 0.72);
  background: rgba(14, 165, 233, 0.22);
  box-shadow: 0 8px 18px rgba(10, 87, 138, 0.28);
  transform: translateY(-1px);
}

.btn-outline-warning {
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.62);
  background: rgba(251, 191, 36, 0.08);
}

.btn-outline-warning:hover {
  color: #111827;
  border-color: rgba(254, 240, 138, 0.86);
  background: rgba(251, 191, 36, 0.72);
  box-shadow: 0 8px 18px rgba(194, 120, 16, 0.28);
  transform: translateY(-1px);
}

.btn-light,
.btn-dark {
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.btn-light {
  color: #0f172a;
  border-color: rgba(214, 228, 255, 0.62);
  background: linear-gradient(145deg, rgba(244, 247, 255, 0.92), rgba(226, 236, 252, 0.84));
}

.btn-light:hover {
  color: #0f172a;
  border-color: rgba(233, 242, 255, 0.9);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(236, 243, 255, 0.9));
  box-shadow: 0 8px 18px rgba(150, 170, 205, 0.24);
  transform: translateY(-1px);
}

.btn-dark {
  color: #e7efff;
  border-color: rgba(214, 228, 255, 0.34);
  background: linear-gradient(145deg, rgba(28, 44, 72, 0.8), rgba(18, 30, 52, 0.72));
}

.btn-dark:hover {
  color: #fff;
  border-color: rgba(214, 228, 255, 0.48);
  background: linear-gradient(145deg, rgba(40, 60, 92, 0.86), rgba(22, 36, 60, 0.78));
  box-shadow: 0 8px 18px rgba(8, 18, 38, 0.36);
  transform: translateY(-1px);
}

.btn-sm {
  --btn-radius: 8px;
  min-height: 34px;
  font-size: 0.8rem;
  padding: 0.36rem 0.72rem;
}

/* Badges */
.badge {
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.42em 0.62em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.badge-status-draf { background: #94a3b8; color: #fff; }
.badge-status-hantar { background: #f59e0b; color: #1b2438; border-color: rgba(255, 255, 255, 0.28); }
.badge-status-lulus { background: #10b981; color: #fff; }
.badge-status-tolak { background: #ef4444; color: #fff; }
.badge-status-sebahagian { background: #8b5cf6; color: #fff; }
.badge-status-selesai { background: #3b82f6; color: #fff; }

/* Tables dark - 2 tone, teks putih */
.table-wrapper {
  background: var(--glass-surface-table);
  border-radius: var(--radius-card);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: 0 22px 42px rgba(4, 10, 22, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2), var(--glass-glow);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  position: relative;
}

.table-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-sheen);
  background-size: 220% 220%;
  pointer-events: none;
  opacity: 0.2;
  animation: none;
}

.table,
.table-wrapper .table {
  margin-bottom: 0;
  color: var(--text-primary);
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: var(--border);
}

/* Override table-light - header gelap */
.table thead th,
.table thead.table-light th {
  background: linear-gradient(165deg, rgba(153, 246, 228, 0.12), rgba(45, 212, 191, 0.08)) !important;
  font-weight: 600;
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: #eaf1ff !important;
  border-bottom: 1px solid rgba(94, 234, 212, 0.24);
  padding: 0.75rem 1rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

/* Body - 2 tone gelap, teks putih - keutamaan tinggi */
body .table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-color: rgba(94, 234, 212, 0.15);
  color: #e7efff !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  background-color: rgba(10, 44, 52, 0.46) !important;
}

body .table tbody tr:nth-child(even) td {
  background-color: rgba(8, 36, 43, 0.5) !important;
}

body .table tbody tr:hover td {
  background-color: rgba(20, 78, 84, 0.34) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* Override table-dark thead untuk selari tema */
body .table thead.table-dark th {
  background: linear-gradient(165deg, rgba(153, 246, 228, 0.12), rgba(45, 212, 191, 0.08)) !important;
  color: #eaf1ff !important;
  border-color: rgba(94, 234, 212, 0.24);
}

/* Semua teks dalam jadual - centre */
body .table th,
body .table td {
  text-align: center !important;
  vertical-align: middle !important;
}

/* Forms dark */
.form-control, .form-select {
  background: linear-gradient(155deg, rgba(60, 90, 134, 0.34), rgba(30, 46, 74, 0.28));
  border-color: var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 18px rgba(8, 18, 38, 0.24);
}

.form-control:focus, .form-select:focus {
  background: linear-gradient(155deg, rgba(78, 114, 170, 0.38), rgba(36, 56, 92, 0.3));
  border-color: rgba(140, 174, 255, 0.85);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.26), 0 10px 22px rgba(24, 62, 142, 0.24);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* Native select dropdown list (browser-dependent support) */
.form-select option,
select.form-select option,
select option {
  background-color: #0f172a;
  color: #f4f7ff;
}

.form-select option:checked,
select.form-select option:checked,
select option:checked {
  background-color: #1f3f77;
  color: #ffffff;
}

.form-label {
  color: var(--text-secondary);
}

/* Alerts dark */
.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* Pagination dark */
.pagination .page-link {
  background: rgba(21, 33, 56, 0.72);
  border-color: var(--border);
  color: var(--text-primary);
}

.pagination .page-item.active .page-link {
  background: rgba(91, 140, 255, 0.52);
  border-color: rgba(148, 179, 255, 0.75);
}

.pagination .page-link:hover {
  background: rgba(91, 140, 255, 0.32);
  border-color: var(--border);
  color: #fff;
}

/* Links in content */
.content-area a:not(.btn):not(.dropdown-item) {
  color: var(--accent);
}

.content-area a:not(.btn):not(.dropdown-item):hover {
  color: var(--accent-hover);
}

/* Sidebar overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1025;
}

.sidebar-overlay.show { display: block; }

/* Override kuat desktop - kekalkan spacing konsisten */
@media (min-width: 992px) {
  body .app-wrap .main-content header.topbar,
  body .app-wrap .main-content .topbar {
    padding: 0 35px !important;
  }
  body .app-wrap .main-content .content-area {
    padding: 18px 35px !important;
  }
}

@media (max-width: 991.98px) {
  .sidebar-wrap {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }
  .sidebar-wrap.mobile-open { transform: translateX(0); }
  .sidebar-wrap.collapsed { width: var(--sidebar-width); }
  .main-content, .sidebar-wrap.collapsed ~ .main-content { margin-left: 0; }
  .topbar { margin-left: 0; }
  .content-area { padding: 0.9rem; }

  /* Mobile: jadual scroll mendatar, elak overflow */
  .table-wrapper,
  .table-responsive,
  .content-area .card-body.p-0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .table-wrapper .table { min-width: 420px; }
  .content-area .card-body.p-0 .table {
    min-width: 340px;
    font-size: 0.9rem;
  }
  .table-responsive .table {
    min-width: 420px;
    font-size: 0.9rem;
  }
  .content-area .card-body.p-0 .table th,
  .content-area .card-body.p-0 .table td {
    padding: 0.6rem 0.5rem;
  }

  /* Mobile: butang & input lebih besar untuk sentuhan (min 44px) */
  .content-area .btn { min-height: 44px; padding: 0.45rem 0.9rem; }
  .content-area .form-control,
  .content-area .form-select {
    min-height: 44px;
    font-size: 16px; /* elak zoom auto pada iOS */
  }

  /* Mobile: font & padding untuk kemudahan baca */
  .content-area { font-size: 1rem; }
  .content-area h4, .content-area .page-title { font-size: 1.25rem; }
  .content-area h5 { font-size: 1.1rem; }
  .content-area h6 { font-size: 1rem; }
  .welcome-card, .action-card, .status-summary-card { padding: 0.9rem; }
  .action-card .action-icon { width: 2.5rem; height: 2.5rem; font-size: 1.25rem; }

  /* Topbar: butang hamburger lebih besar untuk sentuhan */
  #sidebar-mobile-open { min-width: 44px; min-height: 44px; }
}

@media (max-width: 575.98px) {
  .content-area { padding: 0.75rem; }
}

.bg-soft-accent { background: var(--accent-soft); }

/* Sidebar logo & teks - ukuran sama di semua halaman, elak override */
body .app-wrap .sidebar-wrap .sidebar-brand a .sidebar-logo {
  height: var(--sidebar-logo-size) !important;
  width: var(--sidebar-logo-size) !important;
  min-width: var(--sidebar-logo-size) !important;
  max-width: var(--sidebar-logo-size) !important;
}
body .app-wrap .sidebar-wrap .sidebar-brand a .text {
  font-size: var(--sidebar-title-font) !important;
}
body .app-wrap .sidebar-wrap .sidebar-brand .sidebar-page-title {
  font-size: var(--sidebar-subtitle-font) !important;
}

/* List group dark */
.list-group-item {
  background: var(--glass-surface-soft);
  border-color: var(--border);
  color: var(--text-primary);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.list-group-item:hover {
  background: rgba(255,255,255,0.04);
}

.list-group-item-action:focus {
  background: rgba(59, 130, 246, 0.15);
}

/* Global Bootstrap liquid-glass harmonization */
.modal-content {
  background: var(--glass-surface-main);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.modal-header,
.modal-footer {
  border-color: var(--glass-border);
}

.nav-tabs {
  border-bottom-color: var(--glass-border);
}

.nav-tabs .nav-link {
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-bottom-color: transparent;
}

.nav-tabs .nav-link:hover {
  color: var(--text-primary);
  border-color: rgba(203, 213, 245, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  color: #dbe8ff;
  background: rgba(91, 140, 255, 0.2);
  border-color: rgba(173, 196, 255, 0.34) rgba(173, 196, 255, 0.34) transparent;
}

.input-group-text {
  background: rgba(21, 33, 56, 0.58);
  border-color: var(--glass-border);
  color: var(--text-secondary);
}

.dropdown-divider {
  border-top-color: var(--glass-border);
}

.btn-outline-secondary {
  color: var(--text-secondary);
  border-color: rgba(173, 196, 255, 0.3);
  background: rgba(255, 255, 255, 0.02);
}

.btn-outline-secondary:hover {
  color: #fff;
  border-color: rgba(203, 213, 245, 0.5);
  background: rgba(91, 140, 255, 0.24);
}

.btn-secondary {
  color: #fff;
  border-color: rgba(173, 196, 255, 0.36);
  background: rgba(91, 140, 255, 0.22);
}

.btn-secondary:hover {
  color: #fff;
  border-color: rgba(203, 213, 245, 0.52);
  background: rgba(91, 140, 255, 0.38);
}

.table-responsive {
  border-radius: calc(var(--radius-card) - 2px);
}

/* Senarai barang - tindakan seragam (style korporat) */
.item-action-group {
  white-space: nowrap;
}

.item-action-group .btn {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #f8fbff !important;
  border: 1px solid rgba(148, 179, 255, 0.45);
  background: linear-gradient(145deg, rgba(45, 77, 138, 0.6), rgba(30, 53, 98, 0.52));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.item-action-group .btn:hover,
.item-action-group .btn:focus-visible {
  color: #ffffff !important;
  border-color: rgba(190, 213, 255, 0.62);
  background: linear-gradient(145deg, rgba(58, 95, 166, 0.72), rgba(36, 64, 118, 0.62));
  transform: translateY(-1px);
}

.badge.bg-secondary,
.badge.bg-dark {
  background-color: rgba(94, 114, 148, 0.8) !important;
  color: #f4f7ff !important;
}

.badge.bg-primary,
.badge.bg-info,
.badge.bg-success,
.badge.bg-warning,
.badge.bg-danger {
  filter: saturate(0.9);
}

.badge.bg-warning {
  color: #1b2438 !important;
}

/* Ultra Glass Mode (desktop emphasis) */
@media (min-width: 992px) {
  .topbar,
  .sidebar-wrap .sidebar-brand {
    backdrop-filter: blur(16px) saturate(145%);
    -webkit-backdrop-filter: blur(16px) saturate(145%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 10px 26px rgba(10, 26, 56, 0.3);
  }

  .card,
  .welcome-card,
  .action-card,
  .dashboard-card,
  .table-wrapper {
    backdrop-filter: blur(24px) saturate(145%);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
  }

  .card::before,
  .welcome-card::before,
  .action-card::before,
  .table-wrapper::before {
    opacity: 0.78;
  }

  .btn-primary,
  .btn-accent {
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
  }
}

/* Animation primitives */
@keyframes liquidSheen {
  0% {
    background-position: 0% 50%;
    opacity: 0.45;
  }
  50% {
    background-position: 100% 50%;
    opacity: 0.92;
  }
  100% {
    background-position: 0% 50%;
    opacity: 0.45;
  }
}

/* Accessibility guard: reduce motion */
@media (prefers-reduced-motion: reduce) {
  .card::before,
  .welcome-card::before,
  .action-card::before,
  .table-wrapper::before {
    animation: none;
  }
}

/* Compatibility guard: premium fallback without backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar,
  .sidebar-wrap .sidebar-brand {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(10, 37, 64, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 24px rgba(5, 12, 24, 0.28);
  }

  .card,
  .welcome-card,
  .action-card,
  .dashboard-card,
  .status-summary-card,
  .table-wrapper,
  .modal-content,
  .list-group-item {
    background: linear-gradient(160deg, rgba(47, 69, 104, 0.92), rgba(24, 38, 63, 0.9));
    box-shadow: 0 16px 30px rgba(4, 10, 22, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  .form-control,
  .form-select,
  .input-group-text {
    background: rgba(32, 49, 80, 0.94);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .btn-primary,
  .btn-accent,
  .btn-secondary,
  .btn-outline-secondary {
    background-image: none;
  }
}

/* Strong override: sidebar bottom toggle size */
.sidebar-wrap #sidebar-toggle.sidebar-toggle-btn.btn {
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
}

.sidebar-wrap #sidebar-toggle.sidebar-toggle-btn.btn i {
  font-size: 0.65rem !important;
  line-height: 1 !important;
}
