/* Bugfix v2.3.1: elemen beratribut hidden tidak boleh ditimpa display grid/flex dari CSS. */
[hidden] { display: none !important; }

.admin-body.admin-login-mode {
  overflow: hidden;
}

.admin-body.admin-login-mode .admin-login {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
}

.admin-body { background: #f4f7f5; min-height: 100vh; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; color: white; background: #0c2f1b; display: flex; flex-direction: column; z-index: 40; }
.admin-brand { display: flex; align-items: center; gap: 12px; padding: 4px 7px 25px; border-bottom: 1px solid rgba(255,255,255,.10); }
.admin-brand img { width: 46px; height: 46px; border-radius: 14px; }
.admin-brand strong, .admin-brand span { display: block; }
.admin-brand strong { font-size: 16px; }
.admin-brand span { margin-top: 4px; color: #8fb69d; font-size: 10px; }
.admin-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 24px; }
.admin-nav button, .sidebar-bottom a, .sidebar-bottom button { width: 100%; min-height: 46px; border: 0; border-radius: 13px; padding: 0 13px; display: flex; align-items: center; gap: 12px; color: #a9c1b1; background: transparent; font-weight: 700; font-size: 12px; text-align: left; transition: .2s ease; }
.admin-nav button:hover, .admin-nav button.active, .sidebar-bottom a:hover, .sidebar-bottom button:hover { color: white; background: rgba(255,255,255,.09); }
.admin-nav button.active { box-shadow: inset 3px 0 0 #35c878; }
.admin-nav button > span, .sidebar-bottom span { width: 22px; text-align: center; font-size: 17px; }
.admin-nav em { margin-left: auto; min-width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; background: #1ea75b; color: white; font-style: normal; font-size: 9px; }
.sidebar-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.10); }
.sidebar-bottom button { margin-top: 3px; }
.admin-main { min-width: 0; }
.admin-topbar { min-height: 84px; padding: 16px 32px; border-bottom: 1px solid #e0e7e2; background: rgba(255,255,255,.93); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; }
.admin-topbar > div:nth-child(2) { margin-right: auto; }
.admin-topbar p { margin: 0 0 3px; color: var(--muted); font-size: 10px; }
.admin-topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.admin-menu { display: none; width: 40px; height: 40px; margin-right: 12px; border: 0; border-radius: 12px; background: var(--soft); }
.admin-profile { display: flex; align-items: center; gap: 11px; }
.admin-profile > div { text-align: right; }
.admin-profile b, .admin-profile small { display: block; }
.admin-profile b { font-size: 11px; }
.admin-profile small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.admin-profile > span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: white; background: var(--green-700); font-size: 11px; font-weight: 800; }
.admin-content { padding: 28px 32px 70px; }
.admin-view { display: none; }
.admin-view.active { display: block; }
.dashboard-hero { min-height: 220px; padding: 34px; border-radius: 28px; color: white; background: linear-gradient(120deg, #0b6034, #13964d); display: flex; justify-content: space-between; align-items: center; gap: 30px; overflow: hidden; position: relative; }
.dashboard-hero::after { content: '🥬'; position: absolute; right: 28%; bottom: -45px; font-size: 180px; opacity: .08; transform: rotate(-8deg); }
.dashboard-hero h2 { max-width: 650px; margin: 10px 0 9px; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.dashboard-hero p { max-width: 630px; margin: 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.7; }
.store-switch-card { min-width: 245px; padding: 18px; border: 1px solid rgba(255,255,255,.17); border-radius: 18px; background: rgba(255,255,255,.10); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: space-between; gap: 18px; position: relative; z-index: 2; }
.store-switch-card > div { display: flex; align-items: center; gap: 10px; }
#admin-store-dot { width: 10px; height: 10px; border-radius: 50%; background: #53e490; box-shadow: 0 0 0 6px rgba(83,228,144,.12); }
.store-switch-card p { margin: 0; }
.store-switch-card b, .store-switch-card small { display: block; }
.store-switch-card b { font-size: 11px; }
.store-switch-card small { margin-top: 4px; font-size: 8px; }
.switch { position: relative; width: 44px; height: 25px; flex: 0 0 44px; }
.switch input { opacity: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.24); transition: .2s ease; }
.switch i::after { content: ''; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .2s ease; }
.switch input:checked + i { background: #2ed473; }
.switch input:checked + i::after { transform: translateX(19px); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.metric-grid article { min-height: 126px; padding: 20px; border: 1px solid #e0e8e2; border-radius: 19px; background: white; display: flex; align-items: center; gap: 14px; }
.metric-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 15px; display: grid; place-items: center; font-size: 21px; }
.metric-icon.green { background: #e5f7ec; }
.metric-icon.orange { background: #fff0da; }
.metric-icon.blue { background: #e5f1ff; }
.metric-icon.purple { background: #f0e9ff; }
.metric-grid p { margin: 0; min-width: 0; }
.metric-grid small, .metric-grid b, .metric-grid em { display: block; }
.metric-grid small { color: var(--muted); font-size: 9px; }
.metric-grid b { margin-top: 5px; font-size: 22px; }
.metric-grid em { margin-top: 4px; color: #8c9890; font-size: 8px; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; margin-top: 18px; }
.dashboard-grid.lower { grid-template-columns: 1fr 1fr; }
.panel { border: 1px solid #e0e8e2; border-radius: 20px; background: white; padding: 21px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.panel-heading h3 { margin: 6px 0 0; font-size: 17px; letter-spacing: -.02em; }
.panel-chip { padding: 7px 10px; border-radius: 999px; color: var(--green-800); background: var(--green-50); font-size: 8px; font-weight: 800; }
.text-button { border: 0; background: transparent; color: var(--green-700); font-size: 9px; font-weight: 800; }
.order-chart { height: 230px; margin-top: 24px; padding: 10px 4px 0; display: flex; align-items: end; justify-content: space-between; gap: 13px; border-bottom: 1px solid #edf1ee; }
.chart-column { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 7px; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: end; justify-content: center; }
.chart-bar { width: min(38px, 76%); min-height: 5px; border-radius: 9px 9px 3px 3px; background: linear-gradient(180deg, #2aba69, #138747); position: relative; transition: .3s ease; }
.chart-bar:hover { filter: brightness(1.08); }
.chart-bar span { position: absolute; left: 50%; top: -20px; transform: translateX(-50%); color: var(--green-800); font-size: 8px; font-weight: 800; }
.chart-column small { color: var(--muted); font-size: 8px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.quick-grid button { min-height: 100px; border: 1px solid #e2e9e4; border-radius: 15px; padding: 14px; background: #fafcfb; text-align: left; transition: .2s ease; }
.quick-grid button:hover { transform: translateY(-2px); border-color: #b7dcc5; background: var(--green-50); }
.quick-grid span, .quick-grid b, .quick-grid small { display: block; }
.quick-grid span { font-size: 20px; }
.quick-grid b { margin-top: 8px; font-size: 10px; }
.quick-grid small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.recent-list { margin-top: 16px; }
.recent-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid #edf1ee; }
.recent-row:last-child { border-bottom: 0; }
.recent-row > span { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--green-50); }
.recent-row p { margin: 0; min-width: 0; }
.recent-row b, .recent-row small { display: block; }
.recent-row b { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.recent-row strong { font-size: 10px; color: var(--green-800); }
.recent-empty { padding: 26px 0; text-align: center; color: var(--muted); font-size: 10px; }
.view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.view-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.toolbar-actions { display: flex; gap: 9px; }
.toolbar-actions input, .toolbar-actions select { min-height: 42px; border: 1px solid #dce5df; border-radius: 12px; background: white; padding: 0 13px; outline: 0; font-size: 10px; }
.toolbar-actions input { width: 230px; }
.admin-primary { min-height: 42px; border: 0; border-radius: 12px; padding: 0 16px; background: var(--green-700); color: white; font-weight: 800; font-size: 10px; box-shadow: 0 8px 18px rgba(18,135,70,.16); }
.admin-primary:hover { background: var(--green-900); transform: translateY(-1px); }
.admin-primary.full { width: 100%; }
.table-panel { padding: 0; overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 14px 16px; color: #738078; background: #f7faf8; font-size: 8px; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid #edf1ee; font-size: 10px; vertical-align: middle; }
.product-cell { min-width: 220px; display: flex; align-items: center; gap: 10px; }
.product-cell > span { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; background: var(--green-50); font-size: 21px; }
.product-cell b, .product-cell small { display: block; }
.product-cell small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; color: #526058; background: #edf2ee; font-size: 8px; font-weight: 800; white-space: nowrap; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.green { color: #10783e; background: #e4f7eb; }
.status-badge.orange { color: #a05a00; background: #fff1d9; }
.status-badge.red { color: #bd403a; background: #feeceb; }
.status-badge.blue { color: #246ca7; background: #e6f2ff; }
.action-menu { display: flex; gap: 6px; }
.action-menu button { min-height: 32px; border: 1px solid #dfe7e1; border-radius: 9px; padding: 0 10px; background: white; color: #526158; font-size: 8px; font-weight: 800; }
.action-menu button:hover { background: var(--green-50); border-color: #bdddc8; }
.action-menu button.danger:hover { color: var(--danger); background: #fff0ef; border-color: #f3c4c1; }
.admin-empty { padding: 70px 20px; text-align: center; }
.admin-empty span { font-size: 54px; }
.admin-empty h3 { margin: 12px 0 6px; }
.admin-empty p { margin: 0; color: var(--muted); font-size: 10px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; align-items: start; }
.settings-form:last-child { grid-column: 1 / -1; }
.settings-form label, .admin-modal label { display: block; margin-top: 14px; color: #536158; font-size: 9px; font-weight: 800; }
.settings-form input, .settings-form textarea, .admin-modal input, .admin-modal textarea, .admin-modal select { width: 100%; margin-top: 7px; border: 1px solid #dce5df; border-radius: 11px; padding: 11px 12px; outline: 0; background: white; color: var(--ink); font-size: 10px; }
.settings-form input:focus, .settings-form textarea:focus, .admin-modal input:focus, .admin-modal textarea:focus, .admin-modal select:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(30,167,91,.10); }
.settings-form .admin-primary { margin-top: 18px; }
.admin-field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.shipping-simulator { margin-top: 17px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.shipping-simulator div { padding: 11px 8px; border-radius: 11px; background: #f4f8f5; text-align: center; }
.shipping-simulator b, .shipping-simulator small { display: block; }
.shipping-simulator b { font-size: 9px; }
.shipping-simulator small { margin-top: 4px; color: var(--green-800); font-size: 8px; font-weight: 800; }
.admin-overlay { position: fixed; z-index: 80; inset: 0; background: rgba(5,24,12,.55); backdrop-filter: blur(4px); }
.admin-modal { position: fixed; z-index: 90; left: 50%; top: 50%; width: min(620px, calc(100% - 26px)); max-height: calc(100vh - 30px); overflow-y: auto; padding: 24px; border-radius: 22px; background: white; box-shadow: 0 35px 100px rgba(0,0,0,.25); transform: translate(-50%, -47%) scale(.97); opacity: 0; visibility: hidden; transition: .22s ease; }
.admin-modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.admin-modal-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.admin-modal-head h2 { margin: 5px 0 0; font-size: 24px; }
.admin-modal form { margin-top: 18px; }
.admin-field-grid.checks { margin-top: 14px; }
.admin-field-grid.checks label { margin: 0; padding: 12px; border: 1px solid #e0e8e2; border-radius: 11px; display: flex; align-items: center; gap: 8px; }
.admin-field-grid.checks input { width: auto; margin: 0; }
.form-help { color: var(--muted); font-size: 8px; line-height: 1.6; }
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.detail-card { padding: 14px; border: 1px solid #e1e8e3; border-radius: 14px; background: #fafcfb; }
.detail-card h4 { margin: 0 0 10px; font-size: 10px; }
.detail-card p { margin: 5px 0; color: #526158; font-size: 9px; line-height: 1.5; }
.order-lines { grid-column: 1 / -1; }
.order-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid #e7ede9; align-items: center; }
.order-line.product-order-line { grid-template-columns: 46px 1fr auto; }
.order-line-media { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: #edf7f0; font-size: 23px; }
.order-line-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.order-line:last-child { border-bottom: 0; }
.order-line p { margin: 0; }
.order-total { margin-top: 12px; padding-top: 12px; border-top: 1px solid #dfe7e1; display: flex; justify-content: space-between; font-size: 13px; }
.order-status-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.order-status-actions button { min-height: 34px; border: 1px solid #dbe4de; border-radius: 10px; padding: 0 10px; background: white; font-size: 8px; font-weight: 800; }
.order-status-actions button:hover { border-color: var(--green-600); color: var(--green-800); }

@media (max-width: 1050px) {
  .admin-shell { grid-template-columns: 210px 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .admin-body { padding-bottom: 0; }
  .admin-shell { display: block; }
  .admin-sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 250px; transition: .25s ease; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-menu { display: grid; place-items: center; }
  .admin-topbar { padding: 13px 14px; }
  .admin-profile > div { display: none; }
  .admin-content { padding: 18px 13px 50px; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 25px 22px; }
  .store-switch-card { width: 100%; min-width: 0; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-grid article { min-height: 112px; padding: 14px; align-items: flex-start; flex-direction: column; gap: 8px; }
  .metric-icon { width: 38px; height: 38px; flex-basis: 38px; }
  .dashboard-grid.lower { grid-template-columns: 1fr; }
  .view-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { flex-direction: column; }
  .toolbar-actions input, .toolbar-actions select, .toolbar-actions .admin-primary { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-form:last-child { grid-column: auto; }
  .shipping-simulator { grid-template-columns: repeat(3, 1fr); }
  .admin-field-grid { grid-template-columns: 1fr; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .order-lines { grid-column: auto; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(82, 210, 139, .22), transparent 38%),
    linear-gradient(145deg, #f2fbf5, #eef3f0);
}

.admin-login[hidden] { display: none; }

.admin-login-card {
  width: min(100%, 430px);
  background: #fff;
  border: 1px solid rgba(15, 116, 61, .12);
  border-radius: 26px;
  padding: 34px;
  box-shadow: 0 24px 70px rgba(24, 73, 45, .14);
}

.admin-login-card > img { width: 66px; height: 66px; margin-bottom: 20px; }
.admin-login-card h1 { margin: 7px 0 8px; font-size: 2rem; }
.admin-login-card > p { color: var(--text-muted); margin: 0 0 22px; line-height: 1.6; }
.admin-login-card label { display: grid; gap: 7px; margin-top: 15px; font-weight: 700; }
.admin-login-card input { width: 100%; border: 1px solid #d8e2dc; border-radius: 12px; padding: 13px 14px; font: inherit; }
.admin-login-card button { margin-top: 22px; }
#admin-login-message { display: block; min-height: 22px; margin-top: 12px; color: #c83c3c; }

.product-image-field {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.product-image-preview {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #edf7f0;
  border: 1px dashed #9fc7ab;
  border-radius: 18px;
  font-size: 48px;
}

.product-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.product-image-field input[type="file"] { padding: 10px; }
.product-image-field small { color: var(--text-muted); font-weight: 400; }

@media (max-width: 560px) {
  .admin-login-card { padding: 26px 20px; }
  .product-image-field { grid-template-columns: 88px 1fr; }
  .product-image-preview { width: 88px; height: 88px; }
}

.product-cell span img,
.recent-row > span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* v2.2: kategori, promo, dan biaya layanan cepat */
.toggle-field {
  display: flex !important;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #dce5df;
  border-radius: 11px;
  background: #f8fbf9;
}
.toggle-field input { width: auto !important; margin: 0 !important; }
.promotion-modal { width: min(760px, calc(100% - 26px)); }
.mini-chip {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e9f8ee;
  color: #14763c;
  font-size: 8px;
  font-weight: 800;
}
.responsive-table code {
  padding: 4px 7px;
  border-radius: 7px;
  background: #f1f5f2;
  color: #34473a;
  font-size: 9px;
}
.admin-nav { overflow-y: auto; }


/* v2.3: upload QRIS dan legal */
.qris-upload-field { margin-top: 14px; display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.qris-image-preview { width: 150px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 1px dashed #9fc7ab; border-radius: 18px; background: #f5fbf7; color: var(--green-700); font-size: 54px; }
.qris-image-preview img { width: 100%; height: 100%; object-fit: contain; display: block; background: white; }
.qris-upload-field label { margin-top: 0; }
.qris-upload-field small { display: block; margin-top: 8px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.danger-text { margin-top: 8px; color: var(--danger) !important; }
@media (max-width: 560px) {
  .qris-upload-field { grid-template-columns: 100px 1fr; }
  .qris-image-preview { width: 100px; }
}
.admin-brand > div { min-width: 0; }
.admin-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-hero h2 span { overflow-wrap: anywhere; }
