#urbm-app {
  --bu-page: transparent;
  --bu-panel: var(--mild-background-color, #ffffff);
  --bu-panel-alt: var(--background-color, #f3f5f7);
  --bu-input: var(--input-bg-color, var(--background-color, #ffffff));
  --bu-border: var(--table-border-color, var(--border-color, #87919a));
  --bu-border-strong: var(--border-color, #68737e);
  --bu-text: var(--text-color, #1d252c);
  --bu-muted: var(--text-color, #52606b);
  --bu-accent: var(--brand-orange, var(--orange-500, #ff8c2f));
  --bu-accent-hover: var(--orange-400, #c94a17);
  --bu-good: #138a62;
  --bu-bad: #c93642;
  --bu-focus: rgba(232, 93, 36, .25);
  background: var(--bu-page);
  color: var(--bu-text) !important;
  font-size: 15px;
  line-height: 1.45;
  max-width: 1500px;
  padding: 10px 18px 40px;
}

.bu-header { align-items: center; display: flex; justify-content: space-between; margin: 6px 0 22px; }
.bu-brand { align-items: center; display: flex; gap: 14px; min-width: 0; }
.bu-logo { display: block; flex: 0 0 auto; height: 58px; object-fit: contain; width: 58px; }
#urbm-app .bu-header h1 { color: var(--bu-text) !important; font-size: 30px; font-weight: 700; line-height: 1.2; margin: 0; }
.bu-version { border: 1px solid var(--bu-border); border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 7px; vertical-align: middle; }
#urbm-app .bu-header p { color: var(--bu-muted) !important; font-size: 16px; margin: 5px 0 0; opacity: .78; }
.bu-health { background: var(--bu-panel); border: 1px solid var(--bu-border); border-radius: 999px; color: var(--bu-text); font-weight: 600; padding: 9px 15px; }
.bu-health.ok { color: var(--bu-good); }
.bu-health.bad { color: var(--bu-bad); }

.bu-tabs { border-bottom: 2px solid var(--bu-border-strong); display: flex; gap: 3px; margin-bottom: 20px; overflow-x: auto; }
#urbm-app .bu-tabs button {
  appearance: none;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 4px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--bu-text) !important;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  margin: 0 !important;
  min-height: 46px;
  padding: 11px 16px !important;
  text-shadow: none !important;
  opacity: .68;
  text-transform: none;
  white-space: nowrap;
}
#urbm-app .bu-tabs button:hover { color: var(--bu-text) !important; opacity: 1; }
#urbm-app .bu-tabs button.active { border-bottom-color: var(--bu-accent) !important; color: var(--bu-text) !important; opacity: 1; }

.bu-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.bu-chart-grid-layout { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.bu-card { background: var(--bu-panel); border: 1px solid var(--bu-border); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.12); color: var(--bu-text); padding: 18px; }
#urbm-app .bu-card h2, #urbm-app .bu-card h3 { color: var(--bu-text) !important; font-weight: 700; margin-top: 0; }
.bu-stat { color: var(--bu-text); font-size: 32px; font-weight: 700; }
.bu-chart { display: block; height: 240px; margin-top: 12px; overflow: visible; width: 100%; }
.bu-chart-grid line { stroke: var(--bu-border); stroke-width: 1; }
.bu-chart-grid text, .bu-chart-date { fill: var(--bu-muted); font-size: 11px; }
.bu-chart-area { fill: var(--bu-accent); opacity: .10; }
.bu-chart-line { fill: none; stroke: var(--bu-accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.bu-chart-dots circle { fill: var(--bu-panel); stroke: var(--bu-accent); stroke-width: 3; }
.bu-chart-empty { align-items: center; color: var(--bu-muted); display: flex; height: 240px; justify-content: center; text-align: center; }
#urbm-app .bu-muted { color: var(--bu-muted) !important; opacity: .72; }
.bu-toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 14px; }
.bu-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.bu-table-actions { align-items: flex-start; min-width: 310px; }
.bu-table-actions .bu-button { flex: 0 0 auto; }
.bu-warning { color: var(--bu-bad) !important; display: block; font-size: 13px; font-weight: 700; margin-top: 5px; }
.bu-browser-card { border: 1px solid var(--bu-border); border-radius: 6px; margin-top: 10px; padding: 14px; }
.bu-browser-scroll { max-height: 430px; overflow: auto; }
.bu-selection-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.bu-selection { background: var(--bu-panel-alt); border: 1px solid var(--bu-border); border-radius: 999px; color: var(--bu-text); font-size: 12px; padding: 4px 8px; }
.bu-browser-card input[type="checkbox"], .bu-table input[type="checkbox"] { accent-color: var(--bu-accent); height: 20px; width: 20px; }
.bu-count { align-items: center; border: 1px solid var(--bu-border); border-radius: 999px; display: inline-flex; font-size: 13px; font-weight: 700; padding: 7px 11px; }
.bu-inline-error { background: rgba(180,35,47,.08); border: 1px solid var(--bu-bad); border-radius: 5px; color: var(--bu-bad); font-weight: 600; margin: 10px 0; padding: 10px 12px; }
.bu-inline-info { background: rgba(19,138,98,.08); border: 1px solid var(--bu-good); border-radius: 5px; color: var(--bu-text); font-weight: 600; margin: 10px 0; padding: 10px 12px; }
.bu-workload-options { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(220px, 1fr)); margin-top: 15px; }
.bu-manual-source { display: grid; gap: 7px; margin-top: 14px; }
.bu-info-card { background: var(--bu-panel-alt); border: 1px solid var(--bu-border); border-radius: 6px; padding: 16px; }
.bu-fieldset { border: 1px solid var(--bu-border); border-radius: 6px; padding: 14px; }
.bu-fieldset legend { color: var(--bu-text); font-size: 17px; font-weight: 700; padding: 0 7px; }
.bu-retention-grid { display: grid; gap: 15px; grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.bu-schedule-grid { display: grid; gap: 15px; grid-template-columns: minmax(240px, 2fr) minmax(150px, 1fr); }
.bu-weekdays { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.bu-weekdays[hidden] { display: none; }
.bu-weekdays > span { font-weight: 700; margin-right: 4px; }
#urbm-app .bu-weekdays label { display: block; }
#urbm-app .bu-weekdays label span { background: var(--bu-panel-alt); border: 1px solid var(--bu-border-strong); border-radius: 5px; cursor: pointer; display: block; min-width: 46px; padding: 9px 11px; text-align: center; }
#urbm-app .bu-weekdays input { opacity: 0; pointer-events: none; position: absolute; }
#urbm-app .bu-weekdays input:checked + span { background: var(--bu-accent) !important; border-color: var(--bu-accent) !important; color: #fff !important; }
.bu-custom-cron { margin-top: 14px; }
.bu-event-options { display: flex; flex-wrap: wrap; gap: 10px; }
.bu-progress-wrap { min-width: 280px; }
.bu-progress-label { align-items: center; display: flex; font-size: 12px; gap: 8px; justify-content: space-between; margin-bottom: 5px; }
.bu-progress-label span { color: var(--bu-muted); }
.bu-progress { background: var(--bu-panel-alt); border: 1px solid var(--bu-border); border-radius: 999px; height: 12px; overflow: hidden; }
.bu-progress span { background: var(--bu-accent); display: block; height: 100%; min-width: 0; transition: width .35s ease; }
.bu-progress.indeterminate span { animation: bu-progress-scan 1.2s ease-in-out infinite alternate; }
.bu-current-file { color: var(--bu-muted); font-size: 12px; margin-top: 5px; max-width: 440px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bu-log-row td { border-top: 0 !important; padding-top: 0 !important; }
.bu-live-log { background: #11161a; border: 1px solid var(--bu-border); border-radius: 6px; color: #e8edf1; margin: 2px 0 8px; padding: 9px 12px; }
.bu-live-log summary { cursor: pointer; font-weight: 700; }
.bu-live-log pre { color: #e8edf1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; margin: 10px 0 0; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
@keyframes bu-progress-scan { from { transform: translateX(-20%); } to { transform: translateX(250%); } }
.bu-form-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.bu-managed-mount, .bu-external-mount { margin-top: 14px; }
.bu-managed-mount[hidden], .bu-external-mount[hidden] { display: none; }
#urbm-app .bu-inline-check { align-items: center; display: flex; gap: 9px; grid-template-columns: auto 1fr; }
#urbm-app .bu-inline-check input { margin: 0; }
#urbm-app .bu-event-options label { align-items: center; display: flex; gap: 7px; grid-template-columns: auto auto; }
#urbm-app .bu-event-options input[type="checkbox"] { margin: 0; min-height: 20px; width: 20px; }

#urbm-app .bu-button {
  appearance: none;
  background: var(--bu-panel-alt) !important;
  border: 1px solid var(--bu-border-strong) !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  color: var(--bu-text) !important;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  margin: 0 !important;
  min-height: 38px;
  padding: 8px 13px !important;
  text-shadow: none !important;
}
#urbm-app .bu-button:hover { border-color: var(--bu-accent) !important; }
#urbm-app .bu-button.primary { background: var(--bu-accent) !important; border-color: var(--bu-accent) !important; color: #ffffff !important; }
#urbm-app .bu-button.primary:hover { background: var(--bu-accent-hover) !important; }
#urbm-app .bu-button.danger { color: var(--bu-bad) !important; }
#urbm-app .bu-button:disabled { cursor: wait; opacity: .55; }

.bu-table { border-collapse: collapse; color: var(--bu-text); width: 100%; }
.bu-table th, .bu-table td { border-bottom: 1px solid var(--bu-border); color: var(--bu-text); padding: 12px 8px; text-align: left; vertical-align: top; }
.bu-table th { color: var(--bu-text); font-size: 13px; font-weight: 700; letter-spacing: .03em; opacity: .76; text-transform: uppercase; }
.bu-status { border: 1px solid currentColor; border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; text-transform: uppercase; }
.bu-status.success { background: rgba(8,122,85,.10); color: var(--bu-good); }
.bu-status.failed, .bu-status.cancelled { background: rgba(180,35,47,.10); color: var(--bu-bad); }
.bu-status.running, .bu-status.queued, .bu-status.paused, .bu-status.warning { background: rgba(232,93,36,.10); color: var(--bu-accent); }

.bu-form { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(220px, 1fr)); }
#urbm-app .bu-form label { color: var(--bu-text) !important; display: grid; font-size: 14px; font-weight: 600; gap: 7px; }
.bu-form .wide { grid-column: 1 / -1; }
#urbm-app .bu-form input,
#urbm-app .bu-form select,
#urbm-app .bu-form textarea,
#urbm-app select {
  background: var(--bu-input) !important;
  border: 1px solid var(--bu-border-strong) !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  color: var(--bu-text) !important;
  font: inherit;
  min-height: 40px;
  padding: 9px 10px !important;
}
#urbm-app .bu-form input:focus,
#urbm-app .bu-form select:focus,
#urbm-app .bu-form textarea:focus,
#urbm-app button:focus-visible {
  border-color: var(--bu-accent) !important;
  box-shadow: 0 0 0 3px var(--bu-focus) !important;
  outline: none;
}
#urbm-app .bu-form input[type="checkbox"] { accent-color: var(--bu-accent); min-height: 22px; width: 22px; }
#urbm-app .bu-form textarea { min-height: 100px; resize: vertical; }
.bu-empty { color: var(--bu-text); font-size: 15px; opacity: .72; padding: 34px; text-align: center; }
#bu-toast { background: var(--bu-panel); border: 1px solid var(--bu-border-strong); border-radius: 6px; bottom: 24px; color: var(--bu-text); display: none; font-weight: 600; max-width: 460px; padding: 12px 16px; position: fixed; right: 24px; z-index: 20; }
#bu-toast.show { display: block; }
#bu-toast.error { border-color: var(--bu-bad); color: var(--bu-bad); }

#urbm-app [data-tooltip] { cursor: help; }
#urbm-app button[data-tooltip],
#urbm-app input[data-tooltip],
#urbm-app select[data-tooltip],
#urbm-app textarea[data-tooltip] { cursor: pointer; }
#bu-tooltip {
  background: #15191d;
  border: 1px solid #59636d;
  border-radius: 7px;
  box-shadow: 0 8px 26px rgba(0,0,0,.35);
  color: #ffffff;
  display: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  max-width: min(380px, calc(100vw - 28px));
  padding: 10px 12px;
  pointer-events: none;
  position: fixed;
  text-align: left;
  white-space: normal;
  z-index: 100000;
}
#bu-tooltip.visible { display: block; }
#bu-tooltip::after {
  border: 6px solid transparent;
  border-top-color: #15191d;
  bottom: -12px;
  content: "";
  left: var(--bu-tooltip-arrow, 24px);
  position: absolute;
}
#bu-tooltip.below::after {
  border-bottom-color: #15191d;
  border-top-color: transparent;
  bottom: auto;
  top: -12px;
}

@media (max-width: 700px) {
  #urbm-app { padding-left: 8px; padding-right: 8px; }
  .bu-form { grid-template-columns: 1fr; }
  .bu-workload-options { grid-template-columns: 1fr; }
  .bu-retention-grid { grid-template-columns: 1fr; }
  .bu-schedule-grid { grid-template-columns: 1fr; }
  .bu-form-grid { grid-template-columns: 1fr; }
  .bu-chart-grid-layout { grid-template-columns: 1fr; }
  .bu-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .bu-table { display: block; overflow-x: auto; }
  .bu-table-actions { min-width: 240px; }
  #bu-tooltip { font-size: 13px; }
}
