
/* =========================================================
   WARUNG TANI ADMINJS CUSTOM THEME & IMAGE PREVIEW STYLES
   ========================================================= */

/* Theme Toggle Button Styles */
.wt-theme-toggle-topbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-left: auto;
  margin-right: 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wt-theme-toggle-topbar:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
  border-color: #94a3b8;
}

html[data-theme='dark'] .wt-theme-toggle-topbar {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html[data-theme='dark'] .wt-theme-toggle-topbar:hover {
  background: #334155;
  color: #4ade80;
  border-color: #22c55e;
}

/* Hide default AdminJS SVG icon in sidebar, header, and themes */
[data-css="sidebar"] > a:first-child svg,
[data-css="sidebar-logo"] svg,
a[data-css="sidebar-logo"] svg,
[data-css*="sidebar-logo"] svg,
.adminjs_Sidebar header svg,
.adminjs_Sidebar > a:first-child svg,
aside header svg,
aside > a:first-child svg,
aside a[href*="/admin"] svg,
[data-css*="branding"] svg {
  display: none !important;
}

/* Sidebar Warung Tani Logo & Branding */
.wt-sidebar-branding-link,
[data-css="sidebar-logo"],
a[data-css="sidebar-logo"] {
  padding: 14px 18px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  text-decoration: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

html[data-theme='dark'] .wt-sidebar-branding-link,
html[data-theme='dark'] [data-css="sidebar-logo"],
html[data-theme='dark'] a[data-css="sidebar-logo"] {
  border-bottom: 1px solid #334155 !important;
}

.wt-sidebar-branding-link:hover,
[data-css="sidebar-logo"]:hover,
a[data-css="sidebar-logo"]:hover {
  background: rgba(22, 101, 52, 0.05) !important;
}

html[data-theme='dark'] .wt-sidebar-branding-link:hover,
html[data-theme='dark'] [data-css="sidebar-logo"]:hover,
html[data-theme='dark'] a[data-css="sidebar-logo"]:hover {
  background: rgba(34, 197, 94, 0.08) !important;
}


.wt-brand-logo-box {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  background: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  flex-shrink: 0 !important;
  padding: 3px !important;
  border: 1.5px solid #22c55e !important;
  box-sizing: border-box !important;
}

html[data-theme='dark'] .wt-brand-logo-box {
  background: #ffffff !important;
  border-color: #4ade80 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
}

.wt-brand-logo-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}

.wt-brand-text {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  line-height: 1.25 !important;
  overflow: hidden !important;
}

.wt-brand-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #166534 !important;
  letter-spacing: -0.02em !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

html[data-theme='dark'] .wt-brand-title {
  color: #4ade80 !important;
}

.wt-brand-subtitle {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  letter-spacing: 0.01em !important;
  white-space: nowrap !important;
}

html[data-theme='dark'] .wt-brand-subtitle {
  color: #94a3b8 !important;
}

/* Hide any legacy floating toggle */
.wt-floating-toggle {
  display: none !important;
}

/* =========================================================
   PRODUCT IMAGE PREVIEW STYLES
   ========================================================= */

.wt-image-preview-wrapper {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

html[data-theme='dark'] .wt-image-preview-wrapper {
  border-color: #334155;
  background: #131b2e;
}

.wt-image-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html[data-theme='dark'] .wt-image-preview-header {
  color: #94a3b8;
}

.wt-preview-badge-success {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #dcfce7;
  color: #15803d;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}

html[data-theme='dark'] .wt-preview-badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.wt-preview-badge-error {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fee2e2;
  color: #b91c1c;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}

html[data-theme='dark'] .wt-preview-badge-error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.wt-preview-badge-loading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}

html[data-theme='dark'] .wt-preview-badge-loading {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.wt-img-preview-box {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 160px;
  max-height: 240px;
  overflow: hidden;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 8px;
  position: relative;
}

html[data-theme='dark'] .wt-img-preview-box {
  background: #0b0f19;
  border-color: #334155;
}

.wt-img-preview-box img {
  max-height: 220px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.wt-img-preview-box img:hover {
  transform: scale(1.02);
}

.wt-empty-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  color: #94a3b8;
  text-align: center;
}

html[data-theme='dark'] .wt-empty-preview {
  border-color: #334155;
  color: #64748b;
}

.wt-empty-preview-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.wt-preview-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.wt-preview-link {
  color: #16a34a;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wt-preview-link:hover {
  text-decoration: underline;
  color: #22c55e;
}

/* List Table Thumbnail */
.wt-list-thumbnail {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
}

.wt-list-thumbnail:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: #22c55e;
  z-index: 20;
  position: relative;
}

html[data-theme='dark'] .wt-list-thumbnail {
  border-color: #475569;
}

.wt-thumbnail-placeholder {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  font-size: 18px;
  color: #94a3b8;
}

html[data-theme='dark'] .wt-thumbnail-placeholder {
  background: #1e293b;
  border-color: #475569;
}

/* Image Zoom Lightbox Modal */
.wt-img-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: wtFadeIn 0.15s ease-out;
}

@keyframes wtFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.wt-img-modal-content {
  background: #ffffff;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 85vh;
  padding: 16px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

html[data-theme='dark'] .wt-img-modal-content {
  background: #1e293b;
  border: 1px solid #334155;
}

.wt-img-modal-content img {
  max-width: 100%;
  max-height: calc(85vh - 70px);
  object-fit: contain;
  border-radius: 8px;
}

.wt-img-modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  background: #ef4444;
  color: #ffffff;
  border: 2px solid #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}

.wt-img-modal-close:hover {
  transform: scale(1.1);
  background: #dc2626;
}

/* =========================================================
   COMPREHENSIVE DARK THEME OVERRIDES FOR ADMINJS
   ========================================================= */

html[data-theme='dark'],
body.theme-dark {
  color-scheme: dark !important;
  background-color: #0b0f19 !important;
  color: #f1f5f9 !important;
}

html[data-theme='dark'] #app {
  background-color: #0b0f19 !important;
}

/* =========================================================
   LAYOUT TOKENS (light / dark)
   ========================================================= */
:root {
  --wt-bg: #f1f5f9;
  --wt-surface: #ffffff;
  --wt-surface-2: #f8fafc;
  --wt-border: #e2e8f0;
  --wt-text: #0f172a;
  --wt-muted: #64748b;
}

html[data-theme='dark'] {
  --wt-bg: #0b0f19;
  --wt-surface: #131b2e;
  --wt-surface-2: #0f172a;
  --wt-border: #1e293b;
  --wt-text: #f1f5f9;
  --wt-muted: #94a3b8;
}

[data-css="app"],
[data-css="app-content"] {
  background-color: var(--wt-bg) !important;
}

/* TopBar: fixed 56px header (rendered by our custom TopBar component) */
header.wt-topbar-wrapper,
[data-css="topbar"] {
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  flex: 0 0 56px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  padding: 0 28px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background-color: var(--wt-surface) !important;
  border-bottom: 1px solid var(--wt-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  color: var(--wt-text) !important;
}

.wt-topbar-title {
  color: var(--wt-text);
}

.wt-theme-toggle-topbar {
  margin: 0 !important;
}

/* Sidebar Navigation (dark) */
html[data-theme='dark'] aside,
html[data-theme='dark'] [data-css="sidebar"],
html[data-theme='dark'] .adminjs_Sidebar {
  background-color: #090d16 !important;
  border-right: 1px solid #1e293b !important;
}

html[data-theme='dark'] [data-css="sidebar"] section,
html[data-theme='dark'] [data-css="sidebar-resources"],
html[data-theme='dark'] [data-css="sidebar-footer"] {
  background-color: transparent !important;
}

html[data-theme='dark'] [data-css="sidebar"] a,
html[data-theme='dark'] [data-css="sidebar"] label,
html[data-theme='dark'] [data-css="sidebar"] span,
html[data-theme='dark'] [data-css="sidebar"] svg {
  color: #94a3b8 !important;
}

html[data-theme='dark'] [data-css="sidebar"] a:hover {
  color: #22c55e !important;
  background-color: rgba(34, 197, 94, 0.1) !important;
}

html[data-theme='dark'] [data-css="sidebar"] a[class*="selected"],
html[data-theme='dark'] [data-css="sidebar"] a.active {
  color: #22c55e !important;
  background-color: rgba(34, 197, 94, 0.15) !important;
}

html[data-theme='dark'] .wt-brand-title { color: #4ade80 !important; }

/* Dark: generic AdminJS boxes become transparent over the dark page background */
html[data-theme='dark'] [data-css="app-content"] section.adminjs_Box {
  background-color: transparent !important;
  border-color: var(--wt-border) !important;
}

html[data-theme='dark'] [data-css="app-content"] :is(h1, h2, h3, h4, h5, h6, p, label, td, .adminjs_Text, .adminjs_Header, .adminjs_Label) {
  color: var(--wt-text);
}

/* Breadcrumbs: plain text, no background */
[data-css$="-breadcrumbs"],
.adminjs_Breadcrumbs {
  background: transparent !important;
}

[data-css$="-breadcrumbs"] a,
.adminjs_Breadcrumbs a {
  background: transparent !important;
  color: var(--wt-muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
}

[data-css$="-breadcrumbs"] a:hover,
.adminjs_Breadcrumbs a:hover {
  color: #22c55e !important;
}

/* Table card */
[data-css$="-table-wrapper"] {
  background-color: var(--wt-surface) !important;
  border: 1px solid var(--wt-border) !important;
  border-radius: 12px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

table.adminjs_Table {
  width: 100% !important;
  border-collapse: collapse !important;
  background: transparent !important;
}

[data-css$="-table-head"],
[data-css$="-table-head"] tr,
[data-css$="-table-head"] td {
  background-color: var(--wt-surface-2) !important;
}

[data-css$="-table-head"] td {
  color: var(--wt-muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--wt-border) !important;
  white-space: nowrap !important;
}

[data-css$="-table-head"] td a,
[data-css$="-table-head"] td span {
  color: inherit !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

table.adminjs_Table tbody td {
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--wt-border) !important;
  vertical-align: middle !important;
  font-size: 13px !important;
  color: var(--wt-text);
  background-color: transparent !important;
}

table.adminjs_Table tbody td {
  white-space: nowrap !important;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.adminjs_Table tr,
table.adminjs_Table td {
  border-left: none !important;
  border-right: none !important;
}

table.adminjs_Table tbody tr:last-child td {
  border-bottom: none !important;
}

table.adminjs_Table tbody tr:hover td {
  background-color: var(--wt-surface-2) !important;
}

table.adminjs_Table tbody td a {
  color: #16a34a !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

html[data-theme='dark'] table.adminjs_Table tbody td a {
  color: #4ade80 !important;
}

/* Custom badge cells never wrap */
.wt-badge,
.wt-status-badge,
.wt-area-badge,
.wt-wa-link,
.wt-maps-link,
.wt-currency-text {
  white-space: nowrap !important;
}

/* Form Inputs */
html[data-theme='dark'] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme='dark'] textarea,
html[data-theme='dark'] select,
html[data-theme='dark'] .adminjs_Input {
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

html[data-theme='dark'] input:focus,
html[data-theme='dark'] textarea:focus,
html[data-theme='dark'] select:focus {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25) !important;
}

/* Headings & Labels */
html[data-theme='dark'] h1,
html[data-theme='dark'] h2,
html[data-theme='dark'] h3,
html[data-theme='dark'] h4,
html[data-theme='dark'] h5,
html[data-theme='dark'] h6 {
  color: #f8fafc !important;
}

html[data-theme='dark'] label,
html[data-theme='dark'] .adminjs_Label {
  color: #cbd5e1 !important;
  font-weight: 600 !important;
}

/* Property helper text & descriptions */
html[data-theme='dark'] [data-css*="property-description"],
html[data-theme='dark'] [data-css*="form-message"],
html[data-theme='dark'] .adminjs_FormMessage,
html[data-theme='dark'] [data-css*="FormMessage"],
html[data-theme='dark'] small,
html[data-theme='dark'] p[color="grey"],
html[data-theme='dark'] span[color="grey"] {
  color: #94a3b8 !important;
  font-size: 12px !important;
}

/* Badges & Status Pills in Tables */
html[data-theme='dark'] [data-css*="badge"],
html[data-theme='dark'] .adminjs_Badge,
html[data-theme='dark'] span[variant] {
  font-weight: 600 !important;
}

html[data-theme='dark'] [data-css*="badge"][variant="default"],
html[data-theme='dark'] .adminjs_Badge[variant="default"] {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

/* Action Header & Search & Filter buttons */
html[data-theme='dark'] [data-css*="action-header"] input {
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

html[data-theme='dark'] [data-css*="action-header"] button,
html[data-theme='dark'] [data-css*="action-header"] a[data-css$="-button"] {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

html[data-theme='dark'] [data-css*="action-header"] button:hover,
html[data-theme='dark'] [data-css*="action-header"] a[data-css$="-button"]:hover {
  background-color: #334155 !important;
  color: #4ade80 !important;
}

/* Dropdown Menus & Popovers */
html[data-theme='dark'] [data-css*="dropdown"],
html[data-theme='dark'] [data-css*="popover"],
html[data-theme='dark'] [data-css*="action-menu"],
html[data-theme='dark'] .adminjs_Dropdown {
  background-color: #131b2e !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme='dark'] [data-css*="dropdown"] a,
html[data-theme='dark'] [data-css*="dropdown"] button,
html[data-theme='dark'] [data-css*="popover"] a,
html[data-theme='dark'] [data-css*="popover"] button {
  color: #f1f5f9 !important;
}

html[data-theme='dark'] [data-css*="dropdown"] a:hover,
html[data-theme='dark'] [data-css*="dropdown"] button:hover,
html[data-theme='dark'] [data-css*="popover"] a:hover,
html[data-theme='dark'] [data-css*="popover"] button:hover {
  background-color: #1e293b !important;
  color: #4ade80 !important;
}

/* Pagination */
html[data-theme='dark'] [data-css*="pagination"],
html[data-theme='dark'] .adminjs_Pagination,
html[data-theme='dark'] nav[aria-label="pagination"] {
  color: #cbd5e1 !important;
}

html[data-theme='dark'] [data-css*="pagination"] a,
html[data-theme='dark'] [data-css*="pagination"] button,
html[data-theme='dark'] [data-css*="pagination"] span {
  color: #f8fafc !important;
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
}

html[data-theme='dark'] [data-css*="pagination"] a:hover,
html[data-theme='dark'] [data-css*="pagination"] button:hover {
  background-color: #334155 !important;
  color: #4ade80 !important;
}

html[data-theme='dark'] [data-css*="pagination"] [data-css*="active"],
html[data-theme='dark'] [data-css*="pagination"] .active,
html[data-theme='dark'] [data-css*="pagination"] a[data-css*="active"] {
  background-color: #166534 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: #22c55e !important;
}

/* Property Show View */
html[data-theme='dark'] [data-css*="property-show"] label,
html[data-theme='dark'] [data-css*="property"] label {
  color: #94a3b8 !important;
  font-weight: 600 !important;
}

html[data-theme='dark'] [data-css*="property-show"] div,
html[data-theme='dark'] [data-css*="property-show"] span,
html[data-theme='dark'] [data-css*="property-show"] section {
  color: #f8fafc !important;
}

/* Drawer Container & Layering (Always above TopBar) */
[data-css*="drawer"],
[data-css*="filter-drawer"],
[data-css*="FilterDrawer"],
.adminjs_Drawer,
form[data-css*="filter-drawer"] {
  z-index: 1005 !important;
}

/* Filter Drawer & Form Panels */
html[data-theme='dark'] [data-css*="drawer"],
html[data-theme='dark'] [data-css*="filter-drawer"],
html[data-theme='dark'] [data-css*="FilterDrawer"],
html[data-theme='dark'] .adminjs_Drawer,
html[data-theme='dark'] [data-css="drawer"] {
  background-color: #0f172a !important;
  border-left: 1px solid #1e293b !important;
  color: #f8fafc !important;
  box-shadow: -6px 0 30px rgba(0, 0, 0, 0.7) !important;
}

/* Drawer Header: Title & Close Button separation */
[data-css*="filter-drawer"] [data-css*="filter-drawer-content"] > div:first-child,
[data-css*="drawer"] [data-css*="drawer-content"] > div:first-child,
[data-css*="drawer"] header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 20px 14px 20px !important;
  margin: -16px -16px 20px -16px !important;
  border-bottom: 1px solid #e2e8f0;
}

html[data-theme='dark'] [data-css*="filter-drawer"] [data-css*="filter-drawer-content"] > div:first-child,
html[data-theme='dark'] [data-css*="drawer"] [data-css*="drawer-content"] > div:first-child,
html[data-theme='dark'] [data-css*="drawer"] header {
  border-bottom-color: #1e293b !important;
  background-color: #0f172a !important;
}

[data-css*="filter-drawer"] h3,
[data-css*="drawer"] h3 {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: #0f172a;
}

html[data-theme='dark'] [data-css*="filter-drawer"] h3,
html[data-theme='dark'] [data-css*="drawer"] h3 {
  color: #f8fafc !important;
}

/* Close Button (X) */
[data-css*="filter-drawer"] button[size="icon"],
[data-css*="drawer"] button[size="icon"],
[data-css*="filter-drawer"] button[variant="light"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  border-radius: 9999px !important;
  background-color: rgba(100, 116, 139, 0.12) !important;
  border: 1px solid rgba(100, 116, 139, 0.2) !important;
  color: #475569 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
}

[data-css*="filter-drawer"] button[size="icon"]:hover,
[data-css*="drawer"] button[size="icon"]:hover {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  transform: rotate(90deg);
}

html[data-theme='dark'] [data-css*="filter-drawer"] button[size="icon"],
html[data-theme='dark'] [data-css*="drawer"] button[size="icon"],
html[data-theme='dark'] [data-css*="filter-drawer"] button[variant="light"] {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme='dark'] [data-css*="filter-drawer"] button[size="icon"]:hover,
html[data-theme='dark'] [data-css*="drawer"] button[size="icon"]:hover {
  background-color: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

html[data-theme='dark'] [data-css*="drawer"] h1,
html[data-theme='dark'] [data-css*="drawer"] h2,
html[data-theme='dark'] [data-css*="drawer"] h4,
html[data-theme='dark'] [data-css*="drawer"] span,
html[data-theme='dark'] [data-css*="drawer"] p {
  color: #f8fafc !important;
}

html[data-theme='dark'] [data-css*="drawer"] label,
html[data-theme='dark'] [data-css*="filter"] label,
html[data-theme='dark'] [data-css*="filter-drawer"] label {
  color: #94a3b8 !important;
  font-weight: 600 !important;
}

html[data-theme='dark'] [data-css*="filter"] input,
html[data-theme='dark'] [data-css*="drawer"] input,
html[data-theme='dark'] [data-css*="filter-drawer"] input {
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

/* Breadcrumbs */
html[data-theme='dark'] [data-css*="breadcrumbs"],
html[data-theme='dark'] [data-css*="breadcrumbs"] a {
  color: #94a3b8 !important;
}

/* React-Select Dropdowns & Filter Controls */
html[data-theme='dark'] [class*="-control"],
html[data-theme='dark'] .adminjs_Select,
html[data-theme='dark'] [data-css*="select"] {
  background-color: #0b0f19 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme='dark'] [class*="-control"]:hover {
  border-color: #475569 !important;
}

html[data-theme='dark'] [class*="-control"][class*="--is-focused"] {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25) !important;
}

/* Selected Value text inside React-Select (e.g. Category SAYUR_BUAH, PoStatus) */
html[data-theme='dark'] [class*="-singleValue"],
html[data-theme='dark'] [class*="-SingleValue"],
html[data-theme='dark'] [class*="-single-value"],
html[data-theme='dark'] [class*="-ValueContainer"],
html[data-theme='dark'] [class*="-ValueContainer"] *,
html[data-theme='dark'] div[class*="singleValue"],
html[data-theme='dark'] span[class*="singleValue"],
html[data-theme='dark'] [data-css*="select"] [class*="singleValue"] {
  color: #f8fafc !important;
}

/* Search input inside React-Select */
html[data-theme='dark'] [class*="-Input"],
html[data-theme='dark'] [class*="-Input"] input,
html[data-theme='dark'] [class*="-input"] input {
  color: #f8fafc !important;
}

/* Placeholder text */
html[data-theme='dark'] [class*="-placeholder"],
html[data-theme='dark'] [class*="-Placeholder"],
html[data-theme='dark'] [class*="-placeholder"] * {
  color: #64748b !important;
}

/* Dropdown Arrow & Clear (x) Indicators */
html[data-theme='dark'] [class*="-indicatorContainer"],
html[data-theme='dark'] [class*="-IndicatorContainer"],
html[data-theme='dark'] [class*="-clearIndicator"],
html[data-theme='dark'] [class*="-IndicatorsContainer"] svg,
html[data-theme='dark'] [class*="-indicator"] svg {
  color: #94a3b8 !important;
  fill: #94a3b8 !important;
  cursor: pointer;
}

html[data-theme='dark'] [class*="-indicatorContainer"]:hover svg,
html[data-theme='dark'] [class*="-clearIndicator"]:hover svg {
  color: #f8fafc !important;
  fill: #f8fafc !important;
}

/* Multi-Value Badges in React-Select */
html[data-theme='dark'] [class*="-multiValue"],
html[data-theme='dark'] [class*="-MultiValue"] {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 4px;
}

html[data-theme='dark'] [class*="-multiValue__label"],
html[data-theme='dark'] [class*="-MultiValueGeneric"] {
  color: #f8fafc !important;
}

html[data-theme='dark'] [class*="-multiValue__remove"]:hover {
  background-color: #ef4444 !important;
  color: #ffffff !important;
}

/* Dropdown Menu & Options */
html[data-theme='dark'] [class*="-menu"],
html[data-theme='dark'] [class*="-Menu"],
html[data-theme='dark'] [class*="-MenuList"] {
  background-color: #131b2e !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
  z-index: 9999 !important;
}

html[data-theme='dark'] [class*="-option"],
html[data-theme='dark'] [class*="-Option"] {
  background-color: transparent !important;
  color: #e2e8f0 !important;
  padding: 8px 12px !important;
  cursor: pointer !important;
}

html[data-theme='dark'] [class*="-option"]:hover,
html[data-theme='dark'] [class*="-option"]:focus,
html[data-theme='dark'] [class*="-option"][class*="--is-focused"] {
  background-color: #1e293b !important;
  color: #4ade80 !important;
}

html[data-theme='dark'] [class*="-option"][class*="--is-selected"] {
  background-color: #166534 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* Primary Action Buttons */
html[data-theme='dark'] button[variant="primary"],
html[data-theme='dark'] .adminjs_Button[variant="primary"] {
  background-color: #16a34a !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
}

html[data-theme='dark'] button[variant="primary"]:hover,
html[data-theme='dark'] .adminjs_Button[variant="primary"]:hover {
  background-color: #22c55e !important;
}

/* Dashboard statistics cards */
html[data-theme='dark'] [data-css="default-dashboard"] svg path {
  fill: #22c55e !important;
}

/* =========================================================
   WARUNG TANI E-GROCERY COMMAND CENTER DASHBOARD STYLES
   ========================================================= */

.wt-cc-container {
  padding: 24px 32px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
  max-width: 1440px;
  margin: 0 auto;
}

html[data-theme='dark'] .wt-cc-container {
  color: #f1f5f9;
}

/* Header & Cut-Off Banner */
.wt-cc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.wt-cc-title-group h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: #166534;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

html[data-theme='dark'] .wt-cc-title-group h1 {
  color: #4ade80;
}

.wt-cc-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

html[data-theme='dark'] .wt-cc-subtitle {
  color: #94a3b8;
}

.wt-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wt-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

html[data-theme='dark'] .wt-time-badge {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

.wt-btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wt-btn-refresh:hover {
  background: #f8fafc;
  border-color: #22c55e;
  color: #166534;
}

html[data-theme='dark'] .wt-btn-refresh {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}

html[data-theme='dark'] .wt-btn-refresh:hover {
  background: #334155;
  border-color: #22c55e;
  color: #4ade80;
}

/* Cutoff Banner */
.wt-cutoff-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  flex-wrap: wrap;
  gap: 12px;
}

html[data-theme='dark'] .wt-cutoff-banner {
  background: #0f231a;
  border-color: #166534;
}

.wt-cutoff-banner.closed {
  background: #eff6ff;
  border-color: #bfdbfe;
}

html[data-theme='dark'] .wt-cutoff-banner.closed {
  background: #0f1c30;
  border-color: #1e3a5f;
}

.wt-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wt-banner-icon {
  font-size: 26px;
  line-height: 1;
}

.wt-banner-title {
  font-weight: 700;
  font-size: 15px;
  color: #166534;
  margin-bottom: 2px;
}

html[data-theme='dark'] .wt-banner-title {
  color: #86efac;
}

.wt-cutoff-banner.closed .wt-banner-title {
  color: #1e40af;
}

html[data-theme='dark'] .wt-cutoff-banner.closed .wt-banner-title {
  color: #93c5fd;
}

.wt-banner-desc {
  font-size: 13px;
  color: #475569;
}

html[data-theme='dark'] .wt-banner-desc {
  color: #94a3b8;
}

.wt-banner-badge {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  background: #166534;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wt-cutoff-banner.closed .wt-banner-badge {
  background: #2563eb;
}

/* 3 Main KPI Cards Grid */
.wt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 1024px) {
  .wt-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.wt-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.wt-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.08);
}

html[data-theme='dark'] .wt-kpi-card {
  background: #131b2e;
  border-color: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html[data-theme='dark'] .wt-kpi-card:hover {
  border-color: #334155;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.wt-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.wt-card-po::before {
  background: linear-gradient(90deg, #166534, #22c55e);
}

.wt-card-fulfillment::before {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.wt-card-waste::before {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.wt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.wt-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

html[data-theme='dark'] .wt-card-title {
  color: #94a3b8;
}

.wt-card-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.wt-card-po .wt-card-icon-box {
  background: #dcfce7;
  color: #15803d;
}

html[data-theme='dark'] .wt-card-po .wt-card-icon-box {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.wt-card-fulfillment .wt-card-icon-box {
  background: #e0f2fe;
  color: #0369a1;
}

html[data-theme='dark'] .wt-card-fulfillment .wt-card-icon-box {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.wt-card-waste .wt-card-icon-box {
  background: #fef3c7;
  color: #d97706;
}

html[data-theme='dark'] .wt-card-waste .wt-card-icon-box {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.wt-card-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 8px;
}

html[data-theme='dark'] .wt-card-value {
  color: #f8fafc;
}

.wt-card-substat {
  font-size: 13px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

html[data-theme='dark'] .wt-card-substat {
  color: #94a3b8;
}

.wt-card-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #64748b;
}

html[data-theme='dark'] .wt-card-footer {
  border-top-color: #1e293b;
  color: #94a3b8;
}

/* Secondary Panels Grid (Areas & Shortcuts) */
.wt-secondary-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
}

@media (max-width: 960px) {
  .wt-secondary-grid {
    grid-template-columns: 1fr;
  }
}

.wt-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

html[data-theme='dark'] .wt-panel {
  background: #131b2e;
  border-color: #1e293b;
}

.wt-panel-header {
  margin-bottom: 16px;
}

.wt-panel-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #0f172a;
}

.wt-panel-header .wt-panel-title {
  margin: 0 0 4px 0;
}

html[data-theme='dark'] .wt-panel-title {
  color: #f8fafc;
}

.wt-panel-subtitle {
  font-size: 12px;
  color: #64748b;
  font-weight: normal;
  margin: 0;
  line-height: 1.4;
}

html[data-theme='dark'] .wt-panel-subtitle {
  color: #94a3b8;
}

/* Area Breakdown Table */
.wt-area-table {
  width: 100%;
  border-collapse: collapse;
}

.wt-area-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

html[data-theme='dark'] .wt-area-table th {
  color: #94a3b8;
  border-bottom-color: #1e293b;
}

.wt-area-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

html[data-theme='dark'] .wt-area-table td {
  border-bottom-color: #1a243b;
}

.wt-area-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #0f172a;
}

html[data-theme='dark'] .wt-area-tag {
  color: #f1f5f9;
}

.wt-area-badge-hub {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

html[data-theme='dark'] .wt-area-badge-hub {
  background: #1e293b;
  color: #94a3b8;
}

/* Pipeline Status Pills */
.wt-status-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.wt-status-pill {
  padding: 10px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html[data-theme='dark'] .wt-status-pill {
  background: #0f172a;
  border-color: #1e293b;
}

.wt-status-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

html[data-theme='dark'] .wt-status-label {
  color: #94a3b8;
}

.wt-status-num {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

html[data-theme='dark'] .wt-status-num {
  color: #f8fafc;
}

/* Quick Action Shortcuts */
.wt-shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wt-shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.wt-shortcut-item:hover {
  background: #f1f5f9;
  border-color: #22c55e;
  transform: translateX(4px);
  color: #166534;
}

html[data-theme='dark'] .wt-shortcut-item {
  background: #0f172a;
  border-color: #1e293b;
  color: #f1f5f9;
}

html[data-theme='dark'] .wt-shortcut-item:hover {
  background: #1e293b;
  border-color: #22c55e;
  color: #4ade80;
}

/* Loading & Error States */
.wt-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  gap: 16px;
  color: #64748b;
  font-size: 14px;
}

.wt-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #bbf7d0;
  border-top-color: #166534;
  border-radius: 50%;
  animation: wtSpin 0.9s linear infinite;
}

html[data-theme='dark'] .wt-spinner {
  border-color: #1e293b;
  border-top-color: #22c55e;
}

/* Inline Editing Styles */
.wt-inline-editable {
  transition: all 0.2s ease;
  border-radius: 4px;
}
.wt-inline-editable:hover {
  background: rgba(59, 130, 246, 0.1) !important;
  outline: 1px dashed rgba(59, 130, 246, 0.4);
}
