:root {
  color: #0e1b2e;
  background: #f3f6fb;
  --ray-blue: #0a4fa6;
  --ray-navy: #0e1b2e;
  --ray-muted: #5b6b80;
  --ray-line: #dbe3ee;
  --ray-gold: #d9b15e;
  --ray-blue-pale: #dde9fb;
  --ray-blue-mid: #4a7fcc;
}
header { background: linear-gradient(115deg, #14204a, #071c45); }
.brand { min-width: 0; }
#open-settings { flex: none; background: #fff; color: var(--ray-blue); }
#open-settings.active { border-color: var(--ray-gold); box-shadow: 0 0 0 2px var(--ray-gold); }
.settings-menu-wrap { position: relative; flex: none; display: flex; align-items: center; gap: 8px; }
#install-app { flex: none; }
.settings-dropdown { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; min-width: 220px; background: #fff; border: 1px solid var(--ray-line); border-radius: 10px; box-shadow: 0 10px 28px rgba(14,27,46,.18); margin: 0; padding: 6px; list-style: none; }
.settings-dropdown[hidden] { display: none; }
.settings-dropdown li { padding: 11px 12px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--ray-navy); font-weight: 600; }
.settings-dropdown li:hover, .settings-dropdown li:focus { background: #eef4fc; color: var(--ray-blue); outline: none; }
.password-card { max-width: 480px; }
.account-actions { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--ray-line); }
.brand-logo { display: block; width: 58px; height: 42px; object-fit: contain; flex: none; padding: 3px; border-radius: 8px; background: #fff; }
.brand small { color: #dbe4f2; }
.login-logo { display: block; width: 150px; height: 104px; object-fit: contain; margin: 0 auto 10px; }
.login { text-align: center; }
.login form, .login form label { text-align: left; }
.login > p:not(.eyebrow) { color: var(--ray-muted); }
.eyebrow { color: #a77819; }
.hero { background: linear-gradient(115deg, #14204a, #0a4fa6); }
.hero .eyebrow { color: #f1d084; }
.hero p:last-child { color: #e4edfa; }
.ai-search-card { margin-bottom: 18px; }
.ai-search-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.ai-search-input button { min-width: 150px; }
.ai-answer { white-space: pre-wrap; line-height: 1.55; padding: 14px; margin: 10px 0; border-radius: 10px; background: #eef5ff; border: 1px solid var(--ray-line); }
.ai-sources { margin-top: 10px; }
.ai-sources .item { overflow-wrap: anywhere; }
.ai-sources .item p { margin: 8px 0; }
.ai-key-help { border-top: 1px solid var(--ray-line); margin: 20px 0; padding-top: 16px; }
.ai-key-help h3 { margin: 0 0 8px; font-size: 16px; }
.staff-import { border-top: 1px solid var(--ray-line); margin: 18px 0; padding-top: 18px; }
.staff-import h3 { margin: 0 0 8px; font-size: 16px; }
.staff-import .hint { margin: 0 0 12px; }
#staff-import-status, #staff-import-results { min-height: 20px; white-space: pre-line; overflow-wrap: anywhere; }
#staff-import-preview { border: 1px solid var(--ray-line); border-radius: 10px; padding: 12px; margin: 12px 0; }
#staff-import-summary { margin: 0 0 10px; font-weight: 700; }
.staff-import-list { max-height: 180px; overflow: auto; overflow-wrap: anywhere; white-space: pre-line; font-size: 13px; line-height: 1.6; }
#staff-import-create { margin-top: 12px; }
@media (max-width: 760px) { .staff-import button { width: 100%; min-height: 48px; } }
@media (max-width: 760px) { .ai-search-input { grid-template-columns: 1fr; } .ai-search-input button { min-height: 48px; width: 100%; } }
@media (max-width: 760px) { .hero p:last-child { display: block; } }
.tabs-main button { background: var(--ray-blue-pale); border-color: var(--ray-blue-pale); color: var(--ray-blue); }
.tabs-main .active, .visit-step-nav button.active, .progress-steps span.current { background: var(--ray-blue); border-color: var(--ray-blue); color: #fff; }
.sub-tabs .active, .db-switch .active { background: var(--ray-blue-mid); border-color: var(--ray-blue-mid); color: #fff; }
.card { border-color: var(--ray-line); box-shadow: 0 1px 2px rgba(14,27,46,.06), 0 6px 20px rgba(14,27,46,.06); }
input, select, textarea { display: block; width: 100%; min-width: 0; border-color: #c6d3e3; color: var(--ray-navy); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select,
#workspace input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), #workspace select { box-sizing: border-box; width: 100%; min-height: 54px; height: 54px; padding: 0 14px; font-size: 16px; line-height: 1.25; }
select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6b80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
form, form label, .columns > *, .form-grid > * { min-width: 0; }
form label, .client-filters label { width: 100%; }
.sub-tabs { margin-top: -6px; }
.sub-tabs button, .db-switch button { font-size: 15px; }
.tabs-main button { font-size: 20px; }
.menu-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sub-tabs .menu-icon { display: none; }
.sub-tabs .label-short { display: none; }
@media (max-width: 760px) {
  .tabs-main { flex-direction: column; flex-wrap: nowrap; }
  .tabs-main button { width: 100%; text-align: center; }
  .db-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .db-switch button { width: 100%; text-align: center; white-space: normal; }
}
#active-client-menu.active, #sales-menu.active, #pipeline-menu.active { background: var(--ray-blue); border-color: var(--ray-blue); color: #fff; }

/* Menu HP: logo buka drawer, sub-menu jadi bilah bawah. Tampilan web di atas 760px tidak berubah. */
button#mobile-menu-toggle { background: none; border: none; padding: 0; margin: 0; font: inherit; font-weight: 400; color: inherit; text-align: left; cursor: default; }
button#mobile-menu-toggle:hover { filter: none; }
.mobile-drawer-backdrop, .mobile-drawer { display: none; }
@media (max-width: 760px) {
  main { padding-bottom: 86px; }
  .tabs-main { display: none; }
  #mobile-menu-toggle { cursor: pointer; }
  .mobile-drawer-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(8,16,30,.5); z-index: 50; }
  .mobile-drawer { position: fixed; top: 0; left: 0; bottom: 0; z-index: 51; width: fit-content; max-width: 40vw; background: linear-gradient(115deg, #14204a, #071c45); box-shadow: 4px 0 24px rgba(8,16,30,.25); flex-direction: column; transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; }
  .mobile-drawer:not([hidden]) { display: flex; }
  .mobile-drawer.open { transform: translateX(0); }
  .mobile-drawer-head { display: flex; align-items: center; justify-content: center; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.14); }
  .mobile-drawer-head .brand-logo { width: 22px; height: 17px; padding: 1px; flex: none; }
  .mobile-drawer-grid { display: grid; grid-template-columns: auto; justify-content: stretch; gap: 1px; padding: 3px; }
  .mobile-drawer-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; border: none; border-radius: 10px; background: none; padding: 10px 3px; font-size: 10px; font-weight: 700; color: rgba(255,255,255,.62); text-align: center; line-height: 1.15; white-space: nowrap; }
  .mobile-drawer-item .menu-icon { width: 19px; height: 19px; color: rgba(255,255,255,.78); }
  .mobile-drawer-item.active { background: rgba(255,255,255,.1); color: #fff; }
  .mobile-drawer-item.active .menu-icon { color: var(--ray-gold); }
  .sub-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; display: flex; flex-wrap: nowrap; align-items: stretch; gap: 0; background: linear-gradient(115deg, #14204a, #071c45); border-top: 1px solid rgba(255,255,255,.08); box-shadow: 0 -8px 22px rgba(8,16,30,.3); padding: 7px 2px max(7px, env(safe-area-inset-bottom)); }
  .sub-tabs button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; background: none; border: none; border-right: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.62); font-size: 10.5px; font-weight: 700; padding: 7px 2px 2px; white-space: normal; line-height: 1.2; border-radius: 0; }
  .sub-tabs button:last-child { border-right: none; }
  .sub-tabs .label-full { display: none; }
  .sub-tabs .label-short { display: block; }
  .sub-tabs .menu-icon { display: block; width: 21px; height: 21px; color: rgba(255,255,255,.78); }
  .sub-tabs button.active { background: none; color: #fff; }
  .sub-tabs button.active .menu-icon { color: var(--ray-gold); }
}
@media (min-width: 761px) {
  #mobile-drawer, #mobile-drawer-backdrop { display: none !important; }
}
.legacy-letter-layout summary { cursor: pointer; color: var(--ray-blue); font-weight: 700; padding: 12px 0; }
.legacy-letter-layout .columns { margin-top: 8px; }
.manual-offer-card { margin: 8px 0 16px; }
.manual-offer-card .hint { margin-bottom: 16px; }
.manual-rab-counts { border: 1px solid var(--ray-line); border-radius: 12px; padding: 14px; min-width: 0; }
.manual-rab-counts legend { font-weight: 800; padding: 0 6px; }
.manual-rab-counts small { display: block; margin-top: 10px; color: var(--ray-muted); }
#open-manual-offer { width: 100%; margin-top: 12px; }
input:focus, select:focus, textarea:focus { outline-color: #7ca9e3; }
button { border-color: #bdcce0; color: var(--ray-blue); }
.primary { background: var(--ray-blue); border-color: var(--ray-blue); color: #fff; }
.hint, .item small, .due-item small, .progress-summary small, .progress-steps span, footer { color: var(--ray-muted); }
.item, .progress-summary > div, .progress-steps span { border-color: var(--ray-line); }
.progress-summary > div { background: #f7faff; }
.progress-summary strong, .visit-layout legend { color: var(--ray-navy); }
.visit-layout fieldset, .more-fields, .save-bar, .due-item, th, td { border-color: var(--ray-line); }
.more-fields summary, #research-status, #letter-status, #login-status { color: var(--ray-blue); }
th { color: var(--ray-muted); background: #f7faff; }
.badge { background: #e8f0fb; color: var(--ray-blue); }
.timeline-item { border-left-color: var(--ray-blue); }
.reminder-banner, .preview-note { background: #fff7e8; border-color: #e5c169; color: #664704; }
.client-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
#client-progress .columns { margin-top: 18px; }
.activity-dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.activity-dashboard-grid > div { min-width: 0; padding: 14px; border: 1px solid var(--ray-line); border-radius: 12px; }
.activity-dashboard-grid h3 { margin: 0; font-size: 17px; }
.activity-dashboard-grid h3 small { font-size: 12px; font-weight: 500; color: var(--ray-muted); }
#activity-sales-status, #new-activity-sales-status { margin: 10px 0 0; }
.activity-dashboard-list { max-height: 480px; overflow-y: auto; align-content: start; margin-top: 10px; padding-right: 4px; }
.activity-dashboard-list .item { overflow-wrap: anywhere; }
.activity-dashboard-list .item p { white-space: pre-wrap; margin: 8px 0 0; }
#pic-visit-status, #client-progress-status { min-height: 20px; margin: 0; }
.client-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; margin-top: 18px; align-items: start; }
.client-item { display: grid; width: 100%; gap: 6px; text-align: left; white-space: normal; line-height: 1.35; }
.client-item.selected { border-color: var(--ray-blue); background: #eef5ff; }
.client-item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.client-item span:not(.client-pill), .client-item small { color: var(--ray-muted); }
.client-item strong { color: var(--ray-navy); }
.client-pill { flex: none; border-radius: 999px; background: #e8f0fb; color: var(--ray-blue); padding: 3px 8px; font-size: 11px; }
.client-pill.overdue { color: #995217; background: #fff0d6; }
.client-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.client-facts > div { min-width: 0; background: #f7faff; border: 1px solid var(--ray-line); border-radius: 10px; padding: 10px; overflow-wrap: anywhere; }
.client-facts small { display: block; color: var(--ray-muted); margin-bottom: 4px; }
.client-need { line-height: 1.5; padding: 12px; border-left: 3px solid var(--ray-gold); background: #fffaf0; }
#client-offer-form { border-top: 1px solid var(--ray-line); padding-top: 16px; }
#client-offer-form h3 { margin: 0; }
.client-history { display: grid; gap: 8px; }
.client-history p { margin: 5px 0 0; }
@media (max-width: 760px) {
  .brand-logo { width: 48px; height: 36px; }
  .activity-dashboard-grid { grid-template-columns: 1fr; }
  .activity-dashboard-grid .section-head { display: grid; gap: 8px; }
  .activity-dashboard-grid .section-head .actions { display: grid; width: 100%; }
  .activity-dashboard-grid .section-head button { width: 100%; }
  .client-layout, .client-filters { grid-template-columns: 1fr; }
  .client-layout { gap: 12px; margin-top: 12px; }
  #clients input, #clients select, #clients textarea, #clients button,
  #pic-visits input, #pic-visits select, #pic-visits textarea, #pic-visits button,
  #client-progress input, #client-progress select, #client-progress textarea, #client-progress button { min-height: 48px; font-size: 16px; }
  .client-pill { font-size: 11px; min-height: 0; }
  .client-item-top { flex-wrap: wrap; }
}
@media (max-width: 390px) { .client-facts { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .brand small { display: none; } }

.ac-table-wrap { max-height: 70vh; overflow: auto; }
.ac-table { min-width: 1100px; }
.ac-table thead th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.ac-table td.num { color: #667a70; }
.ac-table td.act { white-space: nowrap; }
.ac-table td.act button { padding: 6px 10px; font-size: 12px; margin-right: 4px; }
#ac-dialog { width: min(680px, calc(100vw - 24px)); border: 1px solid #cbd8d0; border-radius: 16px; padding: 22px; }
#ac-dialog::backdrop { background: rgba(10, 30, 25, .45); }
.ac-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ac-checks label { display: flex; align-items: center; gap: 6px; font-weight: 600; width: auto; }
.ac-checks input { width: auto; }
#ac-dialog fieldset { border: 1px solid #e2e9e5; border-radius: 10px; }

.ac-archived { opacity: .6; background: #f6f6f6; }
#ac-dashboard summary { cursor: pointer; }
#ac-dashboard summary small { color: #667a70; font-weight: 400; }
#ac-dash-body { margin-top: 12px; }
.member-name-form, .member-folder-form { margin-top: 8px; }

.db-switch { margin-bottom: 14px; }
.price-table { min-width: 0; width: 100%; table-layout: auto; }
.price-table td.money, .price-table th.money { text-align: right; white-space: nowrap; }
.price-table .group-row td { background: #eef5ff; font-weight: 800; color: #123b37; }
.sim-table-wrap { max-height: 70vh; overflow: auto; }
.sim-table { min-width: 0; width: 100%; border-collapse: collapse; font-size: 13px; }
.sim-table th, .sim-table td { text-align: left; border-bottom: 1px solid var(--ray-line); padding: 10px; vertical-align: middle; }
.sim-table thead th { position: sticky; top: 0; z-index: 1; white-space: nowrap; background: #f6faf7; color: #5b7065; }
.sim-table td.money, .sim-table th.money { text-align: right; white-space: nowrap; }
.sim-table td.check { width: 36px; text-align: center; }
.sim-table td.check input { width: auto; }
.sim-table td.qty input { width: 48px; text-align: center; }
.sim-table td.name { font-weight: 700; }
.sim-table .group-row td { background: #eef5ff; font-weight: 800; color: #123b37; }
.sim-table tr.sim-selected { background: #f3f8ff; }
.qty-stepper { display: inline-flex; align-items: center; gap: 4px; }
.qty-stepper button { width: 28px; height: 28px; min-height: 0; padding: 0; line-height: 1; border-radius: 7px; font-weight: 800; font-size: 16px; flex: none; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper input { -moz-appearance: textfield; appearance: textfield; }
@media (max-width: 680px) {
  .sim-table, .sim-table thead, .sim-table tbody, .sim-table th { display: block; }
  .sim-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sim-table tbody tr.group-row { display: block; border: none; background: none; padding: 6px 2px 2px; margin-bottom: 0; font-size: 12px; }
  .sim-table tbody tr:not(.group-row) { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; border: 1px solid var(--ray-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
  .sim-table tbody tr.sim-selected { background: #f3f8ff; }
  .sim-table td { padding: 7px 0; white-space: normal; }
  .sim-table tr.group-row td { display: block; border: none; padding: 0; }
  .sim-table td[data-label] { display: flex; justify-content: space-between; align-items: center; text-align: right; border-bottom: 1px dashed var(--ray-line); grid-column: 1 / -1; }
  .sim-table td.subtotal { border-bottom: none; }
  .sim-table td[data-label]::before { content: attr(data-label); font-weight: 700; color: var(--ray-muted); font-size: 12px; text-align: left; }
  .sim-table td.check { grid-column: 1; grid-row: 1; display: flex; align-items: center; padding: 0; }
  .sim-table td.check input { width: 20px; height: 20px; }
  .sim-table td.name { grid-column: 2; grid-row: 1; display: flex; align-items: center; text-align: left; font-size: 14px; padding: 0; }
  .sim-table td.qty { border-top: 1px dashed var(--ray-line); margin-top: 8px; padding-top: 10px; }
  .sim-table td.num { display: none; }
}
.ac-check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ac-check input { width: auto; }
#price-dialog { width: min(560px, calc(100vw - 24px)); border: 1px solid #cbd8d0; border-radius: 16px; padding: 22px; }
#price-dialog::backdrop { background: rgba(10, 30, 25, .45); }
#offer-preview-dialog { width: min(900px, calc(100vw - 24px)); border: 1px solid #cbd8d0; border-radius: 16px; padding: 18px; }
#offer-preview-dialog::backdrop { background: rgba(10, 30, 25, .45); }
#offer-preview-frame { width: 100%; height: min(75vh, 760px); border: 1px solid var(--ray-line); border-radius: 10px; }
@media (max-width: 760px) { #offer-preview-frame { height: 60vh; } }

/* Dashboard: ringkasan interaktif (kartu KPI, batang tahapan, tren kunjungan) */
.dash-overview { display: grid; gap: 18px; }
.dash-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.dash-tile { display: flex; align-items: center; gap: 10px; min-width: 0; background: #fff; border: 1px solid var(--ray-line); border-left: 4px solid var(--ray-blue); border-radius: 13px; padding: 11px 13px; box-shadow: 0 1px 2px rgba(14,27,46,.06); }
.dash-tile .menu-icon { width: 16px; height: 16px; flex: none; padding: 7px; box-sizing: content-box; border-radius: 10px; background: var(--ray-blue-pale); color: var(--ray-blue); }
.dash-tile > div { min-width: 0; flex: 1 1 auto; }
.dash-tile strong { display: block; font-size: 17px; line-height: 1.25; color: var(--ray-navy); font-weight: 700; overflow-wrap: anywhere; word-break: break-word; }
.dash-tile small { display: block; color: var(--ray-muted); font-size: 11.5px; margin-top: 1px; overflow-wrap: anywhere; }
.dash-tile.warning { border-left-color: #c98a1b; }
.dash-tile.warning .menu-icon { background: #fff2d8; color: #936400; }
.dash-tile.critical { border-left-color: #b73729; }
.dash-tile.critical .menu-icon { background: #fde8e4; color: #b73729; }
.dash-tile.good { border-left-color: #1f8a56; }
.dash-tile.good .menu-icon { background: #e3f5ea; color: #136143; }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dash-card-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin-top: 14px; }
.dash-mini-stats > div { min-width: 0; border: 1px solid var(--ray-line); background: #f7faff; border-radius: 12px; padding: 10px 11px; }
.dash-mini-stats strong { display: block; font-size: 15px; font-weight: 700; line-height: 1.25; color: var(--ray-navy); overflow-wrap: anywhere; word-break: break-word; }
.dash-mini-stats small { font-size: 11.5px; color: var(--ray-muted); overflow-wrap: anywhere; }

.dash-bars { display: grid; gap: 10px; margin-top: 14px; }
.dash-bar-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; background: none; border: none; padding: 5px 0; cursor: pointer; font: inherit; text-align: left; position: relative; border-radius: 6px; }
.dash-bar-row:hover, .dash-bar-row:focus-visible { background: #f7faff; }
.dash-bar-label { min-width: 0; font-size: 13px; font-weight: 700; color: var(--ray-navy); overflow-wrap: anywhere; }
.dash-bar-track { height: 14px; border-radius: 7px; background: #eef2f8; overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; border-radius: 7px; min-width: 3px; transition: width .35s ease; }
.dash-bar-value { min-width: 34px; font-size: 13px; font-weight: 800; color: var(--ray-navy); text-align: right; white-space: nowrap; }

.dash-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dash-chip { display: inline-flex; align-items: center; border: none; border-radius: 999px; padding: 7px 13px; font-size: 12px; font-weight: 800; font: inherit; cursor: pointer; position: relative; }
.dash-chip.good { background: #e3f5ea; color: #136143; }
.dash-chip.warning { background: #fff2d8; color: #936400; }
.dash-chip.critical { background: #fde8e4; color: #b73729; }
.dash-chip.neutral { background: #eef2f8; color: var(--ray-muted); }

[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--ray-navy); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; box-shadow: 0 6px 16px rgba(14,27,46,.25); z-index: 20; pointer-events: none;
}
[data-tip]:hover::before, [data-tip]:focus-visible::before {
  content: ''; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); border: 5px solid transparent;
  border-top-color: var(--ray-navy); margin-bottom: 3px; z-index: 20; pointer-events: none;
}

.dash-trend { margin-top: 14px; }
.dash-trend-bars { display: flex; align-items: flex-end; gap: 4px; height: 108px; padding: 0 2px; }
.dash-trend-col { flex: 1 1 0; min-width: 0; max-width: 28px; height: 100%; display: flex; align-items: flex-end; border-radius: 4px; cursor: pointer; }
.dash-trend-fill { display: block; width: 100%; background: var(--ray-blue); border-radius: 4px 4px 0 0; min-height: 3px; transition: height .35s ease, background .15s ease; }
.dash-trend-col:hover .dash-trend-fill, .dash-trend-col:focus-visible .dash-trend-fill { background: var(--ray-gold); }
.dash-trend-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--ray-muted); }

@media (max-width: 760px) {
  .dash-bar-row { grid-template-columns: minmax(0, 104px) minmax(0, 1fr) auto; }
  .dash-bar-label { font-size: 12px; }
  .dash-bar-value { font-size: 12px; min-width: 0; }
  [data-tip]:hover::after, [data-tip]:focus-visible::after { white-space: normal; max-width: 200px; text-align: center; }
}

/* Dashboard Workplan Marketing */
/* main{max-width:none} di style.css (layar >=761px) bikin seluruh halaman melebar penuh
   mengikuti layar -- dibatasi lagi khusus di sini supaya Dashboard tetap ringkas/terkumpul
   seperti mockup, berapa pun lebar monitornya. */
.wpd { display: grid; gap: 16px; max-width: 1440px; margin: 0 auto; }
.wpd-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 22px; }
.wpd-topbar-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wpd-topbar-title > div { min-width: 0; }
.wpd-icon-circle { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; flex: none; }
.wpd-icon-circle svg { width: 24px; height: 24px; }
.wpd-icon-blue { background: var(--ray-blue); color: #fff; }
.wpd-topbar-title h1 { font-size: 24px; margin: 0; color: var(--ray-navy); }
.wpd-topbar-title p { margin: 2px 0 0; color: var(--ray-muted); font-size: 13px; }
.wpd-period { display: flex; align-items: center; gap: 10px; background: var(--ray-blue-pale); border-radius: 12px; padding: 10px 16px; cursor: pointer; }
.wpd-period-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--ray-blue); flex: none; }
.wpd-period-icon svg { width: 16px; height: 16px; }
.wpd-period small { display: block; color: var(--ray-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.wpd-period .wpd-select-box { margin-top: 3px; }
.wpd-period select { font-weight: 800; }

.wpd-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 22px; }
.wpd-filter {
  display: flex; align-items: center; gap: 10px; flex: 1 1 200px; min-width: 170px;
  border: 1px solid var(--ray-line); border-radius: 12px; padding: 10px 12px; background: #f8fafc; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.wpd-filter:hover { border-color: var(--ray-blue-mid); background: #fff; }
.wpd-filter:focus-within { border-color: var(--ray-blue); background: #fff; box-shadow: 0 0 0 3px rgba(10,79,166,.12); }
.wpd-filter-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; }
.wpd-filter-icon svg { width: 15px; height: 15px; }
.wpd-icon-navy { background: #e3e9f3; color: var(--ray-navy); }
.wpd-icon-amber { background: #fdecc8; color: #92650a; }
.wpd-icon-red { background: #fbdede; color: #b73729; }
.wpd-filter > span:not(.wpd-filter-icon) { display: block; min-width: 0; flex: 1; }
.wpd-filter small { display: block; color: var(--ray-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.wpd-filter .wpd-select-box { margin-top: 4px; }
/* Kotak tersendiri untuk teks + panah dropdown — menandakan bagian ini bisa diklik, panahnya juga ikut area klik select */
.wpd-select-box { position: relative; display: block; }
.wpd-select-box select {
  appearance: none; -webkit-appearance: none; display: block; width: 100%; border: 1px solid var(--ray-line); border-radius: 8px;
  background: #fff; padding: 7px 28px 7px 10px; margin: 0; font-weight: 700; color: var(--ray-navy); font-size: 14px; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wpd-select-box select:hover { border-color: var(--ray-blue-mid); }
.wpd-select-box select:focus { outline: none; border-color: var(--ray-blue); box-shadow: 0 0 0 3px rgba(10,79,166,.15); }
.wpd-select-box::after {
  content: ''; position: absolute; right: 11px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 2px solid var(--ray-blue); border-bottom: 2px solid var(--ray-blue); transform: translateY(-65%) rotate(45deg);
}
.wpd-reset { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.wpd-reset svg { width: 14px; height: 14px; }

.wpd-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.wpd-stat { border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 12px; }
.wpd-stat svg { width: 24px; height: 24px; flex: none; opacity: .9; }
.wpd-stat strong { display: block; font-size: 24px; line-height: 1.1; }
.wpd-stat small { display: block; font-size: 12px; margin-top: 2px; opacity: .85; }
.wpd-stat-blue { background: var(--ray-blue); color: #fff; }
.wpd-stat-green { background: #178a4c; color: #fff; }
.wpd-stat-amber { background: #f0ad1f; color: #3a2a00; }
.wpd-stat-lavender { background: #dde9fb; color: var(--ray-navy); }
.wpd-stat-purple { background: #e6defa; color: #4a2e8a; }
.wpd-stat-red { background: #fadadd; color: #a3263a; }

.wpd-main { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.wpd-side {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start;
  position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto;
}
.wpd-table-card, .wpd-rekap-card, .wpd-detail-card { min-width: 0; }
.wpd-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--ray-navy); }
.wpd-card-head svg { width: 18px; height: 18px; color: var(--ray-blue); }
.wpd-card-head h2 { margin: 0; font-size: 16px; }
.wpd-table-card table, .wpd-rekap-card table { min-width: 0; }
.wpd-table-card td, .wpd-table-card th { white-space: nowrap; padding: 6px 10px; }
.wpd-table-card td:nth-child(3) { white-space: normal; min-width: 180px; }
.wpd-eye { background: var(--ray-blue-pale); border-color: transparent; border-radius: 7px; padding: 4px 8px; font-size: 13px; line-height: 1; }
.wpd-row-active { background: #eef4fc; }
.wpd-dash { color: var(--ray-muted); }
.wpd-badge-good { background: #e3f6ea; color: #178a4c; }
.wpd-badge-warn { background: #fdecc8; color: #92650a; }
.wpd-badge-proses { background: #e8f0fb; color: var(--ray-blue); }
.wpd-badge-bad { background: #fbdede; color: #b73729; }
.wpd-rekap-card tr.wpd-row-total { background: #fdf3da; font-weight: 800; }
/* #dashboard (bukan cuma .wpd-hasil-select) sengaja dipakai di tiap rule supaya spesifisitasnya
   mengalahkan "#workspace select" (width:100%; height/min-height:54px) punya form lain di situs ini
   -- tanpa ini, kotak Hasil ikut melebar & meninggi mengikuti aturan global itu. */
#dashboard .wpd-hasil-select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--ray-line); border-radius: 7px; background-color: #f8fafc; color: var(--ray-navy);
  padding: 2px 18px 2px 6px; font-size: 11px; font-weight: 700; cursor: pointer; width: 108px; max-width: 100%; height: 22px; min-height: 22px; line-height: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%235b6b80' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 11px;
}
#dashboard .wpd-hasil-select:hover { border-color: var(--ray-blue-mid); }
#dashboard .wpd-hasil-select:focus { outline: none; border-color: var(--ray-blue); box-shadow: 0 0 0 2px rgba(10,79,166,.15); }
#dashboard .wpd-hasil-select:disabled { opacity: .6; cursor: wait; }
#dashboard .wpd-hasil-select.wpd-hasil-positif { background: #e3f6ea; border-color: #b9e6c9; color: #178a4c; }
#dashboard .wpd-hasil-select.wpd-hasil-proses { background: #e8f0fb; border-color: #c3d8f7; color: var(--ray-blue); }
#dashboard .wpd-hasil-select.wpd-hasil-bad { background: #fbdede; border-color: #f3bcbc; color: #b73729; }
.wpd-detail-list { display: grid; gap: 10px; margin: 0; }
.wpd-detail-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; font-size: 13px; align-items: baseline; }
.wpd-detail-list dt { color: var(--ray-muted); margin: 0; }
.wpd-detail-list dd { margin: 0; font-weight: 700; color: var(--ray-navy); overflow-wrap: anywhere; }
.wpd-detail-note { margin-top: 14px; background: var(--ray-blue-pale); border-radius: 10px; padding: 12px 14px; }
.wpd-detail-note strong { display: block; font-size: 12px; color: var(--ray-blue); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.wpd-detail-note p { margin: 0; font-size: 13px; color: var(--ray-navy); line-height: 1.5; }

@media (max-width: 1000px) {
  .wpd-main { grid-template-columns: minmax(0, 1fr); }
  .wpd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Kolom kanan (Rekap + Detail) cuma "mengambang" saat layout 2 kolom; di layar sempit tabel
     Daftar Workplan sudah sendirian paling atas, jadi kolom kanan dibiarkan mengalir normal. */
  .wpd-side { position: static; max-height: none; overflow-y: visible; }
}
@media (max-width: 760px) {
  .wpd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wpd-filter { flex: 1 1 100%; min-width: 0; }
  .wpd-topbar { flex-direction: column; align-items: stretch; }
  .wpd-topbar-title h1 { font-size: 19px; }
  .wpd-period { justify-content: center; }
  .wpd-detail-list > div { grid-template-columns: 1fr; gap: 2px; }
}

/* 5. Rekap RAB 2026-2027: tabel dua tingkat; prefix #workspace #rab-2627 agar menang atas aturan global input */
#workspace #rab-2627 .ac-table { min-width: 2000px; border-collapse: collapse; }
#workspace #rab-2627 .ac-table th, #workspace #rab-2627 .ac-table td { border: 1px solid #dbe5f3; padding: 8px 7px; vertical-align: middle; }
#workspace #rab-2627 .ac-table thead th { white-space: normal; height: 38px; }
#workspace #rab-2627 .ac-table thead tr:nth-child(2) th { top: 38px; }
#workspace #rab-2627 .ac-table thead th[rowspan] { z-index: 2; }
#workspace #rab-2627 .r27-center { text-align: center; }
#workspace #rab-2627 .r27-name { font-weight: 700; min-width: 170px; }
#workspace #rab-2627 .r27-view { padding: 5px 12px; font-size: 12px; min-height: 0; margin: 2px; }
#workspace #rab-2627 input[type="checkbox"] { display: block; width: 18px; height: 18px; min-height: 0; margin: 0 auto; }
#workspace #rab-2627 .r27-badge { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
#workspace #rab-2627 .r27-badge.g { background: #e3f5e8; color: #1d6b34; }
#workspace #rab-2627 .r27-badge.y { background: #fff3d4; color: #8a5b00; }
#workspace #rab-2627 .r27-badge.r { background: #fde5e3; color: #a42a20; }
#workspace #rab-2627 .r27-badge.n { background: #eef1f5; color: #5b6675; }
#workspace #rab-2627 .r27-stale { display: block; color: #a42a20; margin-top: 3px; }
#workspace #rab-2627 .r27-compare { display: grid; grid-template-columns: auto auto; gap: 2px 8px; white-space: nowrap; font-size: 12.5px; }
#workspace #rab-2627 .r27-compare b { text-align: right; }
#workspace #rab-2627 .r27-compare .up { color: #1d6b34; }
#workspace #rab-2627 .r27-compare .down { color: #a42a20; }
#rab2627-preview { width: min(1100px, 94vw); height: 88vh; padding: 14px; border: 1px solid #dbe5f3; border-radius: 14px; }
#rab2627-preview[open] { display: flex; flex-direction: column; }
#rab2627-preview .r27-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#rab2627-preview iframe { flex: 1; width: 100%; border: 0; }
#workspace #rab-2627 .r27-renewal { min-width: 150px; }
#workspace #rab-2627 .r27-alasan { min-width: 220px; white-space: pre-wrap; }
#workspace #rab-2627 .r27-by { display: block; color: #667a70; margin-top: 3px; }
/* 6. Pengajuan & Transaksi; di HP tiap lokasi menjadi satu kartu */
.sub-tabs button[hidden] { display: none; }
#workspace #pengajuan .ac-table { min-width: 1080px; }
#workspace #pengajuan .pj-admin { min-width: 90px; font-weight: 600; }
#workspace #pengajuan td { vertical-align: middle; }
#workspace #pengajuan .pj-lokasi { min-width: 220px; }
#workspace #pengajuan .pj-lokasi small { display: block; color: #667a70; }
#workspace #pengajuan td select { width: 100%; min-width: 220px; margin: 0; }
#workspace #pengajuan .pj-alasan { min-width: 220px; }
#workspace #pengajuan .pj-alasan textarea { width: 100%; min-width: 200px; resize: vertical; font: inherit; }
#workspace #pengajuan .pj-muted { color: #8a96a8; }
#workspace #pengajuan .pj-error { color: #a42a20; }
#workspace #pengajuan tr.pj-perpanjangan td.num { box-shadow: inset 4px 0 0 #2e8b4e; }
#workspace #pengajuan tr.pj-konfirmasi td.num { box-shadow: inset 4px 0 0 #d99a00; }
#workspace #pengajuan tr.pj-putus td.num { box-shadow: inset 4px 0 0 #c0392b; }
@media (max-width: 760px) {
  #workspace #pengajuan .ac-table-wrap { max-height: none; overflow: visible; border: 0; }
  #workspace #pengajuan .ac-table { min-width: 0; }
  #workspace #pengajuan .ac-table, #workspace #pengajuan tbody, #workspace #pengajuan tr, #workspace #pengajuan td { display: block; width: 100%; box-sizing: border-box; }
  #workspace #pengajuan thead, #workspace #pengajuan td.num { display: none; }
  #workspace #pengajuan tr { border: 1px solid #dbe5f3; border-left: 5px solid #c3cede; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; background: #fff; }
  #workspace #pengajuan tr.pj-perpanjangan { border-left-color: #2e8b4e; }
  #workspace #pengajuan tr.pj-konfirmasi { border-left-color: #d99a00; }
  #workspace #pengajuan tr.pj-putus { border-left-color: #c0392b; }
  #workspace #pengajuan td { border: 0; padding: 5px 0; min-width: 0; white-space: normal; }
  #workspace #pengajuan td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 700; color: #55657d; margin-bottom: 4px; }
  #workspace #pengajuan td.pj-note:empty { display: none; }
}
/* Putus kontrak: seluruh baris bergaris merah */
#workspace #rab-2627 .ac-table tbody tr.r27-putus td,
#workspace #pengajuan .ac-table tbody tr.pj-putus td { background: #fde5e3; border-top: 2px solid #c0392b; border-bottom: 2px solid #c0392b; }
@media (max-width: 760px) {
  #workspace #pengajuan .ac-table tbody tr.pj-putus { background: #fde5e3; border: 2px solid #c0392b; border-left-width: 5px; }
  #workspace #pengajuan .ac-table tbody tr.pj-putus td { border: 0; background: transparent; }
}
