:root {
    --po-color: #1c3f60;
    --meals-color: #6b46c1;
    --request-color: #e07b1a;
    --laporan-color: #0f9b8e;
    --report-blue: #2563eb;
    --report-green: #16a34a;
    --report-yellow: #b7791f;
    --report-pink: #db2777;
    --bg: #f4f6f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1a202c;
    --text-muted: #64748b;
    --radius: 12px;
    --sidebar-bg: #222d32;
    --sidebar-bg-active: #1a2226;
    --sidebar-text: #b8c7ce;
    --sidebar-text-active: #ffffff;
    --topbar-green: #00a65a;
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 64px;
  }
  * { box-sizing: border-box; }
  html, body {
    margin: 0; padding: 0; background: var(--bg); color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 14px;
  }
  a { color: inherit; }

  .al-wrapper { display: flex; height: 100vh; }

  .al-sidebar {
    width: var(--sidebar-width); flex-shrink: 0; background: var(--sidebar-bg);
    display: flex; flex-direction: column; transition: width .18s ease; overflow: hidden;
  }
  .al-sidebar.collapsed { width: var(--sidebar-width-collapsed); }
  .al-sidebar-brand {
    display: flex; align-items: center; gap: 10px; padding: 16px; color: #fff;
    font-weight: 800; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .al-brand-logo { height: 28px; width: auto; flex-shrink: 0; border-radius: 4px; background: #fff; padding: 3px 5px; }
  .al-brand-text { font-size: 13.5px; line-height: 1.25; }
  .al-sidebar.collapsed .al-brand-logo { display: none; }
  .al-sidebar-user {
    display: flex; align-items: center; gap: 10px; padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap; overflow: hidden;
  }
  .al-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--topbar-green); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex-shrink: 0;
  }
  .al-user-name { color: #fff; font-size: 13px; font-weight: 700; }
  .al-user-status { color: var(--sidebar-text); font-size: 11px; margin-top: 2px; }
  .al-status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #00e676; margin-right: 4px; }
  .al-nav { padding: 10px 0; overflow-y: auto; flex: 1; }
  .al-nav-header {
    color: #6b7c85; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; padding: 8px 16px; white-space: nowrap;
  }
  .al-nav-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 16px; color: var(--sidebar-text);
    cursor: pointer; font-size: 13.5px; font-weight: 600; border-left: 3px solid transparent;
    white-space: nowrap; user-select: none;
  }
  .al-nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
  .al-nav-item.active { background: var(--sidebar-bg-active); color: #fff; border-left-color: var(--topbar-green); }
  .al-nav-icon { font-size: 16px; flex-shrink: 0; width: 18px; text-align: center; }
  .al-sidebar.collapsed .al-brand-text,
  .al-sidebar.collapsed .al-user-info,
  .al-sidebar.collapsed .al-nav-header,
  .al-sidebar.collapsed .al-nav-text { display: none; }

  .al-nav-caret { margin-left: auto; font-size: 11px; transition: transform .15s; flex-shrink: 0; }
  .al-nav-group.open .al-nav-caret { transform: rotate(180deg); }
  .al-nav-group.open .al-nav-parent { color: #fff; }
  .al-nav-submenu { display: none; }
  .al-nav-group.open .al-nav-submenu { display: block; }
  .al-nav-subitem {
    padding: 9px 16px 9px 46px; color: var(--sidebar-text); cursor: pointer;
    font-size: 12.5px; font-weight: 600; border-left: 3px solid transparent;
    white-space: nowrap; user-select: none;
  }
  .al-nav-subitem:hover { background: rgba(255,255,255,.05); color: #fff; }
  .al-nav-subitem.active { background: var(--sidebar-bg-active); color: #fff; border-left-color: var(--topbar-green); }
  .al-sidebar.collapsed .al-nav-submenu { display: none; }

  .al-main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
  .al-topbar {
    background: linear-gradient(90deg, var(--topbar-green), #009150);
    color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 18px; height: 56px; flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
  }
  .al-sidebar-toggle {
    background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; padding: 6px;
    border-radius: 4px; line-height: 1;
  }
  .al-sidebar-toggle:hover { background: rgba(255,255,255,.15); }
  .al-topbar-title { font-weight: 700; font-size: 15px; }
  .al-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
  .al-topbar-date { font-size: 12px; opacity: .9; }

  .al-content { padding: 20px; flex: 1; min-width: 0; overflow-y: auto; }

  .al-sidebar-backdrop { display: none; }

  @media (max-width: 800px) {
    .al-sidebar {
      position: fixed; top: 0; left: 0; height: 100vh; z-index: 950;
      width: min(var(--sidebar-width), 82vw) !important;
      transform: translateX(-100%);
      transition: transform .2s ease;
      box-shadow: 4px 0 24px rgba(0,0,0,.35);
    }
    .al-sidebar.collapsed { transform: translateX(0); }
    .al-sidebar .al-brand-text, .al-sidebar .al-user-info,
    .al-sidebar .al-nav-header, .al-sidebar .al-nav-text { display: block !important; }
    .al-sidebar .al-brand-logo { display: inline-block !important; }
    /* .collapsed means "drawer open" on mobile (not desktop's icon-only mode), so undo the
       desktop rule that hides submenus whenever .collapsed is present - only the toggled-open
       group's submenu should show, same as desktop's non-collapsed behavior. */
    .al-sidebar.collapsed .al-nav-group.open .al-nav-submenu { display: block !important; }
    .al-sidebar-backdrop.open {
      display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 940;
    }
    .al-content { padding: 12px; }
    .al-topbar { padding: 0 10px; gap: 8px; }
    .al-topbar-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .al-topbar-date { display: none; }
    .card { padding: 14px; }
    .steps { flex-wrap: wrap; row-gap: 10px; }
    .step-label { display: none; }
    .wizard-actions { flex-wrap: wrap; gap: 10px; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar input, .filter-bar select, .filter-date-label, .filter-bar .btn { width: 100%; max-width: none; }
    .filter-date-label input { width: 100%; max-width: none; }
    .kpi-grid { grid-template-columns: 1fr; }
  }
  .page { display: none; max-width: 1200px; }
  .page.active { display: block; }

  .card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  }
  .card h3 { margin: 0 0 12px; font-size: 15px; }

  .steps { display: flex; align-items: center; margin-bottom: 20px; }
  .step-item { display: flex; align-items: center; flex: 1; }
  .step-circle {
    width: 32px; height: 32px; border-radius: 50%; background: #dbe3ec; color: #64748b;
    display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
  }
  .step-label { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
  .step-line { flex: 1; height: 2px; background: #dbe3ec; margin: 0 8px; }
  .step-item.done .step-circle { background: var(--po-color); color: #fff; }
  .step-item.done .step-label { color: var(--po-color); }
  .step-item.done + .step-line { background: var(--po-color); }
  .step-item.active .step-circle { background: var(--meals-color); color: #fff; }
  .step-item.active .step-label { color: var(--meals-color); }
  #poResStepsBar .step-item { cursor: pointer; }
  #poResStepsBar .step-item:hover .step-label { text-decoration: underline; }

  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  @media (max-width: 700px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } }
  .field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 12.5px; color: #374151; }
  .field .hint { font-weight: 400; color: var(--text-muted); font-size: 11px; }
  input[type=text], input[type=number], input[type=date], input[type=time], select, textarea {
    width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
  }
  input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: #60a5fa; }
  textarea { resize: vertical; min-height: 70px; }

  .choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px; }
  .choice-card {
    border: 2px solid var(--border); border-radius: 10px; padding: 12px 10px; text-align: center;
    cursor: pointer; font-weight: 600; font-size: 13px; transition: all .15s;
  }
  .choice-card:hover { border-color: #93c5fd; }
  .choice-card.selected { border-color: var(--meals-color); background: #f3edfd; color: var(--meals-color); }
  .choice-card .price { display: block; font-weight: 400; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
  .choice-card.selected .price { color: var(--meals-color); }
  .choice-grid-disabled { opacity: .45; pointer-events: none; position: relative; }
  .choice-grid-disabled .choice-card { cursor: not-allowed; }

  .btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 8px;
    border: none; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: opacity .15s;
  }
  .btn:hover { opacity: .9; }
  .btn:disabled { opacity: .5; cursor: not-allowed; }
  .btn-primary { background: var(--po-color); color: #fff; }
  .btn-purple { background: var(--meals-color); color: #fff; }
  .btn-orange { background: var(--request-color); color: #fff; }
  .btn-teal { background: var(--laporan-color); color: #fff; }
  .btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
  .btn-danger { background: #dc2626; color: #fff; }
  .btn-sm { padding: 6px 10px; font-size: 12px; }
  .catatan-cell { display: flex; gap: 6px; align-items: center; }
  .catatan-cell .forecast-catatan-input { flex: 1; min-width: 140px; }
  .catatan-cell .btn-save-catatan { flex-shrink: 0; white-space: nowrap; }
  .wizard-actions { display: flex; justify-content: space-between; margin-top: 18px; }

  .day-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
  .day-tab {
    padding: 8px 14px; border-radius: 20px; background: #eef1f6; color: var(--text-muted);
    font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  }
  .day-tab.active { background: var(--meals-color); color: #fff; }
  .day-panel { display: none; }
  .day-panel.active { display: block; }
  .day-panel-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }

  .meal-row {
    border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fbfcfe;
  }
  .meal-row-head { display: flex; align-items: center; gap: 10px; }
  .meal-row-head input[type=checkbox] { width: 18px; height: 18px; }
  .meal-row-head label { font-weight: 700; font-size: 13.5px; flex: 1; }
  .meal-row-body { display: none; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; margin-top: 10px; }
  .meal-row.checked .meal-row-body { display: grid; }
  .meal-row.checked { border-color: var(--meals-color); background: #faf7ff; }
  @media (max-width: 700px) { .meal-row-body { grid-template-columns: 1fr 1fr; } }
  .radio-group { display: flex; gap: 12px; align-items: center; height: 100%; }
  .radio-group label { font-weight: 500; font-size: 12.5px; display: flex; align-items: center; gap: 4px; }

  .badge {
    display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
  }
  .badge-blue { background: #dbeafe; color: var(--report-blue); }
  .badge-green { background: #dcfce7; color: var(--report-green); }
  .badge-yellow { background: #fef3c7; color: var(--report-yellow); }
  .badge-pink { background: #fce7f3; color: var(--report-pink); }
  .badge-purple { background: #ede9fe; color: var(--meals-color); }

  .review-block { border-left: 3px solid var(--meals-color); padding-left: 12px; margin-bottom: 14px; }
  .review-block h4 { margin: 0 0 6px; font-size: 13px; color: var(--meals-color); }
  .kv-grid { display: grid; grid-template-columns: 1fr 1fr; row-gap: 6px; column-gap: 10px; font-size: 13px; }
  .kv-grid .k { color: var(--text-muted); }

  .kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 18px; }
  @media (max-width: 800px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
  .kpi-card {
    border-radius: 3px; color: #fff; position: relative; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.15); cursor: pointer; transition: box-shadow .15s, transform .15s;
  }
  .kpi-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.28); transform: translateY(-1px); }
  .kpi-card.c1 { background: #3c8dbc; }
  .kpi-card.c2 { background: #00a65a; }
  .kpi-card.c3 { background: #f39c12; }
  .kpi-card.c4 { background: #dd4b39; }
  .kpi-icon { position: absolute; top: 10px; right: 14px; font-size: 42px; opacity: .35; line-height: 1; }
  .kpi-value { font-size: 26px; font-weight: 700; padding: 16px 16px 0; }
  .kpi-label { font-size: 13px; padding: 4px 16px 16px; opacity: .95; }
  .kpi-footer {
    display: block; background: rgba(0,0,0,.12); padding: 8px 16px; font-size: 12px;
    font-weight: 600; text-decoration: none;
  }
  .kpi-card:hover .kpi-footer { background: rgba(0,0,0,.22); }
  .kpi-footer span { float: right; }

  .sub-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
  .sub-tab {
    padding: 8px 14px; border-radius: 8px; background: #eef1f6; font-weight: 700; font-size: 12.5px;
    cursor: pointer; color: var(--text-muted);
  }
  .sub-tab.active.t-blue { background: var(--report-blue); color: #fff; }
  .sub-tab.active.t-green { background: var(--report-green); color: #fff; }
  .sub-tab.active.t-yellow { background: var(--report-yellow); color: #fff; }
  .sub-tab.active.t-pink { background: var(--report-pink); color: #fff; }
  .sub-panel { display: none; }
  .sub-panel.active { display: block; }
  .settings-section { display: none; }
  .settings-section.active { display: block; }
  .kalender-section { display: none; }
  .kalender-section.active { display: block; }
  .poRes-section { display: none; }
  .poRes-section.active { display: block; }
  .poRes-step { }
  .por-collapse-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
  .por-collapse-header h3 { margin: 0; }
  .por-collapse-caret { font-size: 14px; color: var(--text-muted); transition: transform .15s; flex-shrink: 0; margin-left: 10px; }
  .por-collapse-header.open .por-collapse-caret { transform: rotate(180deg); }

  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
  th { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; }
  tr:hover td { background: #f8fafc; }
  .table-wrap { overflow-x: auto; }

  .pivot-date-header {
    background: #1a202c; color: #fff; font-weight: 700; padding: 8px 12px; border-radius: 8px 8px 0 0;
    font-size: 13px; margin: -18px -18px 12px;
  }
  table.pivot-table th {
    background: #f0c14b; color: #1a202c; text-transform: none; font-weight: 700; font-size: 11.5px;
    text-align: center; white-space: nowrap;
  }
  table.pivot-table td { text-align: center; white-space: nowrap; }
  table.pivot-table td:nth-child(2), table.pivot-table td:nth-child(3), table.pivot-table td:nth-child(4) { text-align: left; white-space: normal; }
  table.pivot-table tr.pivot-total-row td { font-weight: 700; background: #fdf6e3; border-top: 2px solid #f0c14b; }
  table.pivot-table tr.pivot-total-row td:first-child { text-align: right; }
  table.pivot-table tr.row-mice td { color: #dc2626; }
  table.pivot-table tr.row-mice td.meal-box-cell { color: #7a1f1f; }
  table.pivot-table td.meal-box-cell {
    background: #fde68a; font-weight: 700; box-shadow: inset 0 0 0 2px #f0c14b;
  }
  .meal-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
  .meal-legend-swatch {
    display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: #fde68a;
    box-shadow: inset 0 0 0 2px #f0c14b;
  }
  .meal-legend-swatch-plain { background: #fff; box-shadow: inset 0 0 0 1px var(--border); margin-left: 10px; }
  .meal-notes {
    margin-top: 12px; padding: 10px 14px; background: #fffbea; border: 1px solid #f0c14b;
    border-radius: 8px; font-size: 12.5px;
  }
  .meal-notes strong { color: #92620a; }
  .meal-notes ul { margin: 6px 0 0; padding-left: 18px; }
  .meal-notes li { margin-bottom: 3px; }
  .meal-notes-others { margin-top: 8px; background: #f3edfd; border-color: var(--meals-color); }
  .meal-notes-others strong { color: var(--meals-color); }
  .meal-notes-request { margin-top: 8px; background: #e6f7f4; border-color: var(--laporan-color); }
  .meal-notes-request strong { color: var(--laporan-color); }

  .event-card { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
  .event-card-head {
    display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
    cursor: pointer; background: #fbfcfe;
  }
  .event-card-head strong { font-size: 13.5px; }
  .event-card-head .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
  .event-card-body { display: none; padding: 12px 14px; border-top: 1px solid var(--border); }
  .event-card.open .event-card-body { display: block; }
  .chev { transition: transform .15s; color: var(--text-muted); }
  .event-card.open .chev { transform: rotate(180deg); }

  .bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
  .bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
  .bar-chart .bar { width: 60%; background: linear-gradient(180deg,#38bdf8,var(--po-color)); border-radius: 6px 6px 0 0; min-height: 3px; }
  .bar-chart .bar-value { font-size: 10.5px; color: var(--text-muted); margin-bottom: 4px; }
  .bar-chart .bar-label { font-size: 10.5px; color: var(--text-muted); margin-top: 6px; text-align: center; }

  .empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
  .empty-state svg { opacity: .5; margin-bottom: 10px; }

  .toast {
    position: fixed; bottom: 20px; right: 20px; background: #1a202c; color: #fff; padding: 12px 18px;
    border-radius: 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 999;
    display: none; max-width: 320px;
  }
  .toast.error { background: #dc2626; }
  .toast.success { background: #16a34a; }

  .loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,.7); display: none;
    align-items: center; justify-content: center; z-index: 1000; flex-direction: column; gap: 10px;
  }
  .spinner {
    width: 34px; height: 34px; border: 3px solid #dbe3ec; border-top-color: var(--po-color);
    border-radius: 50%; animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .success-box { text-align: center; padding: 30px 16px; }
  .success-box .check-circle {
    width: 60px; height: 60px; border-radius: 50%; background: #dcfce7; color: var(--report-green);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 28px;
  }
  table.pricing-table { width: 100%; border-collapse: collapse; }
  table.pricing-table th {
    background: #1c3f60; color: #fff; padding: 8px 10px; font-size: 12px; text-transform: none;
  }
  table.pricing-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
  table.pricing-table td:first-child { font-weight: 600; white-space: nowrap; }
  table.pricing-table input[type=number] { max-width: 110px; }

  .filter-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
  .filter-bar input { max-width: 260px; }
  .filter-date-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
  .filter-date-label input { width: 150px; max-width: 150px; }

  /* Stays a single row even on mobile (unlike .filter-bar) - fields shrink to fit instead of
     stacking, since there are few enough of them to still be usable compact. */
  .forecast-filter-bar { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: nowrap; align-items: center; }
  .forecast-filter-bar input, .forecast-filter-bar select {
    flex: 1 1 0; min-width: 0; width: auto; max-width: none; font-size: 12.5px; padding: 8px 6px;
  }
  .forecast-filter-bar .btn { flex-shrink: 0; padding: 8px 12px; }

  /* 4.7 Laporan Forecast Kegiatan filter bar - more fields than .forecast-filter-bar, so it wraps
     to a 2nd row only when the viewport genuinely can't fit everything (narrow phones), instead of
     always stacking one-per-line like the generic .filter-bar does. */
  .fk-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; align-items: center; }
  .fk-filter-bar input, .fk-filter-bar select {
    flex: 1 1 110px; min-width: 90px; max-width: none; width: auto; font-size: 12.5px; padding: 8px 6px;
  }
  .fk-filter-bar input#fkFilterInstansi { flex-basis: 150px; }
  .fk-filter-bar .btn { flex: 0 0 auto; padding: 8px 10px; font-size: 12.5px; }
  .text-muted { color: var(--text-muted); }
  .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mb-0 { margin-bottom: 0; }

  .nama-kegiatan-link {
    color: var(--po-color); font-weight: 700; cursor: pointer; text-decoration: underline;
    text-decoration-style: dotted; text-underline-offset: 3px;
  }
  .nama-kegiatan-link:hover { color: var(--meals-color); }
  .forecast-riwayat-link {
    color: var(--po-color); font-weight: 700; cursor: pointer; text-decoration: underline;
    text-decoration-style: dotted; text-underline-offset: 3px;
  }
  .forecast-riwayat-link:hover { color: var(--meals-color); }

  .modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.55); display: none;
    align-items: center; justify-content: center; z-index: 1100; padding: 20px;
  }
  .modal-overlay.open { display: flex; }
  .modal-box {
    background: #fff; border-radius: var(--radius); max-width: 640px; width: 100%;
    max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25);
  }
  .modal-header {
    display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
    border-bottom: 1px solid var(--border);
  }
  .modal-header h3 { margin: 0; font-size: 15px; }
  .modal-close {
    background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer;
    color: var(--text-muted); padding: 0 4px;
  }
  .modal-close:hover { color: var(--text); }
  .modal-body { padding: 16px 20px; overflow-y: auto; }
  .modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
  .confirm-box { max-width: 420px; }
  .modal-box-wide { max-width: 780px; }
  .status-list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .status-list-table th { text-align: left; padding: 7px 8px; border-bottom: 2px solid var(--border); color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; }
  .status-list-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
  .status-list-table tr.status-list-row { cursor: pointer; }
  .status-list-table tr.status-list-row:hover { background: #f8fafc; }
  .confirm-box .modal-body p { margin: 0; line-height: 1.6; color: #374151; font-size: 13.5px; }
  .revenue-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .revenue-detail-table th { text-align: left; padding: 7px 8px; border-bottom: 2px solid var(--border); color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; }
  .revenue-detail-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
  .revenue-detail-table td.num, .revenue-detail-table th.num { text-align: right; }
  .revenue-detail-table tr.total-row td { font-weight: 800; border-top: 2px solid var(--laporan-color); border-bottom: none; color: var(--laporan-color); }
  .revenue-detail-table td.date-cell { font-weight: 700; vertical-align: top; background: #f8fafc; white-space: nowrap; }
  .revenue-detail-table tr.date-group-start td { border-top: 2px solid var(--border); }

  .section-kicker {
    display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--laporan-color); background: #e6faf7; padding: 3px 9px;
    border-radius: 20px; margin-bottom: 8px;
  }

  .calendar-header { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 4px; }
  .view-toggle { display: flex; gap: 8px; justify-content: center; margin: 10px 0 4px; }
  .view-toggle-btn {
    padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: #fff;
    font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--text-muted);
  }
  .view-toggle-btn.active { background: var(--laporan-color); color: #fff; border-color: var(--laporan-color); }
  .calendar-title { margin: 0; font-size: 16px; min-width: 160px; text-align: center; }
  .calendar-legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 10px 0 14px; font-size: 11.5px; color: var(--text-muted); }
  .calendar-legend-item { display: flex; align-items: center; gap: 5px; }
  .calendar-legend-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
  .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
  .calendar-weekday {
    text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; padding-bottom: 6px;
  }
  .calendar-day {
    min-height: 92px; border: 1px solid var(--border); border-radius: 8px; padding: 6px;
    background: #fff; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
  }
  .calendar-day.empty { background: #f8fafc; border-style: dashed; }
  .calendar-day.today { border-color: var(--laporan-color); box-shadow: inset 0 0 0 1px var(--laporan-color); }
  .calendar-day-num { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
  .calendar-day.today .calendar-day-num { color: var(--laporan-color); }
  .calendar-chip {
    font-size: 10.5px; padding: 2px 6px; border-radius: 5px; color: #fff; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default;
  }
  .forecast-chip { cursor: pointer; }
  .forecast-chip:hover { opacity: .8; box-shadow: 0 0 0 2px rgba(0,0,0,.15) inset; }
  .forecast-detail-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
  .forecast-detail-row:last-child { border-bottom: none; }
  .forecast-detail-label { width: 130px; flex-shrink: 0; color: var(--text-muted); font-weight: 600; }
  .forecast-detail-value { flex: 1; }
  .forecast-history-list { list-style: none; margin: 0; padding: 0; }
  .forecast-history-list li { padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
  .forecast-history-list li:last-child { border-bottom: none; }
  .status-tentative { background: #64748b; }
  .status-confirm { background: #00a65a; }
  .status-cancel { background: #dc3545; }

  /* Department visual distinction on calendar chips: colored left border. */
  .forecast-chip.dept-fb { border-left: 3px solid #605ca8; }
  .forecast-chip.dept-hk { border-left: 3px solid #00c0ef; }
  .forecast-chip.dept-fo { border-left: 3px solid #0073b7; }
  .forecast-chip.dept-mdp { border-left: 3px solid #f39c12; }
  .forecast-chip.dept-me { border-left: 3px solid #d81b60; }
  .forecast-chip.dept-gm { border-left: 3px solid #00a65a; }
  .dept-badge {
    display: inline-block; font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
    color: #fff; margin-left: 6px; vertical-align: middle;
  }
  .dept-badge.dept-fb { background: #605ca8; }
  .dept-badge.dept-hk { background: #00c0ef; }
  .dept-badge.dept-fo { background: #0073b7; }
  .dept-badge.dept-mdp { background: #f39c12; }
  .dept-badge.dept-me { background: #d81b60; }
  .dept-badge.dept-gm { background: #00a65a; }

  .divisi-badge {
    display: inline-block; font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
    color: #fff; margin-left: 6px; vertical-align: middle;
  }
  .divisi-badge.divisi-residence { background: #1976d2; }
  .divisi-badge.divisi-pelatihan { background: #8e24aa; }
  .divisi-badge.divisi-assessment { background: #e65100; }
  .divisi-badge.divisi-lainnya { background: #607d8b; }

  .divisi-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px;
    vertical-align: middle; flex-shrink: 0;
  }
  .divisi-dot.divisi-residence { background: #1976d2; }
  .divisi-dot.divisi-pelatihan { background: #8e24aa; }
  .divisi-dot.divisi-assessment { background: #e65100; }
  .divisi-dot.divisi-lainnya { background: #607d8b; }

  .forecast-status-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
  .forecast-status-summary .fss-card {
    flex: 1; min-width: 130px; background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px; text-align: center; cursor: pointer; transition: box-shadow .15s, border-color .15s;
  }
  .forecast-status-summary .fss-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); border-color: var(--laporan-color); }
  .forecast-status-summary .fss-count { font-size: 26px; font-weight: 800; line-height: 1.1; }
  .forecast-status-summary .fss-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
  .forecast-status-summary .fss-card.fss-tentative .fss-count { color: #64748b; }
  .forecast-status-summary .fss-card.fss-confirm .fss-count { color: #00a65a; }
  .forecast-status-summary .fss-card.fss-cancel .fss-count { color: #dc3545; }

  tr.row-cancelled { background: #fff5f5; }
  select.forecast-status-select.is-cancel { color: #dc3545; font-weight: 700; border-color: #dc3545; }

  @media (max-width: 800px) {
    .calendar-day { min-height: 60px; }
    .calendar-weekday { font-size: 9px; }
  }

  .no-access-screen {
    position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center;
    justify-content: center; z-index: 2000; padding: 20px;
  }
  .no-access-box { text-align: center; max-width: 420px; }
  .no-access-icon { font-size: 48px; margin-bottom: 14px; }
  .no-access-box h2 { margin: 0 0 10px; }
  .no-access-box p { color: var(--text-muted); line-height: 1.6; }

  table.pricing-table input[type=text] { width: 100%; min-width: 140px; }
  table.pricing-table select { width: 100%; }
  table.pricing-table td.access-actions { white-space: nowrap; }
  .remove-plan-btn {
    background: rgba(255,255,255,.35); color: #7a1f1f; border: none; border-radius: 50%;
    width: 16px; height: 16px; line-height: 1; font-size: 11px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-left: 2px;
  }
  .remove-plan-btn:hover { background: #dc2626; color: #fff; }

  .danger-zone-card { border: 2px solid #dc2626; }
  .danger-zone-card h3 { color: #dc2626; }
  .danger-zone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 700px) { .danger-zone-grid { grid-template-columns: 1fr; } }
  .danger-zone-col { background: #f8fafc; border-radius: 10px; padding: 12px 14px; }
  .danger-zone-col ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; }
  .danger-zone-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
  .danger-zone-label-bad { color: #dc2626; }
  .danger-zone-label-good { color: #00a65a; }

  .chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip-item {
    display: inline-flex; align-items: center; gap: 6px; background: #eef2f7; border: 1px solid var(--border);
    border-radius: 20px; padding: 6px 8px 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--text);
  }
  .chip-item .chip-remove {
    background: #dc2626; color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px;
    line-height: 1; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  .chip-item .chip-remove:hover { background: #b91c1c; }

  .al-department-badge {
    margin: 0 16px 12px; padding: 8px 12px; background: rgba(255,255,255,.06); border-radius: 8px;
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px; color: var(--sidebar-text); white-space: nowrap;
  }
  .al-department-badge #departmentBadgeLabel { font-weight: 700; color: #fff; }
  .al-sidebar.collapsed .al-department-badge { display: none !important; }

  .print-only-header { display: none; }

  @media print {
    @page { size: landscape; }
    body { background: #fff; }
    .no-print, .al-sidebar, .al-topbar, .loading-overlay, .toast { display: none !important; }
    .al-wrapper, .al-main, .al-content { display: block !important; height: auto !important; overflow: visible !important; }
    .page { display: none !important; }
    .page.active { display: block !important; }
    /* Only the active report's own content should print - the KPI overview and revenue chart
       sit above every sub-panel and aren't part of any single report being printed. */
    #kpiGrid, #revenueChartCard { display: none !important; }
    .print-only-header { display: block; margin-bottom: 10px; }
    .print-only-header h2 { margin: 0 0 3px; font-size: 14px; }
    .print-only-header #printHeaderMeta { font-size: 9.5px; color: #444; }
    /* Smaller type + tighter spacing so more dates fit per printed page and less paper is used. */
    body { font-size: 10px; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; page-break-inside: avoid; padding: 8px; margin-bottom: 8px; }
    .card h3 { font-size: 11px; margin: 0 0 6px; }
    table { font-size: 9px; }
    th, td { padding: 3px 5px !important; }
    .pivot-date-header { font-size: 10.5px; padding: 5px 8px; margin: -8px -8px 8px; }
    table.pivot-table th { font-size: 8.5px; }
    .meal-legend { font-size: 9px; margin-bottom: 6px; }
    .meal-legend-swatch { width: 10px; height: 10px; }
    .meal-notes { font-size: 9px; padding: 6px 9px; margin-top: 8px; }
    .kpi-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
    table.pivot-table th, table.pivot-table td.meal-box-cell, table.pivot-table tr.pivot-total-row td {
      -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .table-wrap { overflow: visible; }
  }

  /* ===================== PO RESIDENCE - printable PO document ===================== *
   * #poResidencePrintArea sits outside the .page/.poRes-section flow (a plain sibling div) so
   * printing works from the Daftar PO list without navigating into the wizard first. It's always
   * display:none on screen; body.print-po-residence (toggled briefly around window.print() in
   * JavaScript.html, together with a dynamically-injected `@page { size: portrait }` override -
   * the app's one global @media print block above sets landscape for the wide Laporan tables, so
   * this override must win the cascade rather than editing that shared rule) swaps visibility so
   * only this document prints, mimicking the real "MASTER PO KOSONG" paper form's 2-page layout. */
  #poResidencePrintArea { display: none; }
  @media print {
    body.print-po-residence .al-sidebar, body.print-po-residence .al-topbar { display: none !important; }
    body.print-po-residence .page { display: none !important; }
    body.print-po-residence #poResidencePrintArea { display: block !important; }
  }

  .por-print-page { padding: 18px 22px; font-size: 11px; color: #111; page-break-after: always; }
  .por-print-page:last-child { page-break-after: auto; }
  .por-print-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
  .por-print-headerbox { border: 1px solid #111; padding: 6px 10px; font-size: 10px; min-width: 320px; }
  table.por-print-headerinfo { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
  table.por-print-headerinfo td { padding: 1px 4px; font-size: 10.5px; vertical-align: top; }
  table.por-print-headerinfo td:first-child { width: 85px; font-weight: 600; }
  table.por-print-headerinfo td:nth-child(2) { width: 12px; }
  table.por-print-klasifikasi { width: 100%; border-collapse: collapse; }
  table.por-print-klasifikasi td { padding: 2px 4px; font-size: 10.5px; font-weight: 600; vertical-align: middle; }
  .por-print-checkbox { width: 16px; height: 14px; border: 1px solid #111; padding: 0 !important; }
  .por-print-checkbox.checked { background: #111; }
  .por-print-regionalnum { width: 20px; height: 16px; border: 1px solid #111; text-align: center; font-weight: 700 !important; padding: 0 !important; }
  .por-print-regionalnum.checked { background: #111; color: #fff; }
  .por-print-logo { text-align: right; }
  .por-print-logo img { max-width: 210px; width: 100%; height: auto; }
  .por-print-brand { text-align: center; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 10px; }
  .por-print-brand-title { font-size: 16px; font-weight: 800; text-decoration: underline; }
  .por-print-brand-sub { font-size: 11px; font-weight: 700; margin-top: 2px; }
  table.por-print-fields { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
  table.por-print-fields td { padding: 2px 4px; font-size: 10.5px; vertical-align: top; }
  .por-print-label { width: 190px; font-weight: 600; }
  table.por-print-box { width: 100%; border-collapse: collapse; border: 1px solid #111; margin-bottom: 10px; }
  table.por-print-box td { border: 1px solid #111; padding: 6px 8px; font-size: 10.5px; vertical-align: top; }
  .por-print-boxlabel { width: 150px; font-weight: 600; background: #f2f2f2; }
  .por-print-note { font-size: 9px; color: #444; }
  .por-print-mealstype { font-weight: 700; margin-bottom: 8px; }
  table.por-print-mealstable { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
  table.por-print-mealstable th, table.por-print-mealstable td { border: 1px solid #111; padding: 4px 6px; font-size: 9.5px; text-align: center; }
  table.por-print-mealstable th { background: #f2f2f2; font-weight: 700; }
  table.por-print-mealstable td:first-child { text-align: left; font-weight: 600; }
  .por-print-terms { font-size: 9px; margin-bottom: 12px; }
  .por-print-terms-title { font-weight: 700; font-style: italic; margin-bottom: 4px; }
  .por-print-terms ol { margin: 0; padding-left: 16px; line-height: 1.6; }
  .por-print-signatures { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
  .por-print-sig { flex: 1; text-align: center; font-size: 10px; }
  .por-print-sig-label { font-weight: 600; }
  .por-print-sig-role { margin-bottom: 4px; }
  .por-print-sig-space { height: 50px; }
  .por-print-sig-name { border-top: 1px solid #111; padding-top: 3px; font-weight: 600; }
  .por-print-rabtitle { text-align: center; font-weight: 700; background: #f2f2f2; border: 1px solid #111; border-bottom: none; padding: 4px; font-size: 11px; }
  table.por-print-rabtable { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
  table.por-print-rabtable th, table.por-print-rabtable td { border: 1px solid #111; padding: 3px 6px; font-size: 9.5px; }
  table.por-print-rabtable th { background: #f2f2f2; font-weight: 700; text-align: center; }
  table.por-print-rabtable td.rab-num { text-align: right; }
  table.por-print-rabtable tr.rab-daterow td { font-weight: 700; background: #fafafa; }
  table.por-print-rabtable tr.rab-totalrow td { font-weight: 700; text-align: right; }

  /* RAB & GEO line-item editor (Step 4 wizard) */
  .por-rab-table-wrap { overflow-x: auto; }
  table.por-rab-table { width: 100%; border-collapse: collapse; margin-top: 6px; min-width: 720px; }
  table.por-rab-table th, table.por-rab-table td { border: 1px solid #e2e2e2; padding: 4px; font-size: 12px; }
  table.por-rab-table th { background: #f7f7f7; font-weight: 700; text-align: left; }
  table.por-rab-table input, table.por-rab-table select { width: 100%; box-sizing: border-box; padding: 4px 5px; font-size: 12px; border: 1px solid #ccc; border-radius: 4px; }
  table.por-rab-table td.rab-total-cell { text-align: right; white-space: nowrap; font-weight: 600; }
  .por-rab-footer { text-align: right; margin-top: 6px; font-size: 13px; line-height: 1.7; }
  .por-rab-footer strong { margin-left: 10px; }