.brigade-cell-wrap {
  position: relative;
}

.brigade-cell-wrap.open {
  z-index: 21;
}

.brigade-cell-button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.brigade-cell-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  max-height: 220px;
  overflow: auto;
  z-index: 8;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(17, 31, 56, 0.22);
  padding: 6px;
  display: none;
}

.brigade-cell-wrap.open .brigade-cell-menu {
  display: grid;
  gap: 4px;
}

.brigade-cell-option {
  min-height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 3px 8px;
  color: #1f3556;
  font-size: 11px;
}

.brigade-cell-option:hover,
.brigade-cell-option.is-active {
  background: #e7effb;
}

.brigade-pill {
  display: inline-flex;
  align-items: center;
  min-height: 15px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 15px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: #2f8443;
  background: #cbe9c9;
}

.brigade-neutral {
  color: #4a5668;
  background: #dfe5ec;
}

.brigade-color-1 { color: #154072; background: #c8def8; }
.brigade-color-2 { color: #0f6a52; background: #c8f0e5; }
.brigade-color-3 { color: #8c2e1f; background: #ffd9d1; }
.brigade-color-4 { color: #3f2a96; background: #d9d3ff; }
.brigade-color-5 { color: #7f4908; background: #ffdba8; }
.brigade-color-6 { color: #0d6771; background: #c8eef2; }
.brigade-color-7 { color: #8b1f67; background: #ffd2ed; }
.brigade-color-8 { color: #4f6d18; background: #e2f3bf; }
.brigade-color-9 { color: #4e3b8e; background: #e4dbff; }
.brigade-color-10 { color: #2f3b4f; background: #d5dde9; }

.brigade-color-btn {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.brigade-color-btn.is-active {
  border-color: #ffffff;
  box-shadow: 0 0 0 1px #274a73;
}

.brigade-manager-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(8, 18, 35, 0.42);
  padding: 14px;
}

.brigade-manager-dialog {
  position: absolute;
  width: min(620px, 96vw);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  border: 1px solid #224973;
  border-radius: 12px;
  background: linear-gradient(180deg, #132f52 0%, #0e2642 100%);
  box-shadow: 0 20px 48px rgba(5, 16, 33, 0.5);
  padding: 14px;
  resize: both;
  overflow: hidden;
}

.brigade-create-dialog {
  width: min(560px, 96vw);
}

.brigade-delete-dialog {
  width: min(720px, 98vw);
}

.brigade-manager-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  cursor: move;
}

.brigade-manager-head h3 {
  margin: 0;
  color: #f3f7ff;
  font-size: 14px;
}

.brigade-manager-close {
  border: 0;
  background: transparent;
  color: #d6e5fb;
  font-size: 20px;
  cursor: pointer;
}

.brigade-manager-add {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.brigade-manager-add-input,
.brigade-manager-name {
  flex: 1;
  min-height: 32px;
  border: 1px solid #3d5f86;
  border-radius: 8px;
  background: #f7f9fd;
  color: #1f3556;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
}

.brigade-manager-list {
  display: grid;
  gap: 8px;
}

.brigade-manager-list-wrap {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 54vh;
  overflow: auto;
  padding-right: 2px;
}

.brigade-delete-note {
  color: #d7e6ff;
  font-size: 12px;
  margin: 2px 0 10px;
}

.brigade-delete-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.brigade-delete-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.brigade-manager-color-title {
  color: #d7e6ff;
  font-size: 12px;
  margin: 4px 0 8px;
}

.brigade-manager-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.brigade-manager-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brigade-manager-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.brigade-manager-empty {
  color: #d7e6ff;
  font-size: 12px;
  padding: 10px;
  border: 1px dashed #3d5f86;
  border-radius: 8px;
}

.brigade-edit-dialog {
  width: min(640px, 96vw);
}

.brigade-edit-list {
  display: grid;
  gap: 8px;
}

.brigade-edit-item {
  border: 1px solid rgba(120, 150, 195, 0.25);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
}

.brigade-edit-item.is-open {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(120, 150, 195, 0.55);
}

.brigade-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brigade-edit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.brigade-edit-actions {
  display: inline-flex;
  gap: 6px;
}

.brigade-edit-tool-btn {
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid rgba(140, 170, 205, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8efff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.brigade-edit-tool-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.brigade-edit-tool-btn.is-danger {
  color: #ffc7c7;
  border-color: rgba(200, 130, 130, 0.55);
}

.brigade-edit-panel {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(140, 170, 205, 0.35);
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brigade-edit-panel.is-open {
  display: flex;
}

.brigade-edit-rename-input {
  flex: 1 1 200px;
  min-width: 180px;
}

.brigade-edit-remove-note {
  color: #ffd6d6;
  font-size: 12px;
  flex: 1 1 auto;
}

.brigade-edit-panel-cancel {
  border: 0;
  background: transparent;
  color: #a9bddb;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}

.brigade-edit-panel-cancel:hover {
  color: #e9f1ff;
}

.plan-pagination {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-top: 1px solid #c6d2df;
  background: #eef3f9;
}

.accounting-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 10px;
  border-top: 1px solid #c6d2df;
  background: #dfe6ef;
  color: #24374f;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}

.accounting-footer-left {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 210px;
}

.accounting-footer-label {
  text-transform: lowercase;
  color: #2c7a4b;
  min-width: 44px;
}

.accounting-footer-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.accounting-footer-item strong {
  color: #162536;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.accounting-footer-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.accounting-total-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.accounting-total-label {
  color: #2c7a4b;
  text-transform: lowercase;
}

.accounting-total-value {
  color: #162536;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.accounting-total-sep {
  color: #7d92ac;
  font-weight: 400;
  opacity: 0.7;
}

.accounting-total-grand {
  padding: 3px 10px;
  border-radius: 6px;
  background: #dbe6f5;
  border: 1px solid #a8bedd;
}

.accounting-total-grand .accounting-total-label {
  color: #1d4d8a;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.accounting-total-grand .accounting-total-value {
  color: #0f2b52;
  font-size: 17px;
}

.plan-page-btn {
  min-width: 20px;
  height: 18px;
  border: 1px solid #afbdcd;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff, #e5ebf2);
  color: #395271;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.plan-page-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.plan-page-meta {
  margin: 0 8px;
  color: #445d79;
  font-size: 11px;
  font-weight: 600;
}

.plan-status-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 132px;
  z-index: 8;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(17, 31, 56, 0.22);
  padding: 6px;
  display: none;
}

.plan-cell-wrap {
  position: relative;
}

.plan-cell-wrap.open {
  z-index: 21;
}

.plan-cell-button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.plan-cell-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-height: 220px;
  overflow: auto;
  z-index: 8;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(17, 31, 56, 0.22);
  padding: 6px;
  display: none;
}

.plan-cell-wrap.open .plan-cell-menu {
  display: grid;
  gap: 4px;
}

.plan-cell-option {
  min-height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 3px 8px;
  color: #1f3556;
  font-size: 11px;
}

.plan-cell-option:hover,
.plan-cell-option.is-active {
  background: #e7effb;
}

.plan-inline-editable {
  width: 100%;
  min-height: 16px;
  border: 0;
  background: transparent;
  padding: 0 3px;
  color: #1d3353;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: text;
}

.plan-inline-editable.is-empty {
  color: #9aa7b9;
}

.plan-inline-editable.is-editing {
  cursor: text;
}

.plan-inline-editor {
  width: 100%;
  min-height: 16px;
  border: 1px solid #9fb4cd;
  border-radius: 4px;
  background: #ffffff;
  color: #1d3353;
  font: inherit;
  font-size: 10px;
  padding: 0 4px;
  outline: none;
}

.plan-toast-host {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 120;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.plan-toast {
  min-width: 260px;
  max-width: 360px;
  border-radius: 10px;
  border: 1px solid rgba(140, 160, 190, 0.42);
  background: rgba(17, 34, 58, 0.96);
  color: #e9f1ff;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(8, 16, 31, 0.45);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.plan-toast.is-warn {
  border-color: rgba(232, 186, 110, 0.54);
  background: rgba(84, 57, 20, 0.96);
  color: #ffe6bb;
}

.plan-toast.is-error {
  border-color: rgba(211, 137, 154, 0.56);
  background: rgba(96, 42, 61, 0.96);
  color: #ffe3eb;
}

.plan-toast.is-leaving {
  opacity: 0;
  transform: translateY(5px);
}

.plan-status-wrap.open .plan-status-menu {
  display: grid;
  gap: 5px;
}

.plan-status-option {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

