/* Issue Central Widget — GeneralBlue.Central.Razor */

.issue-central-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: .9375rem;
    line-height: 1.5;
    color: #1a1a1a;
}

/* ===== Host layout ===== */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1.5rem;
    background: #1e293b;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 30;
}

.site-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.site-header-brand {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

.site-header-right {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.site-header-link {
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
}

.site-header-link:hover,
.site-header-link.active {
    color: #bfdbfe;
}

.site-content {
    min-width: 0;
    padding: 1.5rem;
}

/* ===== Buttons ===== */
.issue-central-btn {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .4375rem .875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: .8125rem;
    cursor: pointer;
    transition: background .12s, border-color .12s, box-shadow .12s;
}

.issue-central-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.issue-central-btn-enhance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.issue-central-btn-enhance .ic-enhance-icon {
    flex: 0 0 auto;
}

.issue-central-btn-enhance[disabled] {
    opacity: .6;
    cursor: default;
}

.issue-central-btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    padding: .5rem 1.25rem;
    font-size: .875rem;
    font-weight: 500;
}

.issue-central-btn-primary:hover {
    background: #1d4ed8;
    border-color: #1e40af;
}

.issue-central-btn-primary:disabled,
.issue-central-btn-primary[disabled] {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.issue-central-btn-primary:disabled:hover,
.issue-central-btn-primary[disabled]:hover {
    background: #e5e7eb;
    border-color: #e5e7eb;
}

.issue-central-btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    padding: .25rem;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 6px;
    transition: color .12s, background .12s;
}

.issue-central-btn-close:hover {
    color: #374151;
    background: #f3f4f6;
}

/* ===== Modal — native <dialog>; override UA defaults ===== */
.issue-central-modal {
    width: min(1280px, calc(100vw - 48px));
    max-width: none;
    max-height: calc(100vh - 48px);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, .25), 0 0 0 1px rgba(0, 0, 0, .03);
    overflow: hidden;
}

.issue-central-modal::backdrop {
    background: rgba(15, 23, 42, .40);
}

.issue-central-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .40);
}

.issue-central-modal-backdrop .issue-central-modal {
    display: flex;
    flex-direction: column;
    margin: 0;
    height: min(760px, calc(100vh - 48px));
}

.issue-central-modal-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    background: #fff;
}

.issue-central-error-visible {
    display: block;
}

.issue-central-form-footer-hint {
    min-height: 1.25rem;
    color: #6b7280;
    font-size: .8125rem;
}

.ic-captures-btn input[type="file"] {
    display: none;
}

.ci-multi-filter {
    position: relative;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

.ci-multi-filter-trigger {
    width: 100%;
    min-height: 2.1875rem;
    display: flex;
    align-items: center;
    gap: .375rem;
    padding: .25rem .5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}

.ci-multi-filter-trigger:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.ci-multi-filter-chips {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .25rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.ci-multi-filter-placeholder {
    font-size: .875rem;
    color: #6b7280;
}

.ci-multi-filter-chip {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: .125rem .5rem;
    border: 1px solid var(--ci-token-border, #cbd5e1);
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--ci-token-text, #334155);
    background: var(--ci-token-bg, #e2e8f0);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ci-multi-filter-menu {
    position: absolute;
    top: calc(100% + .375rem);
    left: 0;
    z-index: 20;
    width: 100%;
    min-width: 100%;
    max-height: 260px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: .375rem;
    border: 1px solid #d8dee8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .12), 0 3px 10px rgba(15, 23, 42, .08);
}

.ci-multi-filter-menu[hidden] {
    display: none;
}

.ci-multi-filter-option {
    display: flex;
    align-items: center;
    width: 100%;
    gap: .625rem;
    min-height: 2.125rem;
    padding: .4375rem .625rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: .8125rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--ci-token-text, #1e293b);
    cursor: pointer;
    text-align: left;
    user-select: none;
    outline: none;
    transition: background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.ci-multi-filter-option:hover {
    background: #f6f8fb;
}

.ci-multi-filter-option:active {
    background: #edf2f7;
}

.ci-multi-filter-option:focus-visible {
    box-shadow: 0 0 0 2px #93c5fd;
}

.ci-multi-filter-option.ci-option-selected {
    background: var(--ci-token-selected-bg, #eef6ff);
}

.ci-multi-filter-option.ci-option-selected:hover {
    background: var(--ci-token-selected-hover-bg, #e4effc);
}

.ci-multi-filter-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--ci-token-swatch, #2563eb);
    cursor: pointer;
    pointer-events: none;
}

.ci-option-swatch {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 1px solid var(--ci-token-swatch-border, rgba(15, 23, 42, .16));
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--ci-token-swatch, #64748b);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.ci-option-label {
    flex: 1;
    line-height: 1.3;
}

.ci-option-all-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    min-width: 2rem;
    height: 1.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.ci-multi-filter-option-all.ci-option-selected {
    background: #f1f5f9;
}

/* ===== Header (draggable) ===== */
.issue-central-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    user-select: none;
    cursor: grab;
}

.issue-central-form-header:active {
    cursor: grabbing;
}

.issue-central-form-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: -.01em;
}

/* ===== Form ===== */
.issue-central-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0;
}

.issue-central-form label {
    display: block;
    font-weight: 500;
    margin-bottom: .25rem;
    font-size: .8125rem;
    color: #4b5563;
}

.issue-central-form input[type="text"],
.issue-central-form textarea,
.issue-central-form select {
    width: 100%;
    padding: .4375rem .625rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .8125rem;
    font-family: inherit;
    box-sizing: border-box;
    color: #111827;
    background: #fff;
    transition: border-color .12s, box-shadow .12s;
}

.issue-central-form input[type="text"]:focus,
.issue-central-form textarea:focus,
.issue-central-form select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.issue-central-form select.ic-semantic-select {
    color: var(--ci-token-text, #111827);
    background-color: var(--ci-token-bg, #fff);
    border-color: var(--ci-token-border, #d1d5db);
    box-shadow: inset 0 0 0 1px var(--ci-token-ring, transparent);
    font-weight: 600;
}

.issue-central-form select.ic-semantic-select:focus {
    border-color: var(--ci-token-swatch-border, #2563eb);
    box-shadow: 0 0 0 2px var(--ci-token-ring, rgba(37, 99, 235, .12));
}

.issue-central-form select.ic-semantic-select.ic-severity-none {
    color: #6b7280;
    background-color: #fff;
    border-color: #d1d5db;
    box-shadow: none;
    font-weight: 400;
}

.ic-fields {
    display: grid;
    gap: .625rem;
}

/* ===== Body: form+preview left, captures right ===== */
.issue-central-body-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.issue-central-form-panel {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1rem 1.5rem;
    min-width: 0;
    overflow-y: auto;
}

.issue-central-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .625rem;
}

.ic-enhance-panel {
    margin: 12px 1.5rem 0;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.ic-enhance-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 12px;
}

.ic-enhance-questions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ic-enhance-question {
    border: 0;
    margin: 0;
    padding: 0;
}

.ic-enhance-question legend {
    font-weight: 600;
    margin-bottom: 6px;
    padding: 0;
}

.ic-enhance-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
}

.ic-enhance-other-text {
    display: block;
    width: 100%;
    margin-top: 6px;
}

.ic-enhance-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.ic-enhance-progress {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: #4b5563;
    font-size: .8125rem;
}

.ic-enhance-spinner {
    width: .875rem;
    height: .875rem;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ic-enhance-spin .7s linear infinite;
}

@keyframes ic-enhance-spin {
    to { transform: rotate(360deg); }
}

/* ===== Question step replaces the body (header + footer remain) ===== */
.issue-central-form.is-questions-active .issue-central-body-layout {
    display: none;
}

.issue-central-form.is-questions-active .issue-central-form-footer {
    display: none;
}

.issue-central-form.is-questions-active .ic-enhance-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
}

/* Only the question list scrolls; the panel header and Skip/Submit actions stay pinned. */
.issue-central-form.is-questions-active .ic-enhance-questions {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
}

.ic-enhance-summary {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.ic-enhance-summary-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-bottom: 8px;
}

.ic-enhance-summary-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
    align-items: start;
    font-size: .8125rem;
    line-height: 1.45;
}

.ic-enhance-summary-row + .ic-enhance-summary-row {
    margin-top: 6px;
}

.ic-enhance-summary-label {
    font-weight: 600;
    color: #6b7280;
}

.ic-enhance-summary-value {
    color: #111827;
    word-break: break-word;
}

/* ===== Large preview area ===== */
.ic-preview {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 180px;
}

.ic-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 .5rem;
}

.ic-preview-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
    padding: 0;
}

.ic-preview-nav:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.ic-preview-nav:disabled {
    opacity: .3;
    cursor: default;
}

.ic-preview-indicator {
    font-size: .75rem;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.ic-preview-surface {
    flex: 1;
    min-height: 140px;
    background: #1e293b;
    border: 1px solid transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: background .12s, border-color .12s, box-shadow .12s;
}

.ic-preview-surface.ic-preview-surface-empty {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.ic-preview-surface.ic-preview-drop-active {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .2);
}

.ic-preview-surface img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.ic-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    color: #64748b;
    opacity: .9;
}

.ic-preview-empty svg {
    opacity: .72;
}

.ic-preview-empty span {
    font-size: .75rem;
    color: #7c8ba1;
}

/* ===== Problem-nature classifications ===== */
.ic-classifications-field {
    display: grid;
    gap: .375rem;
}

.ic-classifications {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

.ic-classification-chip {
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: .75rem;
    font-weight: 500;
    padding: .25rem .625rem;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}

.ic-classification-chip:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ic-classification-chip.is-selected {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.ic-classification-chip.is-disabled {
    opacity: .45;
    cursor: default;
}

.ic-classification-chip.is-disabled:hover {
    background: #fff;
    border-color: #d1d5db;
}

/* ===== Active-image source + note ===== */
.ic-active-image {
    display: grid;
    grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
    gap: .5rem;
    margin-top: .5rem;
}

.ic-active-image-field {
    display: grid;
    gap: .25rem;
    min-width: 0;
}

.ic-active-image-field label {
    font-size: .6875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .02em;
}

/* ===== Right captures panel ===== */
.ic-captures-panel {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: #fff;
    border-left: 1px solid #f3f4f6;
    min-height: 0;
    overflow-y: auto;
}

.ic-captures-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}

.ic-captures-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.ic-captures-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-size: .6875rem;
    font-weight: 600;
}

.ic-captures-subtitle {
    font-size: .8125rem;
    color: #6b7280;
    margin: 0 0 1rem;
    line-height: 1.4;
}

.ic-captures-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .625rem .875rem;
    font-size: .8125rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    margin-bottom: .5rem;
    text-align: left;
}

.ic-captures-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.ic-captures-btn.ic-captures-btn-done {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.ic-captures-btn.ic-captures-btn-done:hover {
    background: #d1fae5;
    border-color: #34d399;
}

.ic-captures-grid {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: .5rem;
    overflow-y: auto;
    flex: 1;
}

/* Capture card */
.ic-capture-card {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .12s, box-shadow .12s;
}

.ic-capture-card:hover {
    border-color: #d1d5db;
}

.ic-capture-card.ic-capture-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.ic-capture-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #f3f4f6;
}

.ic-capture-card-info {
    padding: .5rem .75rem;
}

.ic-capture-card-title {
    font-size: .8125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.ic-capture-card-filename {
    font-size: .75rem;
    color: #6b7280;
    margin: .125rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ic-capture-card-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #ef4444;
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: background .12s;
}

.ic-capture-card-remove:hover {
    background: #dc2626;
}

/* ===== Footer ===== */
.issue-central-form-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: .875rem 1.5rem 1.25rem;
    border-top: 1px solid #f3f4f6;
}

.issue-central-form-footer-model {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 0;
}

.issue-central-form-footer-model[hidden] {
    display: none;
}

.issue-central-form-footer-model label {
    font-size: .75rem;
    font-weight: 600;
    color: #6b7280;
}

.issue-central-form-footer-model select {
    min-width: 11rem;
}

.issue-central-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

/* ===== Error ===== */
.issue-central-error {
    display: none;
    color: #b91c1c;
    font-size: .8125rem;
    padding: .375rem .625rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

/* ===== Issue list ===== */
.issue-central-empty {
    display: none;
    margin-top: 1rem;
    color: #6b7280;
    font-size: .875rem;
}

.issue-central-list {
    margin-top: 1rem;
    display: none;
    gap: .625rem;
}

.issue-central-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .875rem;
    background: #fff;
    transition: box-shadow .12s;
}

.issue-central-card:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}

.issue-central-card-header {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
}

.issue-central-card-summary {
    font-weight: 600;
    color: #111827;
}

.issue-central-card-status {
    color: #6b7280;
    white-space: nowrap;
    font-size: .8125rem;
}

.issue-central-card-meta {
    font-size: .8125rem;
    color: #6b7280;
    margin-top: .25rem;
}

.issue-central-card-details {
    margin-top: .375rem;
    font-size: .8125rem;
    color: #374151;
}

.issue-central-card-id {
    margin-top: .375rem;
    font-size: .75rem;
    color: #9ca3af;
}

/* ===== Launcher icon ===== */
.issue-central-launcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: inherit;
    cursor: pointer;
    transition: background .15s;
}

.issue-central-launcher-icon:hover {
    background: rgba(255, 255, 255, .2);
}

.issue-central-list-page {
    margin-top: 1.5rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .issue-central-modal {
        width: calc(100vw - 24px);
        max-width: none;
    }

    .issue-central-body-layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .ic-captures-panel {
        border-left: none;
        border-top: 1px solid #f3f4f6;
    }
}

/* ===== Issue Center list page ===== */
.ci-issues {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
    width: 100%;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

.ci-issues-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ci-issues-title {
    font-size: 1.5rem;
    font-weight: 650;
    margin: 0;
}

.ci-issues-subtitle {
    margin: .25rem 0 0;
    color: #6b7280;
    font-size: .875rem;
}

.ci-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.ci-filter-field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.ci-filter-grow {
    flex: 1 1 220px;
}

.ci-filter-field label {
    font-size: .75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.ci-filter-field input,
.ci-filter-field select {
    padding: .4375rem .625rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .875rem;
    background: #fff;
}

.ci-filter-actions {
    display: flex;
    gap: .5rem;
}

.ci-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .625rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.ci-bulk-count {
    font-weight: 600;
    font-size: .875rem;
    color: #1d4ed8;
}

.ci-bulk-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.ci-bulk-actions .issue-central-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.ci-bulk-actions .issue-central-btn:disabled:hover {
    background: #fff;
    border-color: #d1d5db;
}

.ci-bulk-actions .issue-central-btn-primary:disabled:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.ci-toggle {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .8125rem;
    color: #374151;
    cursor: pointer;
}

.ci-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow-x: auto;
}

.ci-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.ci-table thead th {
    text-align: left;
    padding: .625rem .75rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
    white-space: nowrap;
}

.ci-table thead th a {
    color: inherit;
    text-decoration: none;
}

.ci-table thead th a:hover {
    color: #2563eb;
}

.ci-sort-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.ci-sort-button:hover {
    color: #2563eb;
}

.ci-table tbody td {
    padding: .625rem .75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.ci-table tbody tr:hover {
    background: #f9fafb;
}

.ci-col-check {
    width: 36px;
}

.ci-col-type {
    width: 72px;
}
.ci-col-status{
    width:120px;
}
.ci-col-created,
.ci-col-updated {
    width: 150px;
}

.ci-col-actions {
    width: 80px;
    text-align: right;
}

.ci-cell-summary {
    max-width: 320px;
}

.ci-summary-text {
    font-weight: 500;
    color: inherit;
    text-decoration: none;
}

.ci-summary-text:hover {
    text-decoration: underline;
    color: #2563eb;
}

.ci-cell-page {
    min-width: 190px;
    max-width: 260px;
    color: #6b7280;
}

.ci-cell-page a {
    color: #2563eb;
    text-decoration: none;
}

.ci-cell-page a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.ci-cell-page-title,
.ci-cell-page-url {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}

.ci-cell-page-title {
    display: block;
}

.ci-cell-page-url {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    max-width: 100%;
    margin-top: .125rem;
    color: #2563eb;
    font-size: .8125rem;
}

.ci-cell-page-url-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ci-cell-page-url-icon {
    width: .875rem;
    height: .875rem;
    flex: 0 0 auto;
    color: #64748b;
}

.ci-cell-page-url:hover .ci-cell-page-url-icon {
    color: #1d4ed8;
}

.ci-cell-page-title {
    color: #111827;
    font-weight: 500;
}

.ci-cell-stacked-meta {
    min-width: 116px;
    white-space: normal;
}

.ci-cell-meta-user,
.ci-cell-meta-date {
    display: block;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.ci-cell-meta-user {
    color: #111827;
    font-weight: 500;
}

.ci-cell-meta-date {
    margin-top: .125rem;
    color: #6b7280;
    font-size: .8125rem;
}

.ci-attach {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    margin-left: .5rem;
    font-size: .75rem;
    color: #6b7280;
}

.ci-col-ai-cost {
    min-width: 110px;
    white-space: normal;
}

.ci-table tbody td.ci-col-ai-cost {
    vertical-align: top;
}

.ci-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

.ci-btn-sm {
    padding: .25rem .625rem;
    font-size: .75rem;
}

.ci-badge {
    display: inline-flex;
    align-items: center;
    padding: .25rem .75rem;
    border: 1px solid var(--ci-token-border, #cbd5e1);
    border-radius: 9999px;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.25rem;
    letter-spacing: .01em;
    white-space: nowrap;
    color: var(--ci-token-text, #334155);
    background: var(--ci-token-bg, #e2e8f0);
    box-shadow: inset 0 0 0 1px var(--ci-token-ring, transparent), 0 1px 2px 0 rgba(15, 23, 42, .06);
}

.ci-badge-type {
    color: var(--ci-token-text, #334155);
    background: var(--ci-token-bg, #e2e8f0);
}

.ci-type-bug {
    --ci-token-bg: #fef2f2;
    --ci-token-text: #b91c1c;
    --ci-token-swatch: #ef4444;
    --ci-token-border: #fecaca;
    --ci-token-swatch-border: #dc2626;
    --ci-token-selected-bg: #fef2f2;
    --ci-token-selected-hover-bg: #fee2e2;
    --ci-token-ring: #fee2e2;
}

.ci-type-enhancement {
    --ci-token-bg: #eff6ff;
    --ci-token-text: #1d4ed8;
    --ci-token-swatch: #3b82f6;
    --ci-token-border: #bfdbfe;
    --ci-token-swatch-border: #2563eb;
    --ci-token-selected-bg: #eff6ff;
    --ci-token-selected-hover-bg: #dbeafe;
    --ci-token-ring: #dbeafe;
}

.ci-type-question {
    --ci-token-bg: #f5f3ff;
    --ci-token-text: #6d28d9;
    --ci-token-swatch: #8b5cf6;
    --ci-token-border: #ddd6fe;
    --ci-token-swatch-border: #7c3aed;
    --ci-token-selected-bg: #f5f3ff;
    --ci-token-selected-hover-bg: #ede9fe;
    --ci-token-ring: #ede9fe;
}

.ci-type-task {
    --ci-token-bg: #f8fafc;
    --ci-token-text: #334155;
    --ci-token-swatch: #64748b;
    --ci-token-border: #cbd5e1;
    --ci-token-swatch-border: #475569;
    --ci-token-selected-bg: #f8fafc;
    --ci-token-selected-hover-bg: #f1f5f9;
    --ci-token-ring: #f1f5f9;
}

.ci-status-new {
    --ci-token-bg: #f0f9ff;
    --ci-token-text: #0369a1;
    --ci-token-swatch: #0ea5e9;
    --ci-token-border: #bae6fd;
    --ci-token-swatch-border: #0284c7;
    --ci-token-selected-bg: #f0f9ff;
    --ci-token-selected-hover-bg: #e0f2fe;
    --ci-token-ring: #e0f2fe;
}

.ci-status-in-review {
    --ci-token-bg: #fffbeb;
    --ci-token-text: #b45309;
    --ci-token-swatch: #f59e0b;
    --ci-token-border: #fcd34d;
    --ci-token-swatch-border: #d97706;
    --ci-token-selected-bg: #fffbeb;
    --ci-token-selected-hover-bg: #fef3c7;
    --ci-token-ring: #fef3c7;
}

.ci-status-under-development {
    --ci-token-bg: #eef2ff;
    --ci-token-text: #4338ca;
    --ci-token-swatch: #6366f1;
    --ci-token-border: #c7d2fe;
    --ci-token-swatch-border: #4f46e5;
    --ci-token-selected-bg: #eef2ff;
    --ci-token-selected-hover-bg: #e0e7ff;
    --ci-token-ring: #e0e7ff;
}

.ci-status-ready-for-testing {
    --ci-token-bg: #ecfeff;
    --ci-token-text: #0e7490;
    --ci-token-swatch: #06b6d4;
    --ci-token-border: #a5f3fc;
    --ci-token-swatch-border: #0891b2;
    --ci-token-selected-bg: #ecfeff;
    --ci-token-selected-hover-bg: #cffafe;
    --ci-token-ring: #cffafe;
}

.ci-status-resolved {
    --ci-token-bg: #ecfdf5;
    --ci-token-text: #047857;
    --ci-token-swatch: #10b981;
    --ci-token-border: #a7f3d0;
    --ci-token-swatch-border: #059669;
    --ci-token-selected-bg: #ecfdf5;
    --ci-token-selected-hover-bg: #d1fae5;
    --ci-token-ring: #d1fae5;
}

.ci-status-closed {
    --ci-token-bg: #f1f5f9;
    --ci-token-text: #334155;
    --ci-token-swatch: #64748b;
    --ci-token-border: #cbd5e1;
    --ci-token-swatch-border: #475569;
    --ci-token-selected-bg: #f1f5f9;
    --ci-token-selected-hover-bg: #e2e8f0;
    --ci-token-ring: #e2e8f0;
}

.ci-badge-severity {
    --ci-token-bg: #f1f5f9;
    --ci-token-text: #334155;
    --ci-token-border: #cbd5e1;
    --ci-token-ring: #f1f5f9;
}

.ci-severity-low {
    --ci-token-bg: #ecfdf5;
    --ci-token-text: #047857;
    --ci-token-swatch: #10b981;
    --ci-token-border: #a7f3d0;
    --ci-token-swatch-border: #059669;
    --ci-token-selected-bg: #ecfdf5;
    --ci-token-selected-hover-bg: #d1fae5;
    --ci-token-ring: #d1fae5;
}

.ci-severity-medium {
    --ci-token-bg: #fffbeb;
    --ci-token-text: #b45309;
    --ci-token-swatch: #f59e0b;
    --ci-token-border: #fcd34d;
    --ci-token-swatch-border: #d97706;
    --ci-token-selected-bg: #fffbeb;
    --ci-token-selected-hover-bg: #fef3c7;
    --ci-token-ring: #fef3c7;
}

.ci-severity-high {
    --ci-token-bg: #fff7ed;
    --ci-token-text: #c2410c;
    --ci-token-swatch: #f97316;
    --ci-token-border: #fed7aa;
    --ci-token-swatch-border: #ea580c;
    --ci-token-selected-bg: #fff7ed;
    --ci-token-selected-hover-bg: #ffedd5;
    --ci-token-ring: #ffedd5;
}

.ci-severity-critical {
    --ci-token-bg: #fef2f2;
    --ci-token-text: #b91c1c;
    --ci-token-swatch: #ef4444;
    --ci-token-border: #fecaca;
    --ci-token-swatch-border: #dc2626;
    --ci-token-selected-bg: #fef2f2;
    --ci-token-selected-hover-bg: #fee2e2;
    --ci-token-ring: #fee2e2;
}

.ci-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .75rem .25rem;
}

.ci-footer-count {
    font-size: .8125rem;
    color: #6b7280;
}

.ci-footer-pagesize {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    color: #6b7280;
}

.ci-footer-pagesize select {
    padding: .25rem .5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.ci-pager {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.ci-pager-status {
    font-size: .8125rem;
    color: #6b7280;
}

/* ---- Issue detail page ---- */
.ci-detail { width: 100%; padding-inline: 1.5rem; box-sizing: border-box; }
.ci-detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.ci-detail-back-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; font-weight: 500; color: #475569; text-decoration: none; padding: .375rem .625rem; border: 1px solid #e5e7eb; border-radius: .375rem; background: #fff; transition: background-color .15s, border-color .15s, color .15s; }
.ci-detail-back-link:hover { background: #f8fafc; border-color: #cbd5e1; color: #1e293b; text-decoration: none; }
.ci-detail-header { padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid #e5e7eb; }
/* The heading stack (badges, title, subtitle) fills the width; min-width:0 lets long
   unbroken titles wrap instead of forcing an overflow. In edit mode the textarea's small
   intrinsic width would otherwise collapse this column. */
.ci-detail-heading { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.ci-detail-badges { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ci-detail-badges .ci-badge { padding: .25rem .75rem; font-size: .8125rem; font-weight: 600; }
.ci-badge-id {
    --ci-token-bg: #f1f5f9;
    --ci-token-text: #334155;
    --ci-token-border: #cbd5e1;
}
.ci-badge-classification {
    --ci-token-bg: #ede9fe;
    --ci-token-text: #4c1d95;
    --ci-token-border: #c4b5fd;
}
.ci-detail-title { margin: 0; font-size: 1.75rem; font-weight: 700; color: #111827; line-height: 1.3; }
.ci-detail-subtitle { margin: .25rem 0 0; font-size: .9375rem; color: #6b7280; line-height: 1.5; }
.ci-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; }
@media (max-width: 800px) { .ci-detail-grid { grid-template-columns: 1fr; } }
.ci-detail-main { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.ci-detail-side { display: flex; flex-direction: column; gap: 1.25rem; }
.ci-detail-block { background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem; padding: 1rem 1.25rem; }
.ci-detail-block-title { margin: 0 0 .75rem; font-size: 1rem; font-weight: 600; color: #111827; }
.ci-detail-block-subtitle { margin: 0 0 1rem; font-size: .8125rem; color: #6b7280; line-height: 1.4; }
.ci-detail-text { margin: 0; white-space: pre-wrap; line-height: 1.5; color: #374151; }
.ci-detail-text-empty { color: #9ca3af; font-style: italic; }
.ci-detail-text-empty > p { margin: 0; }

/* Status card in right panel */
.ci-detail-status-card { background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem; padding: 1rem 1.25rem; }
.ci-status-card-header { display: flex; align-items: center; margin-bottom: .5rem; }
.ci-status-card-row { display: flex; flex-direction: column; gap: .375rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid #f1f5f9; }
.ci-status-card-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.25rem;
    padding-inline: .625rem .75rem;
    border: 1px solid var(--ci-token-border, #d1d5db);
    border-radius: .5rem;
    background: var(--ci-token-bg, #fff);
    color: var(--ci-token-text, #111827);
    box-shadow: inset 0 0 0 1px var(--ci-token-ring, transparent), 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color .12s, box-shadow .12s, background-color .12s;
}
.ci-status-card-field::after {
    content: "";
    position: absolute;
    right: .875rem;
    top: 50%;
    width: .5rem;
    height: .5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-65%) rotate(45deg);
    opacity: .8;
    pointer-events: none;
}
.ci-status-card-field:focus-within {
    border-color: var(--ci-token-swatch-border, #2563eb);
    box-shadow: inset 0 0 0 1px var(--ci-token-border, #bfdbfe), 0 0 0 3px var(--ci-token-ring, #dbeafe);
}
.ci-status-card-marker {
    width: .625rem;
    height: .625rem;
    border-radius: .25rem;
    border: 1px solid var(--ci-token-swatch-border, rgba(15, 23, 42, .2));
    background: var(--ci-token-swatch, #94a3b8);
    flex: 0 0 auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.ci-status-card-select {
    width: 100%;
    border: none;
    background: transparent;
    color: inherit;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.3;
    padding: .4375rem 1.75rem .4375rem 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.ci-status-card-select option {
    color: var(--ci-token-text, #1e293b);
    background-color: var(--ci-token-bg, #fff);
    font-weight: 600;
}
.ci-status-card-select option:checked {
    color: var(--ci-token-text, #1e293b);
    background-color: var(--ci-token-selected-bg, var(--ci-token-bg, #eef6ff));
}
.ci-status-card-select option:hover {
    background-color: var(--ci-token-selected-hover-bg, var(--ci-token-bg, #f6f8fb));
}
.ci-status-card-select:focus {
    outline: none;
}
.ci-status-card-select:disabled {
    cursor: default;
}

/* Custom semantic dropdown (Status / Type / Severity) */
.ci-dropdown {
    position: relative;
}

.ci-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    min-height: 2.25rem;
    padding: .4375rem 2rem .4375rem .625rem;
    border: 1px solid var(--ci-token-border, #d1d5db);
    border-radius: .5rem;
    background: #fff;
    color: var(--ci-token-text, #111827);
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    text-align: left;
    transition: border-color .12s, box-shadow .12s;
}

.ci-dropdown-trigger:focus-visible {
    outline: none;
    border-color: var(--ci-token-swatch-border, #2563eb);
    box-shadow: 0 0 0 3px var(--ci-token-ring, #dbeafe);
}

.ci-dropdown-trigger:disabled {
    cursor: default;
}

.ci-dropdown-swatch {
    width: .625rem;
    height: .625rem;
    border-radius: .25rem;
    flex: 0 0 auto;
    border: 1px solid var(--ci-token-swatch-border, rgba(15, 23, 42, .2));
    background: var(--ci-token-swatch, #94a3b8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.ci-dropdown-label {
    flex: 1 1 auto;
}

.ci-dropdown-caret {
    width: .85rem;
    height: .85rem;
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: .7;
    pointer-events: none;
    color: currentColor;
}

.ci-dropdown-list {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    margin: 0;
    padding: .25rem;
    list-style: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .12);
    max-height: 16rem;
    overflow-y: auto;
}

.ci-dropdown-list[hidden] {
    display: none;
}

.ci-dropdown-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4375rem .5rem;
    border-radius: .375rem;
    cursor: pointer;
    color: #1e293b;
    background: transparent;
    font-weight: 600;
    font-size: .875rem;
}

.ci-dropdown-option-swatch {
    width: .625rem;
    height: .625rem;
    border-radius: .25rem;
    flex: 0 0 auto;
    border: 1px solid var(--ci-token-swatch-border, rgba(15, 23, 42, .2));
    background: var(--ci-token-swatch, #94a3b8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.ci-dropdown-option-label {
    flex: 1 1 auto;
}

.ci-dropdown-option:hover,
.ci-dropdown-option.is-active {
    background: #f1f5f9;
}

.ci-dropdown-check {
    width: .85rem;
    height: .85rem;
    opacity: 0;
    color: #334155;
    flex: 0 0 auto;
}

.ci-dropdown-option[aria-selected="true"] .ci-dropdown-check {
    opacity: 1;
}

/* Sidebar metadata panels */
.ci-detail-meta { background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem; padding: 1rem 1.25rem; }
/* Rendered Markdown typography (Details) */
.ci-markdown { white-space: normal; color: #374151; line-height: 1.6; font-size: .9375rem; }
.ci-markdown > :first-child { margin-top: 0; }
.ci-markdown > :last-child { margin-bottom: 0; }
.ci-markdown p { margin: 0 0 .75rem; }
.ci-markdown h1, .ci-markdown h2, .ci-markdown h3, .ci-markdown h4 { margin: 1.25rem 0 .5rem; line-height: 1.3; color: #111827; font-weight: 600; }
.ci-markdown h1 { font-size: 1.375rem; }
.ci-markdown h2 { font-size: 1.2rem; }
.ci-markdown h3 { font-size: 1.05rem; }
.ci-markdown h4 { font-size: .95rem; }
.ci-markdown ul, .ci-markdown ol { margin: 0 0 .75rem; padding-left: 1.5rem; }
.ci-markdown li { margin: .2rem 0; }
.ci-markdown li > p { margin: 0; }
.ci-markdown a { color: #0d6efd; text-decoration: none; }
.ci-markdown a:hover { text-decoration: underline; }
.ci-markdown code { background: #f3f4f6; border-radius: .25rem; padding: .1rem .35rem; font-size: .85em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #b91c1c; }
.ci-markdown pre { background: #1e293b; color: #e2e8f0; border-radius: .375rem; padding: .75rem 1rem; overflow-x: auto; margin: 0 0 .75rem; }
.ci-markdown pre code { background: transparent; color: inherit; padding: 0; }
.ci-markdown blockquote { margin: 0 0 .75rem; padding: .35rem 0 .35rem 1rem; border-left: 3px solid #cbd5e1; color: #6b7280; }
.ci-markdown table { border-collapse: collapse; margin: 0 0 .75rem; font-size: .875rem; }
.ci-markdown th, .ci-markdown td { border: 1px solid #e5e7eb; padding: .35rem .6rem; text-align: left; }
.ci-markdown th { background: #f9fafb; font-weight: 600; }
.ci-markdown hr { border: none; border-top: 1px solid #e5e7eb; margin: 1rem 0; }
.ci-markdown img { max-width: 100%; height: auto; border-radius: .375rem; }
.ci-meta-row { display: flex; justify-content: space-between; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid #f1f5f9; }
.ci-meta-row:last-child { border-bottom: none; }
.ci-meta-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; font-weight: 600; }
.ci-meta-value { font-size: .875rem; color: #111827; text-align: right; word-break: break-word; }
.ci-meta-row-stacked { flex-direction: column; align-items: stretch; gap: .25rem; }
.ci-meta-people { display: flex; flex-direction: column; text-align: left; }
.ci-meta-user { font-size: .875rem; color: #111827; font-weight: 500; line-height: 1.35; }
.ci-meta-date { margin-top: .125rem; font-size: .8125rem; color: #6b7280; line-height: 1.35; }
.ci-meta-link { color: #0d6efd; text-decoration: none; }
.ci-meta-link:hover { text-decoration: underline; }
.ci-attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.ci-attach-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .75rem; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: .375rem; }
.ci-attach-item a { display: inline-flex; align-items: center; gap: .4rem; color: #0d6efd; text-decoration: none; font-size: .875rem; word-break: break-all; }
.ci-attach-item a:hover { text-decoration: underline; }
.ci-attach-size { font-size: .75rem; color: #6b7280; white-space: nowrap; }
.ci-comment-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.ci-comment-empty { font-size: .875rem; color: #6b7280; font-style: italic; }
.ci-comment { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: .375rem; padding: .65rem .85rem; }
.ci-comment-meta { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .25rem; }
.ci-comment-author { font-size: .8125rem; font-weight: 600; color: #111827; }
.ci-comment-time { font-size: .75rem; color: #6b7280; }
.ci-comment-body { font-size: .875rem; color: #374151; white-space: pre-wrap; line-height: 1.45; }
.ci-comment-form { display: flex; flex-direction: column; gap: .5rem; }
.ci-comment-form textarea { width: 100%; padding: .5rem .65rem; border: 1px solid #d1d5db; border-radius: .375rem; font-size: .875rem; font-family: inherit; resize: vertical; }
.ci-comment-form-actions { display: flex; justify-content: flex-end; }

/* ===== Image Gallery ===== */
.ci-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.ci-gallery-item { position: relative; border: 1px solid #e5e7eb; border-radius: .375rem; overflow: hidden; cursor: pointer; background: #f9fafb; transition: box-shadow .15s; }
.ci-gallery-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.ci-gallery-thumb { display: block; width: 100%; height: 120px; object-fit: cover; }
.ci-detail-attachments { padding: 1rem 1.25rem; }
.ci-gallery-name { display: block; padding: .35rem .5rem; font-size: .75rem; color: #374151; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-gallery-note { display: block; padding: 0 .5rem .4rem; font-size: .6875rem; color: #6b7280; text-align: center; line-height: 1.35; cursor: text; }
.ci-gallery-note:hover { color: #374151; }
.ci-classifications-help { margin: 0 0 .6rem; font-size: .75rem; color: #6b7280; line-height: 1.4; }

/* ===== Lightbox ===== */
.ci-lightbox { border: none; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.ci-lightbox::backdrop { background: rgba(0,0,0,.8); }
.ci-lightbox-backdrop { position: fixed; inset: 0; z-index: 0; }
.ci-lightbox-content { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1; }
.ci-lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: .5rem; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.ci-lightbox-close { position: fixed; top: 1rem; right: 1rem; z-index: 2; border: none; background: rgba(255,255,255,.15); color: #fff; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.ci-lightbox-close:hover { background: rgba(255,255,255,.3); }
.ci-lightbox-prev, .ci-lightbox-next { position: fixed; top: 50%; transform: translateY(-50%); z-index: 2; border: none; background: rgba(255,255,255,.15); color: #fff; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.ci-lightbox-prev { left: 1rem; }
.ci-lightbox-next { right: 1rem; }
.ci-lightbox-prev:hover, .ci-lightbox-next:hover { background: rgba(255,255,255,.3); }

/* ===== Editable Sections ===== */
.ci-editable { cursor: pointer; border: 1px solid transparent; border-radius: .375rem; padding: .25rem .35rem; transition: border-color .15s, background .15s; }
.ci-editable:hover { border-color: #d1d5db; background: #f9fafb; }
.ci-editable-active { cursor: default; border-color: #2563eb; background: #fff; }
.ci-editable-input { width: 100%; padding: .5rem .65rem; border: 1px solid #2563eb; border-radius: .375rem; font-size: inherit; font-family: inherit; resize: vertical; outline: none; box-sizing: border-box; }
/* Summary editor: a multi-line textarea that matches .ci-detail-title typography so the
   heading text keeps its weight/size and wraps naturally (long titles are never clipped
   or forced onto one line). Height auto-grows from the measured heading box in TS. The
   parent .ci-detail-heading fills the header row, so width:100% spans the displayed width;
   padding-inline matches the .ci-editable view padding so the text column lines up. */
.ci-editable-input-title { padding-inline: .35rem; font-weight: 700; line-height: 1.3; color: #111827; }

/* ===== Upload Control ===== */
.ci-attach-upload { margin-top: .75rem; display: flex; align-items: center; gap: .75rem; }
.ci-attach-upload-label { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border: 1px dashed #d1d5db; border-radius: .375rem; font-size: .8125rem; color: #6b7280; cursor: pointer; transition: border-color .15s, color .15s; }
.ci-attach-upload-label:hover { border-color: #2563eb; color: #2563eb; }
.ci-attach-upload-status { font-size: .75rem; color: #6b7280; }
.ci-attach-upload-label input[type="file"] { display: none; }

/* ===== Notifications ===== */
.ci-notif-container { position: relative; display: inline-flex; align-items: center; }
.ci-notif-bell {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, .1); color: inherit; cursor: pointer;
    transition: background .15s; position: relative;
}
.ci-notif-bell:hover { background: rgba(255, 255, 255, .2); }
.ci-notif-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: #ef4444; color: #fff;
    font-size: .625rem; font-weight: 700; line-height: 16px; text-align: center;
}
.ci-notif-panel {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 360px; max-height: 420px; overflow-y: auto;
    background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,.12); z-index: 1000;
    font-size: .875rem; color: #1a1a1a;
}
.ci-notif-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .65rem .85rem; border-bottom: 1px solid #e5e7eb;
}
.ci-notif-title { font-weight: 600; font-size: .875rem; }
.ci-notif-mark-all {
    border: none; background: none; color: #2563eb; font-size: .75rem;
    cursor: pointer; padding: 0;
}
.ci-notif-mark-all:hover { text-decoration: underline; }
.ci-notif-mark-all:disabled { opacity: .5; cursor: default; text-decoration: none; }
.ci-notif-list { display: flex; flex-direction: column; }
.ci-notif-loading, .ci-notif-empty {
    padding: 1.5rem; text-align: center; color: #6b7280; font-size: .8125rem;
}
.ci-notif-item {
    padding: .6rem .85rem; border-bottom: 1px solid #f3f4f6;
    background: #eff6ff; transition: background .12s;
}
.ci-notif-item:last-child { border-bottom: none; }
.ci-notif-item-read { background: #fff; }
.ci-notif-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .2rem; }
.ci-notif-kind { font-size: .6875rem; font-weight: 600; text-transform: uppercase; color: #6b7280; }
.ci-notif-time { font-size: .6875rem; color: #9ca3af; }
.ci-notif-message { font-size: .8125rem; color: #374151; line-height: 1.4; margin-bottom: .25rem; }
.ci-notif-item-footer { display: flex; align-items: center; justify-content: space-between; }
.ci-notif-link { font-size: .75rem; color: #2563eb; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.ci-notif-link:hover { text-decoration: underline; }
.ci-notif-read-btn {
    border: none; background: none; color: #10b981; cursor: pointer;
    font-size: .875rem; padding: 2px 4px; border-radius: 4px;
}
.ci-notif-read-btn:hover { background: #d1fae5; }

/* ===== Manage Users page ===== */
.ci-manage-users {
    padding-top: .5rem;
    padding-bottom: 2rem;
}

.ci-manage-users .ci-issues-header {
    margin-bottom: 1.5rem;
}

.ci-header-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.ci-user-count {
    font-weight: 600;
    color: #374151;
}

/* read-only table rows */
.ci-manage-users .ci-table thead th {
    padding: .75rem 1rem;
    font-size: .8125rem;
}

.ci-manage-users .ci-table tbody td {
    padding: .75rem 1rem;
    font-size: .875rem;
}

.ci-cell-name {
    font-weight: 500;
}

.ci-cell-email {
    color: #4b5563;
}

.ci-cell-tz {
    color: #6b7280;
}

.ci-manage-users .ci-col-actions {
    width: 140px;
    white-space: nowrap;
}

.ci-manage-users .ci-col-actions .issue-central-btn {
    margin-left: .375rem;
}

.ci-manage-users .ci-col-actions .issue-central-btn:first-child {
    margin-left: 0;
}

.ci-row-editing {
    background: #eff6ff;
}

/* role badges */
.ci-badge-admin {
    --ci-token-bg: #dbeafe;
    --ci-token-fg: #1e40af;
    --ci-token-border: #93c5fd;
    background: var(--ci-token-bg);
    color: var(--ci-token-fg);
    border-color: var(--ci-token-border);
}

.ci-badge-member {
    --ci-token-bg: #f3f4f6;
    --ci-token-fg: #6b7280;
    --ci-token-border: #d1d5db;
    background: var(--ci-token-bg);
    color: var(--ci-token-fg);
    border-color: var(--ci-token-border);
}

/* danger button */
.ci-btn-danger {
    color: #dc2626;
    border-color: #fca5a5;
}

.ci-btn-danger:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

/* small button override */
.ci-manage-users .ci-btn-sm {
    padding: .3125rem .75rem;
    font-size: .8125rem;
}

/* user card (add / edit) */
.ci-user-card {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.ci-user-edit-modal {
    width: min(720px, calc(100vw - 48px));
    height: auto !important;
    max-height: calc(100vh - 48px);
}

.ci-user-edit-modal .ci-user-card-header {
    padding: 1.5rem 1.5rem 0;
}

.ci-user-edit-modal .ci-user-card-form {
    padding: 0 1.5rem 1.5rem;
}

.ci-user-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.ci-user-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 .25rem;
    color: #1a1a1a;
}

.ci-user-card-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: .8125rem;
}

/* form layout */
.ci-user-card-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ci-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .ci-form-row {
        grid-template-columns: 1fr;
    }
}

.ci-form-field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.ci-form-field label {
    font-size: .75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.ci-form-field input[type="text"],
.ci-form-field input[type="email"],
.ci-form-field select {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .875rem;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .12s, box-shadow .12s;
}

.ci-form-field input[type="text"]:focus,
.ci-form-field input[type="email"]:focus,
.ci-form-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .15);
}

.ci-form-field-check {
    justify-content: center;
}

.ci-form-field-check label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    font-weight: 500;
    color: #374151;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.ci-form-field-check input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.ci-form-hint {
    font-size: .75rem;
    color: #9ca3af;
}

.ci-form-actions {
    display: flex;
    gap: .5rem;
    padding-top: .5rem;
}

/* toast messages */
.ci-msg-success {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #065f46;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.ci-msg-error {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* Transient toast notifications (shared helper: centralInternal.showToast) */
.ci-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}

.ci-toast {
    min-width: 200px;
    max-width: 360px;
    padding: .625rem .875rem;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.4;
    color: #064e3b;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: auto;
}

.ci-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ci-toast-success {
    color: #064e3b;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.ci-toast-error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.ci-toast-info {
    color: #1e3a8a;
    background: #eff6ff;
    border-color: #bfdbfe;
}

