/* Modal dialog framework + shared dialog element styling. */

.bb-dialog-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.bb-dialog {
  background: var(--bb-panel); border: 1px solid #1e1e1e; border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6); min-width: 360px; max-width: 92vw; max-height: 90vh;
  display: flex; flex-direction: column; position: absolute;
}
.bb-dialog-title {
  display: flex; align-items: center; padding: 8px 12px; font-weight: 600;
  background: var(--bb-panel-head); border-bottom: 1px solid var(--bb-border);
  border-radius: 4px 4px 0 0; cursor: move;
}
.bb-dialog-title .bb-dialog-close {
  margin-left: auto; cursor: pointer; padding: 0 6px; color: var(--bb-text-dim); font-size: 15px;
}
.bb-dialog-title .bb-dialog-close:hover { color: #fff; }
.bb-dialog-body { padding: 14px 16px; overflow: auto; flex: 1; min-height: 0; }
.bb-dialog-footer {
  display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px;
  border-top: 1px solid var(--bb-border);
}
.bb-form-grid {
  display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; align-items: center;
}
.bb-form-grid label { color: var(--bb-text-dim); }
.bb-form-grid .bb-full { grid-column: 1 / -1; }
.bb-fieldset {
  border: 1px solid var(--bb-border-light); border-radius: 3px; padding: 10px 12px; margin: 10px 0;
}
.bb-fieldset legend { color: var(--bb-text-dim); padding: 0 6px; }
.bb-radio-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.bb-hint { color: var(--bb-text-dim); font-size: var(--bb-font-size-sm); }

/* color picker popup */
.bb-colorpicker {
  position: fixed; z-index: 3500; background: #2f2f2f; border: 1px solid #1e1e1e;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5); padding: 8px; border-radius: 3px;
}
.bb-colorpicker .bb-cp-grid { display: grid; grid-template-columns: repeat(6, 22px); gap: 4px; }
.bb-colorpicker .bb-cp-cell {
  width: 22px; height: 22px; border: 1px solid #666; border-radius: 2px; cursor: pointer;
}
.bb-colorpicker .bb-cp-cell:hover { outline: 2px solid var(--bb-accent-hover); }
.bb-colorpicker .bb-cp-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.bb-colorpicker .bb-cp-none {
  margin-top: 8px; text-align: center; padding: 3px; border: 1px solid #666; cursor: pointer; border-radius: 2px;
}
.bb-colorpicker .bb-cp-none:hover { background: var(--bb-hover); }

/* toast notifications */
.bb-toast-wrap { position: fixed; bottom: 40px; right: 20px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; }
.bb-toast {
  background: #2c2c2c; border: 1px solid var(--bb-border-light); border-left: 3px solid var(--bb-accent);
  padding: 10px 16px; border-radius: 3px; box-shadow: 0 3px 12px rgba(0,0,0,0.5); max-width: 380px;
  animation: bb-toast-in 0.18s ease-out;
}
.bb-toast.bb-toast-error { border-left-color: var(--bb-danger); }
@keyframes bb-toast-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* progress dialog */
.bb-progress-bar {
  height: 14px; background: var(--bb-recessed); border: 1px solid var(--bb-border-light);
  border-radius: 2px; overflow: hidden; margin: 10px 0;
}
.bb-progress-fill { height: 100%; background: var(--bb-accent); width: 0%; transition: width 0.15s; }
