.button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 6px; padding: 6px 11px; color: var(--text-primary); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); cursor: pointer; font-size: 12px; font-weight: 650; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.button:hover { text-decoration: none; }
.button:disabled { cursor: not-allowed; opacity: .56; }
.button-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-secondary { color: #334155; background: var(--surface); border-color: var(--border-strong); }
.button-secondary:hover { background: var(--surface-muted); }
.button-quiet { color: var(--text-secondary); background: transparent; border-color: transparent; }
.button-quiet:hover { color: var(--text-primary); background: var(--surface-muted); }
.button-ghost { min-height: 30px; color: var(--text-secondary); background: transparent; }
.button-danger-ghost { color: var(--danger); background: transparent; border-color: #efc4bf; }
.button-danger-ghost:hover { background: var(--danger-soft); }
.button-sm { min-height: 29px; padding: 4px 8px; font-size: 11px; }
.button-block { width: 100%; }

label { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 12px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 34px; padding: 6px 9px; color: var(--text-primary); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
textarea { resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: #a8b4c3; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .09); outline: 0; }
input::placeholder, textarea::placeholder { color: #98a3b3; }
.required { color: var(--danger); font-size: 10px; }
.field-error { display: block; margin-top: 4px; color: var(--danger); font-size: 11px; }
.help-text { margin: 5px 0 0; color: var(--text-muted); font-size: 11px; }

.table-wrap { max-width: 100%; overflow-x: auto; scrollbar-gutter: stable; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { height: 36px; padding: 7px 10px; color: #647187; background: #f7f9fb; border-bottom: 1px solid var(--border-strong); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .025em; white-space: nowrap; }
td { height: 43px; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
tbody tr:has(.is-selected) { background: var(--surface-selected); box-shadow: inset 3px 0 var(--accent); }
.table-empty { height: auto; padding: 38px 16px; color: var(--text-muted); text-align: center; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }

.status-pill, .github-state, .jira-state, .notion-state, .codex-state { display: inline-flex; min-height: 21px; align-items: center; width: fit-content; padding: 2px 7px; color: #536173; background: #f0f3f6; border: 1px solid #d8dfe7; border-radius: 999px; font-size: 10px; font-weight: 750; line-height: 1; white-space: nowrap; }
.status-DOING, .codex-state-RUNNING, .codex-state-TESTING, .codex-state-PREPARING, .codex-state-COMMITTING, .codex-state-PUSHING, .codex-state-CREATING_PR { color: var(--info); background: var(--info-soft); border-color: #bddbee; }
.status-REVIEW, .codex-state-QUEUED, .codex-state-CANCEL_REQUESTED { color: var(--warning); background: var(--warning-soft); border-color: #ead5ad; }
.status-DONE, .codex-state-SUCCEEDED, .github-state-CONNECTED, .github-state-OPEN, .jira-state-CONNECTED, .notion-state-CONNECTED, .notion-state-ACTIVE { color: var(--success); background: var(--success-soft); border-color: #bce0cf; }
.codex-state-FAILED, .codex-state-CANCELLED, .github-state-ERROR, .github-state-FAILED, .jira-state-ERROR, .notion-state-ERROR, .notion-state-ARCHIVED { color: var(--danger); background: var(--danger-soft); border-color: #ecc4bf; }
.github-state-MERGED { color: #6d3ba7; background: #f6effd; border-color: #dbc9ed; }
.github-state-NOT_TESTED, .github-state-DRAFT, .jira-state-NOT_TESTED, .notion-state-NOT_TESTED { color: var(--warning); background: var(--warning-soft); border-color: #ead5ad; }
.github-state-CLOSED, .github-state-NOT_CONFIGURED, .jira-state-NOT_CONFIGURED, .notion-state-NOT_CONFIGURED { color: var(--text-secondary); background: #f1f3f5; border-color: #d9dee5; }
.priority-text { color: var(--text-secondary); font-size: 11px; font-weight: 750; letter-spacing: .02em; }
.priority-high { color: var(--danger); }
.priority-low { color: var(--text-muted); }

.panel, .form-surface, .data-section, .project-index { min-width: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); }
.section-heading, .project-index-header { display: flex; min-height: 43px; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 12px; background: #f9fafc; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.section-heading h2 span { margin-left: 5px; color: var(--text-muted); font-size: 10px; }
.section-heading p, .project-index-header p { margin: 2px 0 0; color: var(--text-muted); font-size: 11px; }
.section-hint { color: var(--text-muted); font-size: 11px; }
.alert { padding: 9px 11px; margin-bottom: 12px; border: 1px solid; border-radius: var(--radius-md); }
.alert-success { color: #08623f; background: var(--success-soft); border-color: #bce0cf; }
.alert-error { color: #992a23; background: var(--danger-soft); border-color: #ecc4bf; }
.empty-state { padding: 28px 14px; color: var(--text-muted); background: #fafbfc; text-align: center; }
.toast { position: fixed; z-index: 100; right: 18px; bottom: 18px; max-width: min(390px, calc(100vw - 28px)); padding: 10px 12px; color: #fff; background: #263244; border-left: 3px solid #6ea0ff; border-radius: var(--radius-md); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .15s ease; }
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { background: #822e29; border-left-color: #f28f84; }

.stack-form { display: grid; gap: 16px; }
.task-form-sections { display: grid; }
.form-section { min-width: 0; padding: 0 0 20px; margin: 0 0 20px; border: 0; border-bottom: 1px solid var(--border); }
.form-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.form-section legend { width: 100%; padding: 0 0 12px; color: var(--text-primary); font-size: 14px; font-weight: 700; }
.form-section legend span { display: inline-grid; width: 20px; height: 20px; margin-right: 7px; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid #c8daf8; border-radius: var(--radius-sm); font-size: 10px; }
.form-grid, .integration-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.field-span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--border); }

@media (max-width: 680px) {
    .form-grid, .integration-settings { grid-template-columns: 1fr; }
    .field-span-2 { grid-column: auto; }
    .form-surface, .panel { padding: 14px; }
}
