/* Additional workflow controls use the existing page colors and components. */
[hidden] { display: none !important; }
.navbar .brand { white-space: nowrap; flex-shrink: 0; }
.navbar .nav-links { gap: 2px; }
.navbar .nav-links a { padding: 8px 10px; white-space: nowrap; }
.nav-user-controls { display: flex; align-items: center; gap: 8px; position: relative; flex-shrink: 0; }
.nav-user-controls #userMenuBtn, .nav-user-controls > .btn { white-space: nowrap; flex-shrink: 0; }
#identity-switch { max-width: 290px; min-width: 130px; padding: 6px; border: 1px solid #ddd; border-radius: 6px; font-size: 12px; }
.scope-label { color: #64748b; font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid > * { min-width: 0; }
.workflow-dialog { margin: auto; width: min(760px, 94vw); max-height: 90vh; border: 0; border-radius: 12px; background: white; color: #333; box-shadow: 0 10px 40px #0003; }
.workflow-dialog::backdrop { background: rgba(0,0,0,.5); }
.confirm-dialog { width: min(460px, 94vw); }
.modal-actions { padding: 16px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #eee; }
.modal-actions .primary { background: #1a73e8; color: white; }
.close-button { background: none; border: none; padding: 0 5px; }
.modal-error { color: #c5221f; padding: 0 20px 12px; }
.form-grid, .permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; min-width: 0; }
.field > label { display: block; font-size: 14px; color: #555; margin-bottom: 6px; font-weight: 500; }
.field input:not([type=checkbox]):not([type=hidden]), .field select, .field textarea, .filter-bar input, .filter-bar select, .allocation-row input, .allocation-row select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font: inherit; font-size: 14px; }
.field textarea { min-height: 90px; resize: vertical; }
.field-help, .muted, .sub { font-size: 12px; color: #888; margin-top: 4px; }
.span-2 { grid-column: 1 / -1; }
.definition { display: grid; grid-template-columns: 140px 1fr; font-size: 14px; line-height: 1.8; gap: 8px; overflow-wrap: anywhere; }
.definition dt { color: #888; }
.definition dd { min-width: 0; }
.workflow-dialog h3 { font-size: 15px; margin: 14px 0 10px; }
.workflow-dialog hr { border: 0; border-top: 1px solid #eee; margin: 18px 0; }
.page-head, .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-actions, .actions, .batch-actions, .badge-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.actions .small, .btn.small { font-size: 12px; padding: 6px 10px; }
.notice { padding: 12px 16px; margin-bottom: 16px; border-radius: 6px; color: #1967d2; background: #e8f0fe; font-size: 13px; line-height: 1.7; }
.notice.warm { background: #fef3e8; color: #b06000; }
.environment-banner { padding: 10px 24px; background: #e8f0fe; color: #1967d2; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.environment-banner a { margin-left: 10px; color: #1967d2; text-decoration: underline; white-space: nowrap; }
.current-stage { margin-bottom: 16px; font-size: 14px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.filter-bar input, .filter-bar select { width: auto; max-width: 230px; }
.file-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; background: #f5f8fc; border-radius: 6px; }
.file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.timeline { margin-top: 14px; list-style: none; }
.timeline li { position: relative; padding: 0 0 18px 8px; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #1a73e8; }
.timeline small { display: block; color: #888; margin: 4px 0; }
.timeline p { overflow-wrap: anywhere; }
.allocation-row { display: grid; grid-template-columns: 1fr 130px 40px; gap: 10px; margin-bottom: 12px; }
.allocation-total { padding: 12px 0; color: #1a73e8; }
.unit-totals { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.unit-totals strong { margin-right: 5px; }
.batch-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; color: #888; font-size: 13px; }
.batch-actions { margin-top: 16px; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.metric { background: white; border-radius: 12px; padding: 20px; }
.metric-value { font-size: 28px; color: #1a73e8; font-weight: 700; margin: 8px 0; }
.metric-label, .metric-note { font-size: 13px; color: #888; }
.permission-option { border: 1px solid #eee; padding: 10px; border-radius: 6px; }
.permission-option small { display: block; color: #888; margin-top: 6px; }
.checkbox-label { display: flex !important; gap: 8px; align-items: flex-start; }
.checkbox-label input { width: auto; margin-top: 3px; }
.form-section { border-top: 1px solid #eee; margin-top: 16px; padding-top: 10px; }
.rule-matrix input { width: 100px; padding: 8px; border: 1px solid #ddd; border-radius: 6px; }
details { margin-top: 16px; }
summary { cursor: pointer; font-size: 14px; color: #1a73e8; margin-bottom: 12px; }
.badge.dark, .badge-default { background: #f1f3f4; color: #666; }
.badge.success { background: #e6f4ea; color: #137333; }
.badge.rejected { background: #fce8e8; color: #c5221f; }
.badge.public { background: #e8f0fe; color: #1967d2; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 500; max-width: 90vw; padding: 12px 20px; border-radius: 6px; background: #137333; color: white; display: none; font-size: 14px; }
#toast.show { display: block; }
#toast.error { background: #c5221f; }
.btn:disabled { opacity: .55; cursor: wait; }
.empty strong { display: block; margin-bottom: 6px; }
.tabs { overflow-x: auto; }
.tab { white-space: nowrap; }
.search-bar label { font-size: 13px; color: #666; display: flex; gap: 6px; align-items: center; }
.stat-value { overflow-wrap: anywhere; }
@media (max-width: 1200px) {
  .navbar .nav-inner { height: auto; min-height: 60px; flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .navbar .nav-links { display: flex; order: 3; width: 100%; overflow-x: auto; }
}
@media (max-width: 700px) {
  .container { padding: 14px; }
  .navbar .brand { font-size: 17px; }
  .navbar .nav-inner { padding-left: 14px; padding-right: 14px; }
  .nav-user-controls { width: 100%; flex-wrap: wrap; }
  .nav-user-controls > .btn { margin-left: auto; }
  #identity-switch { flex: 1 1 100%; max-width: 100%; }
  .nav-user-controls > .scope-label { flex-basis: 100%; max-width: 100%; }
  .grid-4, .metric-strip { grid-template-columns: 1fr 1fr; }
  .grid-2, .form-row, .form-grid, .permission-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .page-head, .panel-head { flex-wrap: wrap; }
  .definition { grid-template-columns: 100px 1fr; }
  .allocation-row { grid-template-columns: minmax(0, 1fr) 80px 36px; gap: 6px; }
  .card { padding: 16px; }
  .chart { height: 280px; }
  .stat-card .stat-value { font-size: 25px; }
  .screen-grid { grid-template-columns: 1fr; }
  .screen-body { overflow: auto; }
  .screen-header { padding: 16px; flex-wrap: wrap; gap: 12px; }
  .screen-title { font-size: 22px; }
  .screen-grid { height: auto; padding: 0 14px 20px; }
}
