:root {
  --bg: #141210;
  --panel: #1e1b17;
  --panel-2: #26221c;
  --line: #3d372f;
  --line-strong: #534c42;
  --text: #f6f1e8;
  --muted: #c4bbb0;
  --accent: #e2a355;
  --accent-dim: rgba(226, 163, 85, 0.18);
  --danger: #d36b5f;
  --ok: #8fbf86;
  --info: #7eb8da;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color-scheme: dark;
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(226, 163, 85, 0.10), transparent 46%),
    var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 28px 72px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  letter-spacing: 0.16em;
  font-size: 11px;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 28px; letter-spacing: -0.03em; }
h2 { font-size: 20px; }

.lede, .panel-head p, .muted { color: var(--muted); line-height: 1.6; }
.panel-head p { margin: 8px 0 0; max-width: 46em; }

.auth-body {
  display: grid;
  place-items: center;
  max-width: none;
  min-height: 100vh;
  padding: 24px;
}

.auth-card, .panel, .stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-card { width: min(420px, 100%); padding: 36px; }
.auth-card h1 { margin-bottom: 10px; }
.auth-card .lede { margin: 0 0 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.btn-feishu {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 44px; padding: 11px 16px;
  border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--panel-2); color: var(--text);
  text-decoration: none; font-weight: 650;
}
.btn-feishu:hover { background: rgba(255, 255, 255, 0.04); }

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

input, select, textarea, button { font: inherit; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
}

textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

button {
  border: 0; border-radius: 12px;
  background: var(--accent); color: #1a140c;
  font-weight: 650; padding: 11px 16px; min-height: 44px;
  cursor: pointer;
}
button:hover { filter: brightness(1.06); }
button.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-strong);
}
button.ghost:hover { background: rgba(255, 255, 255, 0.04); filter: none; }
button.danger {
  background: transparent;
  color: #f0b8b2;
  border: 1px solid rgba(211, 107, 95, 0.55);
}
button.danger:hover { background: rgba(211, 107, 95, 0.14); filter: none; }
button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

.banner {
  padding: 10px 12px; border-radius: 10px; margin: 16px 0;
}
.banner.error { background: rgba(211, 107, 95, 0.16); color: #f0b8b2; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; min-height: 64px; margin-bottom: 24px;
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  text-decoration: none; font-weight: 650;
}
.tab.is-active {
  background: var(--accent-dim); color: var(--accent); border-color: transparent;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab.is-active:hover { background: var(--accent-dim); color: var(--accent); }

.subtabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 0 0 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.subtab {
  display: inline-flex; align-items: center;
  min-height: 34px; padding: 0 12px;
  border-radius: 10px; color: var(--muted);
  text-decoration: none; font-size: 14px; font-weight: 600;
}
.subtab.is-active {
  background: rgba(255, 255, 255, 0.06); color: var(--text);
}
.subtab:hover { color: var(--text); }

.settings-block { margin-top: 4px; }
.slug-chip {
  display: inline-block; padding: 4px 8px;
  border-radius: 8px; border: 1px solid var(--line);
  background: #141210; color: #f0d2a6;
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button {
  padding: 7px 12px; font-size: 13px; min-height: 34px;
}
.field-hint {
  margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5;
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 14px;
}
.user-chip img {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line);
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat { padding: 18px 20px; min-height: 96px; }
.stat b {
  display: block; font-size: 26px; letter-spacing: -0.03em;
  margin-top: 8px; font-variant-numeric: tabular-nums;
}
.stat span { color: var(--muted); font-size: 13px; }

.panel { padding: 24px; margin-bottom: 20px; }
.panel-head { margin-bottom: 20px; }

.issue-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.filters {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 20px;
}
.filters input, .filters select { width: auto; flex: 1; min-width: 120px; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left; padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px; vertical-align: middle;
}
th {
  color: var(--muted); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; background: #181511;
}
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(226, 163, 85, 0.06); }
tr.clickable { cursor: pointer; }

.issue-no {
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; color: #f0d2a6;
}

.pill {
  display: inline-block; padding: 4px 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.pill.pending { background: rgba(126, 184, 218, 0.16); color: var(--info); }
.pill.confirmed { background: var(--accent-dim); color: var(--accent); }
.pill.in_progress { background: rgba(226, 163, 85, 0.22); color: #f0d2a6; }
.pill.resolved, .pill.closed { background: rgba(143, 191, 134, 0.16); color: var(--ok); }
.pill.wont_fix { background: rgba(211, 107, 95, 0.16); color: #f0b8b2; }

.pill.priority-low { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.pill.priority-medium { background: var(--accent-dim); color: var(--accent); }
.pill.priority-high { background: rgba(226, 163, 85, 0.28); color: #f0d2a6; }
.pill.priority-urgent { background: rgba(211, 107, 95, 0.20); color: #f0b8b2; }

.pager {
  display: flex; gap: 12px; align-items: center;
  justify-content: flex-end; margin-top: 16px; color: var(--muted);
}
.pager button {
  min-height: 36px; background: transparent;
  color: var(--text); border: 1px solid var(--line-strong);
}
.pager a { color: var(--accent); text-decoration: none; }

.detail-grid {
  display: grid; grid-template-columns: 1fr 320px; gap: 20px;
}
.detail-meta {
  padding: 20px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 14px;
}
.detail-meta dl { margin: 0; }
.detail-meta dt {
  color: var(--muted); font-size: 12px;
  margin-top: 14px; margin-bottom: 4px;
}
.detail-meta dt:first-child { margin-top: 0; }
.detail-meta dd { margin: 0; font-size: 14px; }

.description-box {
  line-height: 1.7;
  padding: 16px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 12px;
  margin-top: 12px;
}
.description-box:not(.rich-content),
.comment-body:not(.rich-content) {
  white-space: pre-wrap;
}

.rich-content { white-space: normal; word-break: break-word; }
.rich-content p { margin: 0 0 0.75em; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content ul, .rich-content ol { margin: 0.4em 0 0.8em; padding-left: 1.4em; }
.rich-content blockquote {
  margin: 0.6em 0;
  padding: 0.4em 0.8em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}
.rich-content pre, .rich-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
.rich-content pre {
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}
.rich-content a { color: var(--accent); }
.rich-content img {
  display: block;
  max-width: min(100%, 720px);
  height: auto;
  margin: 10px 0;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.comments { margin-top: 24px; }
.comment {
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px;
}
.comment.internal {
  border-color: rgba(211, 107, 95, 0.35);
  background: rgba(211, 107, 95, 0.06);
}
.comment-head {
  display: flex; justify-content: space-between; gap: 12px;
  margin-bottom: 8px; font-size: 13px; color: var(--muted);
}
.comment-body { line-height: 1.6; }

.comment-form { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.inline-form { display: flex; flex-direction: column; gap: 12px; }

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
}
.check-row:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.035); }
.check-row:has(input:focus-visible) {
  border-color: rgba(226, 163, 85, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.check-row:has(input:checked) {
  border-color: rgba(226, 163, 85, 0.4);
  background: var(--accent-dim);
  color: var(--text);
}
.check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  display: grid;
  place-content: center;
  cursor: pointer;
}
.check-row input[type="checkbox"]::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  transition: transform 0.12s ease;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
  background: #1a140c;
}
.check-row input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}
.check-row input[type="checkbox"]:checked::before { transform: scale(1); }
.check-row input[type="checkbox"]:focus { outline: none; box-shadow: none; }

/* Quill rich editor */
.rich-editor {
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  border-radius: 12px;
  overflow: hidden;
}
.rich-editor:focus-within {
  border-color: rgba(226, 163, 85, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.rich-editor-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  min-height: 0 !important;
}
.rich-editor .ql-toolbar.ql-snow,
.rich-editor-toolbar.ql-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  padding: 8px 10px;
}
.rich-editor .ql-toolbar.ql-snow .ql-formats {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 0;
  padding-right: 8px;
  margin-right: 2px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.rich-editor .ql-toolbar.ql-snow .ql-formats:last-child {
  border-right: 0;
  padding-right: 0;
  margin-right: 0;
}
.rich-editor .ql-snow.ql-toolbar button {
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 0;
  background: transparent;
  float: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.rich-editor .ql-snow.ql-toolbar button:hover {
  background: rgba(255, 255, 255, 0.06);
}
.rich-editor .ql-snow.ql-toolbar button:focus-visible {
  outline: 2px solid rgba(226, 163, 85, 0.45);
  outline-offset: 1px;
}
.rich-editor .ql-snow.ql-toolbar button.ql-active {
  background: var(--accent-dim);
}
.rich-editor .ql-snow.ql-toolbar button svg {
  width: 16px;
  height: 16px;
  float: none;
}
.rich-editor .ql-snow .ql-stroke {
  stroke: #b7aea3;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rich-editor .ql-snow .ql-thin { stroke-width: 1.2; }
.rich-editor .ql-snow .ql-fill { fill: #b7aea3; }
.rich-editor .ql-snow .ql-stroke.ql-thin { stroke: #b7aea3; }
.rich-editor .ql-snow .ql-even { stroke: #b7aea3; }
.rich-editor .ql-snow.ql-toolbar button:hover .ql-stroke,
.rich-editor .ql-snow.ql-toolbar button.ql-active .ql-stroke,
.rich-editor .ql-snow.ql-toolbar button:hover .ql-stroke.ql-thin,
.rich-editor .ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-thin,
.rich-editor .ql-snow.ql-toolbar button:hover .ql-even,
.rich-editor .ql-snow.ql-toolbar button.ql-active .ql-even {
  stroke: var(--accent);
}
.rich-editor .ql-snow.ql-toolbar button:hover .ql-fill,
.rich-editor .ql-snow.ql-toolbar button.ql-active .ql-fill {
  fill: var(--accent);
}
.rich-editor .ql-container.ql-snow {
  border: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}
.rich-editor .ql-editor {
  min-height: 180px;
  line-height: 1.65;
  padding: 14px 16px;
}
.rich-editor .ql-editor.ql-blank::before {
  color: rgba(196, 187, 176, 0.72);
  font-style: normal;
  left: 16px;
  right: 16px;
}
.rich-editor .ql-snow .ql-tooltip {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
}
.rich-editor .ql-snow .ql-tooltip input[type="text"] {
  min-height: 34px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.rich-editor .ql-snow .ql-tooltip a.ql-action::after,
.rich-editor .ql-snow .ql-tooltip a.ql-remove::before {
  color: var(--accent);
}
.rich-editor .ql-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.rich-editor .ql-editor img.is-uploading { opacity: 0.55; }
.rich-editor-hint {
  margin: 0;
  padding: 8px 14px 11px;
  font-size: 12px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}
.editor-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: #2a241c;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}
.editor-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.editor-toast.is-error {
  border-color: rgba(211, 107, 95, 0.55);
  color: #f0b8b2;
}

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 14px;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--accent); }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
.issue-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.issue-stack > input[type="text"],
.issue-stack > input:not([type="hidden"]) {
  width: 100%;
}
.issue-footer {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}
.selection-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.selection-bar.is-empty .selection-chips {
  display: none;
}
.selection-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 20px;
}
.selection-count {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.selection-count.has-items {
  color: var(--text);
  font-weight: 500;
}
.selection-clear {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.selection-clear:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  filter: none;
}
#admin-submit,
#person-submit {
  flex: 0 0 auto;
  width: auto;
  min-height: 40px;
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
  white-space: nowrap;
}
.org-panel.is-search-mode {
  min-height: 160px;
}
.org-panel.is-search-mode .org-tree {
  display: none !important;
}
.org-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  min-height: 240px;
  max-height: 320px;
  overflow: hidden;
}
.org-status {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
}

#org-status-text {
  flex: 1;
  min-width: 0;
}

.org-sync-btn {
  min-height: 30px;
  padding: 0 12px;
  background: transparent !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--text) !important;
  font-size: 12px;
  font-weight: 600;
}

.org-sync-btn:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  display: inline-block;
  vertical-align: -2px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.org-loading-row {
  padding: 8px 12px 8px calc(28px + var(--depth, 0) * 18px);
  color: var(--muted);
  font-size: 13px;
}
.org-tree {
  max-height: 260px;
  overflow-y: auto;
  padding: 8px 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.org-node {
  user-select: none;
}
.org-dept {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 12px 6px calc(12px + var(--depth, 0) * 16px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  filter: none;
}
.org-dept:hover {
  background: rgba(255, 255, 255, 0.04);
  filter: none;
}
.org-dept-icon {
  width: 16px;
  color: var(--muted);
  flex-shrink: 0;
  font-size: 10px;
  text-align: center;
}
.org-dept-name { font-weight: 600; }
.org-dept-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.org-employee {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 6px 14px 6px calc(10px + var(--depth, 0) * 16px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 400;
  cursor: pointer;
  filter: none;
  transition: background 0.12s ease;
}
.org-employee:hover {
  background: rgba(255, 255, 255, 0.04);
  filter: none;
}
.org-employee.is-selected {
  background: rgba(226, 163, 85, 0.10);
}
.org-employee-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.18);
  position: relative;
  flex-shrink: 0;
}
.org-employee.is-selected .org-employee-check {
  border-color: var(--accent);
  background: var(--accent);
}
.org-employee.is-selected .org-employee-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #1a140c;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.org-employee-body {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.org-employee-name {
  font-size: 14px;
  font-weight: 500;
}
.org-employee-meta {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.selection-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 68px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.selection-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 3px 4px 3px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.35;
}
.selection-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selection-chip-remove {
  flex-shrink: 0;
  min-height: 22px;
  width: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  filter: none;
}
.selection-chip-remove:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  filter: none;
}
.employee-options {
  position: static;
  max-height: 360px;
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overscroll-behavior: contain;
}
.employee-options li {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}
.employee-options li .employee-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.18);
  position: relative;
}
.employee-options li.is-selected .employee-check {
  border-color: var(--accent);
  background: var(--accent);
}
.employee-options li.is-selected .employee-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #1a140c;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.employee-options li .employee-row-body {
  min-width: 0;
}
.employee-options li:hover,
.employee-options li.is-selected {
  background: rgba(226, 163, 85, 0.10);
}
.employee-options li.is-active {
  background: rgba(226, 163, 85, 0.10);
}
.employee-options .employee-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.employee-options .employee-empty {
  display: block;
  cursor: default;
  color: var(--muted);
  text-align: center;
  padding: 24px 12px;
}

.is-hidden { display: none !important; }
.is-hidden { display: none !important; }
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  display: inline-block;
  vertical-align: -2px;
}

.toast-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toast-in 0.22s ease;
}
.toast.is-leaving {
  animation: toast-out 0.2s ease forwards;
}
.toast-error {
  border-color: rgba(211, 107, 95, 0.55);
  background: #2a201e;
}
.toast-success {
  border-color: rgba(143, 191, 134, 0.45);
  background: #1e241c;
}
.toast-message {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.toast-close {
  flex-shrink: 0;
  min-height: 24px;
  width: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  filter: none;
}
.toast-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-6px); }
}

dialog {
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  max-width: calc(100vw - 32px);
}
dialog::backdrop {
  background: rgba(8, 7, 6, 0.72);
  backdrop-filter: blur(2px);
}
.dialog-card {
  margin: 0;
  padding: 0;
  width: min(440px, 92vw);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}
.dialog-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
button.dialog-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  filter: none;
}
button.dialog-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  filter: none;
}
.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 8px;
}
.dialog-body label {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.dialog-body label:first-of-type { margin-top: 0; }
.dialog-body .field-hint {
  margin: 4px 0 0;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 20px 20px;
}
.dialog-actions button {
  min-height: 40px;
  padding: 0 16px;
}
.dialog-actions .ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.dialog-actions .ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  filter: none;
}
.confirm-dialog .dialog-body,
.confirm-dialog > h3 {
  padding-left: 20px;
  padding-right: 20px;
}
.confirm-dialog > h3 {
  margin: 0;
  padding-top: 20px;
  font-size: 18px;
}
.confirm-dialog > p {
  margin: 10px 20px 0;
  color: var(--muted);
  line-height: 1.55;
}
.confirm-dialog .dialog-actions {
  margin-top: 8px;
}

