/* Industry Labs corporate + Jira-like layout */

[hidden] {
    display: none !important;
}

:root,
[data-theme="light"] {
    color-scheme: light;

    --brand: #118041;
    --brand-hover: #0d6634;
    --brand-light: #e8f5ee;
    --brand-dark: #0d6634;

    --sidebar-bg: #ffffff;
    --sidebar-text: #44546f;
    --sidebar-text-muted: #5e6c84;
    --sidebar-hover: #ebecf0;
    --sidebar-active-bg: #e8f5ee;
    --sidebar-active-text: #118041;
    --sidebar-border: #dfe1e6;
    --sidebar-width: 240px;
    --sidebar-width-collapsed: 56px;

    --surface: #ffffff;
    --surface-muted: #f4f5f7;
    --surface-raised: #ebecf0;
    --border: #dfe1e6;
    --border-strong: #c1c7d0;
    --text: #172b4d;
    --text-muted: #5e6c84;
    --hover: #ebecf0;

    --status-todo-bg: #dfe1e6;
    --status-todo-text: #42526e;
    --status-progress-bg: #deebff;
    --status-progress-text: #0052cc;
    --status-done-bg: #e3fcef;
    --status-done-text: #006644;

    --issue-type-task-bg: #deebff;
    --issue-type-task-text: #0052cc;
    --issue-type-bug-bg: #ffebe6;
    --issue-type-bug-text: #bf2600;
    --issue-type-story-bg: #e3fcef;
    --issue-type-story-text: #006644;
    --issue-type-epic-bg: #eae6ff;
    --issue-type-epic-text: #403294;

    --create-btn: #118041;
    --create-btn-hover: #0d6634;

    --success: #00875a;
    --error: #de350b;
    --warning: #ff991f;

    --shadow: none;
    --overlay: rgba(9, 30, 66, 0.54);
    --radius: 3px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --kanban-board-bg: #ebecf0;
    --kanban-column-bg: #ffffff;
    --kanban-column-cards-bg: #f4f5f7;
}

[data-theme="dark"] {
    color-scheme: dark;

    --brand-dark: #4ade80;
    --brand-light: #1a3d2e;

    --sidebar-bg: #1d2125;
    --sidebar-text: #b6c2cf;
    --sidebar-text-muted: #8c9bab;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active-bg: rgba(17, 128, 65, 0.2);
    --sidebar-active-text: #4ade80;
    --sidebar-border: #38414a;

    --surface: #22272b;
    --surface-muted: #161a1d;
    --surface-raised: #282e33;
    --border: #38414a;
    --border-strong: #454f59;
    --text: #b6c2cf;
    --text-muted: #8c9bab;
    --hover: #2c333a;

    --status-todo-bg: #38414a;
    --status-todo-text: #b6c2cf;
    --status-progress-bg: #1c3d5a;
    --status-progress-text: #579dff;
    --status-done-bg: #1a3d2e;
    --status-done-text: #4bce97;

    --issue-type-task-bg: #1c3d5a;
    --issue-type-task-text: #85b8ff;
    --issue-type-bug-bg: #3d1f1a;
    --issue-type-bug-text: #ff9c8f;
    --issue-type-story-bg: #1a3d2e;
    --issue-type-story-text: #6ee7b7;
    --issue-type-epic-bg: #2b2247;
    --issue-type-epic-text: #c6b6ff;

    --create-btn: #118041;
    --create-btn-hover: #16a34a;

    --overlay: rgba(0, 0, 0, 0.65);

    --kanban-board-bg: #101214;
    --kanban-column-bg: #22272b;
    --kanban-column-cards-bg: #1a1d21;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--surface-muted);
    color: var(--text);
    line-height: 1.42857;
    font-size: 14px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover, var(--brand-dark)); }

/* ─── App shell ─── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width 0.2s ease;
    overflow: visible;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 12px 8px 12px 12px;
    min-height: 56px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
    text-decoration: none;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .sidebar-brand { color: var(--sidebar-active-text); }

.sidebar-brand:hover {
    color: var(--brand-hover, var(--brand-dark));
    text-decoration: none;
    opacity: 0.9;
}

.sidebar-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-brand__mark--image {
    background: transparent;
    padding: 0;
}

.sidebar-brand__mark--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.sidebar-brand__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--sidebar-text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
}

.sidebar-collapse-btn__icon--expand { display: none; }

html.sidebar-collapsed .sidebar-collapse-btn__icon--collapse { display: none; }
html.sidebar-collapsed .sidebar-collapse-btn__icon--expand { display: block; }

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.1s;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar-link.is-active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

.sidebar-link__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
    position: relative;
}

.sidebar-user-menu {
    position: relative;
}

.sidebar-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: inherit;
    transition: background 0.1s;
}

.sidebar-user-trigger:hover,
.sidebar-user-menu.is-open .sidebar-user-trigger {
    background: var(--sidebar-hover);
}

.sidebar-user-trigger__info {
    flex: 1;
    min-width: 0;
}

.sidebar-user__name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user__email {
    display: block;
    font-size: 11px;
    color: var(--sidebar-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-trigger__chevron {
    flex-shrink: 0;
    color: var(--sidebar-text-muted);
    transition: transform 0.15s;
}

.sidebar-user-menu.is-open .sidebar-user-trigger__chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.15));
    z-index: 300;
    overflow: hidden;
}

[data-theme="dark"] .user-dropdown {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.user-dropdown__header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.user-dropdown__name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.user-dropdown__email {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-dropdown__items {
    padding: 4px 0;
}

.user-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}

.user-dropdown__item:hover {
    background: var(--hover);
    text-decoration: none;
    color: var(--text);
}

.user-dropdown__item--danger { color: var(--error); }
.user-dropdown__item--danger:hover { color: var(--error); background: rgba(222, 53, 11, 0.08); }

.user-dropdown__item.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: auto;
    height: auto;
    padding: 10px 14px;
    border: none;
    border-radius: 0;
    justify-content: flex-start;
    white-space: nowrap;
}

.user-dropdown__item.theme-toggle .theme-toggle__icon {
    flex-shrink: 0;
    display: none;
    width: 18px;
    height: 18px;
}

[data-theme="light"] .user-dropdown__item.theme-toggle .theme-toggle__icon--moon,
[data-theme="dark"] .user-dropdown__item.theme-toggle .theme-toggle__icon--sun {
    display: block;
}

.user-dropdown__item.theme-toggle .theme-label {
    white-space: nowrap;
}

.theme-label--to-light { display: none; }
[data-theme="dark"] .theme-label--to-dark { display: none; }
[data-theme="dark"] .theme-label--to-light { display: inline; }

/* Sidebar colapsada */
html.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-width-collapsed);
}

html.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    padding: 12px 8px;
    gap: 8px;
}

html.sidebar-collapsed .sidebar-brand__text,
html.sidebar-collapsed .sidebar-link__label,
html.sidebar-collapsed .sidebar-user-trigger__info,
html.sidebar-collapsed .sidebar-user-trigger__chevron {
    display: none;
}

html.sidebar-collapsed .sidebar-brand {
    justify-content: center;
}

html.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 10px;
}

html.sidebar-collapsed .sidebar-footer {
    padding: 12px 8px;
}

html.sidebar-collapsed .sidebar-user-trigger {
    justify-content: center;
    padding: 6px;
}

html.sidebar-collapsed .user-dropdown {
    left: calc(100% + 8px);
    bottom: 0;
    right: auto;
    width: 240px;
}

html.sidebar-collapsed .sidebar-collapse-btn {
    width: 100%;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    width: 100%;
    padding: 0;
}

/* ─── Topbar (search + notifications) ─── */
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 20;
}

.global-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 480px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    color: var(--text-muted);
}

.global-search--wide {
    max-width: none;
}

.global-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    width: 100%;
}

.app-topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.notifications-menu {
    position: relative;
}

.notifications-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.notifications-trigger:hover {
    background: var(--hover);
    color: var(--text);
}

.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
    overflow: hidden;
    z-index: 50;
}

.notifications-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}

.notifications-dropdown__list {
    max-height: 360px;
    overflow-y: auto;
}

.notifications-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.notification-item {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--hover);
}

.notification-item.is-unread {
    background: rgba(17, 128, 65, 0.06);
}

.notification-item__title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.notification-item__body {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-item__time {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

/* ─── Search page ─── */
.search-filters {
    margin: 0 24px 16px;
}

.search-filters__row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-filters__row--secondary {
    margin-top: 12px;
}

.search-results-count {
    margin: 0 24px 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.backlog-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ─── Avatars ─── */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--md { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }
.avatar--xl { width: 80px; height: 80px; font-size: 24px; }
.avatar--empty { background: var(--surface-raised); color: var(--text-muted); font-size: 12px; }

.avatar--image {
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.avatar--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Page toolbar ─── */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 24px 16px;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.page-toolbar__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    white-space: nowrap;
}

.btn-create {
    background: var(--create-btn);
    color: #fff;
}

.btn-create:hover {
    background: var(--create-btn-hover);
    color: #fff;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-primary:hover { background: var(--brand-hover, var(--brand-dark)); color: #fff; }

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn-ghost:hover { background: var(--hover); }

.btn-sm { padding: 4px 10px; font-size: 12px; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 1;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
    font-size: 14px;
}
.btn-block { width: 100%; }

.btn-danger {
    background: var(--error);
    color: #fff;
    border: 1px solid var(--error);
}

.btn-danger:hover:not(:disabled) {
    background: #bf2600;
    border-color: #bf2600;
    color: #fff;
}

.btn-danger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-theme-toggle .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
}

.auth-theme-toggle .theme-toggle:hover { background: var(--hover); color: var(--text); }
.auth-theme-toggle .theme-toggle__icon { display: none; }
[data-theme="light"] .auth-theme-toggle .theme-toggle__icon--moon,
[data-theme="dark"] .auth-theme-toggle .theme-toggle__icon--sun { display: block; }

/* ─── Jira table ─── */
.jira-panel {
    margin: 0 24px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.jira-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.jira-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

.jira-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.jira-table tr:last-child td { border-bottom: none; }

.jira-table__row {
    cursor: pointer;
    transition: background 0.1s;
}

.jira-table__row:hover td { background: var(--hover); }

.project-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-cell__name {
    display: block;
    font-weight: 500;
    color: var(--text);
}

.project-cell__desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.project-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.project-avatar--sm { width: 32px; height: 32px; font-size: 14px; }
.project-avatar--lg { width: 72px; height: 72px; font-size: 28px; border-radius: 12px; }

.project-avatar--image {
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.project-avatar--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-settings {
    padding: 20px 24px 24px;
}

.project-settings__card {
    padding: 20px 24px;
    margin-bottom: 0;
}

.project-settings__card h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: none;
    letter-spacing: normal;
}

.project-settings__desc {
    margin: 0 0 24px;
    font-size: 14px;
}

.project-settings__layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

.project-settings__avatar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 220px;
}

.project-settings__avatar-preview {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 120px;
}

.project-settings__avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.project-settings__avatar-actions .btn {
    width: 100%;
    justify-content: center;
}

.project-settings__form .form-group:last-of-type {
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .project-settings__layout {
        grid-template-columns: 1fr;
    }
}

.project-key {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ─── Project view ─── */
.project-shell {
    min-height: calc(100vh - 0px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 0;
    gap: 16px;
}

.project-header__identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.project-header__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.project-header__sep { opacity: 0.5; }
.project-header__type { font-weight: 500; }

.project-header__title {
    font-size: 24px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.project-tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    margin-top: 16px;
    border-bottom: 1px solid var(--border);
}

.project-tab {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.1s, border-color 0.1s;
}

.project-tab:hover {
    color: var(--text);
    text-decoration: none;
}

.project-tab.is-active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

[data-theme="dark"] .project-tab.is-active {
    color: var(--brand-dark);
    border-bottom-color: var(--brand-dark);
}

.project-members {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-members__add {
    padding: 20px 24px;
}

.project-members__add h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: none;
    letter-spacing: normal;
}

.project-members__desc {
    margin-bottom: 16px;
    font-size: 14px;
}

.project-members__add-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.project-members__add-form .form-group {
    flex: 1;
    min-width: 240px;
    margin-bottom: 0;
}

.project-members__empty-hint {
    margin-top: 12px;
    font-size: 13px;
}

.project-members__list {
    margin: 0;
}

.member-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jira-table__actions {
    text-align: right;
    white-space: nowrap;
}

/* ─── Backlog ─── */
.backlog-toolbar,
.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.backlog-toolbar__primary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 320px;
    min-width: 0;
}

.backlog-participants {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.backlog-participant {
    position: relative;
    display: inline-flex;
    padding: 0;
    margin-left: -8px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.backlog-participant:first-child {
    margin-left: 0;
}

.backlog-participant:hover {
    z-index: 2;
    transform: translateY(-1px);
}

.backlog-participant.is-active {
    z-index: 3;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-light);
}

.backlog-participant .avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.backlog-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 6px 10px;
    min-width: 240px;
    color: var(--text-muted);
}

.backlog-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    width: 100%;
}

.backlog-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.backlog-panel {
    margin: 0 24px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.backlog-panel__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.backlog-panel__toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.backlog-panel__toggle:hover {
    color: var(--text);
}

.backlog-panel__toggle svg {
    transition: transform 0.15s ease;
}

.backlog-panel.is-collapsed .backlog-panel__toggle svg {
    transform: rotate(-90deg);
}

.backlog-panel.is-collapsed .backlog-list,
.backlog-panel.is-collapsed .sprint-panel__meta {
    display: none;
}

.backlog-panel.is-collapsed .backlog-panel__header {
    border-bottom: none;
}

.backlog-panel__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.backlog-panel__header > .backlog-panel__count {
    margin-left: auto;
}

.backlog-panel__count {
    background: var(--surface-raised);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.backlog-list { display: flex; flex-direction: column; }

.issue-row {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: stretch;
    gap: 4px;
    padding: 0;
    border-bottom: 1px solid var(--border);
    color: inherit;
    transition: background 0.1s;
    min-height: 40px;
}

.issue-row__handle--spacer {
    visibility: hidden;
    pointer-events: none;
}

.issue-row__handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: grab;
    padding: 6px 0 6px 8px;
}

.issue-row__handle:active { cursor: grabbing; }

.issue-row__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 0;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.issue-row__lead {
    display: grid;
    grid-template-columns: 24px 88px 76px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.issue-row__context {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    width: 76px;
    max-width: 76px;
}

.issue-row__trail {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.issue-row__tags {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
    flex: 0 1 auto;
    min-width: 0;
}

.issue-row__tags .issue-label--xs {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
    white-space: nowrap;
}

.issue-row__points-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
}

.issue-row__status-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    min-width: 104px;
}

.issue-row__status-slot .status-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.issue-row__extras-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 52px;
    min-width: 52px;
}

.issue-row__assignee-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
}

.issue-row:last-child { border-bottom: none; }

.issue-row:hover,
.issue-row:hover .issue-row__link {
    background: var(--hover);
    text-decoration: none;
}

.issue-row.sortable-ghost { opacity: 0.45; }

.issue-row.sortable-drag {
    opacity: 0.92;
    background: var(--surface-raised);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    z-index: 2;
}

.issue-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    font-size: 15px;
    line-height: 1;
}

.issue-type-icon i {
    display: block;
    line-height: 1;
}

.issue-type-icon--task { color: #2684FF; }
.issue-type-icon--bug { color: #E5493A; }
.issue-type-icon--story { color: #36B37E; }
.issue-type-icon--subtask { color: #2684FF; }
.issue-type-icon--epic { color: #6554C0; }
.issue-type-icon--custom { color: #6554C0; }

.issue-label--xs {
    font-size: 10px;
    padding: 1px 5px;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.issue-row--blocked .issue-row__key {
    color: #de350b;
}

.due-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.due-date-badge--sm { font-size: 10px; }

.due-date-badge--overdue {
    color: #de350b;
}

.due-date-badge--today {
    color: #ff991f;
}

.due-date-badge--soon {
    color: #ff991f;
}

.blocked-badge {
    color: #de350b;
    font-size: 12px;
}

.kanban-card--blocked {
    border-color: color-mix(in srgb, #de350b 35%, var(--border));
}

.kanban-card__blocked-icon {
    color: #de350b;
    font-size: 12px;
}

.kanban-card__epic {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.kanban-card__labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.kanban-card__labels .issue-label--xs {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
    font-size: 11px;
    line-height: 1.25;
    padding: 3px 8px;
}

.kanban-card--has-labels {
    min-height: 100px;
}

.kanban-card--has-labels .kanban-card__summary {
    -webkit-line-clamp: 2;
    max-height: 40px;
}

.kanban-card__footer-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.backlog-panel--sprint {
    border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
}

.backlog-panel--sprint-future {
    border: 1px dashed var(--border);
    background: color-mix(in srgb, var(--text) 2%, var(--surface));
}

.backlog-panel--epics {
    border: 1px solid color-mix(in srgb, #6554C0 22%, var(--border));
}

.epic-row {
    border-bottom: 1px solid var(--border);
}

.epic-row:last-child {
    border-bottom: none;
}

.epic-row__main {
    display: grid;
    grid-template-columns: 24px 88px minmax(0, 1fr) auto auto auto 32px;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    text-decoration: none;
    color: inherit;
}

.epic-row:hover .epic-row__main {
    background: var(--hover);
    text-decoration: none;
}

.epic-row__progress {
    padding: 0 12px 10px 12px;
}

.epic-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.epic-progress__track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, #6554C0 12%, var(--surface-muted));
    overflow: hidden;
}

.epic-progress__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6554C0, color-mix(in srgb, #6554C0 70%, var(--brand)));
    transition: width 0.2s ease;
}

.epic-progress__label {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.epic-detail__progress {
    margin-bottom: 12px;
}

.epic-child-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.epic-child-item {
    display: grid;
    grid-template-columns: 24px 88px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
}

.epic-child-item:first-child {
    border-top: none;
    padding-top: 0;
}

.epic-child-item__key {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}

.epic-child-item__key:hover {
    color: var(--brand);
}

.epic-child-item__summary {
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epic-child-item__summary:hover {
    color: var(--brand);
}

.backlog-panel__header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.backlog-panel__badge {
    margin-left: 8px;
}

.sprint-banner,
.board-sprint-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--brand) 8%, var(--surface));
    font-size: 13px;
}

.sprint-banner {
    margin: 0 24px 12px;
}

.board-sprint-banner {
    margin: 16px 24px 12px;
}

.board-sprint-banner__dates {
    font-size: 12px;
}

.sprint-panel__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px 10px 36px;
    font-size: 12px;
    color: var(--text-muted);
}

.sprint-panel__dates,
.sprint-panel__points {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.story-points-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--text-muted) 14%, var(--surface));
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.story-points-badge--sm {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
}

.sprint-panel__goal {
    line-height: 1.4;
}

.form-group--checkbox {
    margin-bottom: 8px;
}

.form-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.form-check input {
    width: auto;
    margin: 0;
}

#sprint-form-error {
    margin-top: 0;
    color: var(--error);
}

.backlog-empty--inline {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    border: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
    border-radius: 6px;
    margin: 6px 12px 8px;
}

.sprint-list:has(> .issue-row) > .backlog-empty,
#backlog-list:has(> .issue-row) > .backlog-empty {
    display: none;
}

.sidebar-readonly {
    margin: 0;
    font-size: 14px;
}

.sidebar-field--warning {
    padding: 10px;
    border-radius: 6px;
    background: color-mix(in srgb, #de350b 8%, var(--surface));
}

.blocker-list {
    margin: 4px 0 0;
    padding-left: 18px;
    font-size: 13px;
}

.issue-row__key {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.issue-row--subtask {
    background: color-mix(in srgb, var(--surface) 92%, var(--brand) 8%);
}


.issue-row__parent {
    color: var(--text-muted);
    font-size: 12px;
    margin-right: 4px;
}

.kanban-card--subtask {
    border-left: 3px solid var(--brand);
}

.kanban-card__parent {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.issue-row__summary {
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.status-pill {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-pill--todo { background: var(--status-todo-bg); color: var(--status-todo-text); }
.status-pill--progress { background: var(--status-progress-bg); color: var(--status-progress-text); }
.status-pill--done { background: var(--status-done-bg); color: var(--status-done-text); }

.sidebar-field select.issue-status-select {
    font-weight: 600;
    border-width: 1px;
    cursor: pointer;
}

.sidebar-field select.issue-status-select.status-pill--todo {
    background: var(--status-todo-bg);
    color: var(--status-todo-text);
    border-color: transparent;
}

.sidebar-field select.issue-status-select.status-pill--progress {
    background: var(--status-progress-bg);
    color: var(--status-progress-text);
    border-color: transparent;
}

.sidebar-field select.issue-status-select.status-pill--done {
    background: var(--status-done-bg);
    color: var(--status-done-text);
    border-color: transparent;
}

.sidebar-field select.issue-status-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand);
}

.sidebar-field select.issue-status-select option,
.sidebar-field select.issue-type-select option {
    background: var(--surface-raised);
    color: var(--text);
    font-weight: 500;
}

.sidebar-field select.issue-type-select,
.sidebar-field .issue-type-picker .issue-type-picker__trigger {
    font-weight: 600;
    border-width: 1px;
    cursor: pointer;
}

.sidebar-field select.issue-type-select:focus,
.sidebar-field .issue-type-picker .issue-type-picker__trigger:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand);
}

.sidebar-field select.issue-type-select.issue-type-select--task,
.sidebar-field select.issue-type-select.issue-type-select--subtask,
.sidebar-field .issue-type-picker .issue-type-picker__trigger.issue-type-select--task,
.sidebar-field .issue-type-picker .issue-type-picker__trigger.issue-type-select--subtask {
    background: var(--issue-type-task-bg);
    color: var(--issue-type-task-text);
    border-color: transparent;
}

.sidebar-field select.issue-type-select.issue-type-select--bug,
.sidebar-field .issue-type-picker .issue-type-picker__trigger.issue-type-select--bug {
    background: var(--issue-type-bug-bg);
    color: var(--issue-type-bug-text);
    border-color: transparent;
}

.sidebar-field select.issue-type-select.issue-type-select--story,
.sidebar-field .issue-type-picker .issue-type-picker__trigger.issue-type-select--story {
    background: var(--issue-type-story-bg);
    color: var(--issue-type-story-text);
    border-color: transparent;
}

.sidebar-field select.issue-type-select.issue-type-select--epic,
.sidebar-field select.issue-type-select.issue-type-select--custom,
.sidebar-field .issue-type-picker .issue-type-picker__trigger.issue-type-select--epic,
.sidebar-field .issue-type-picker .issue-type-picker__trigger.issue-type-select--custom {
    background: var(--issue-type-epic-bg);
    color: var(--issue-type-epic-text);
    border-color: transparent;
}

.backlog-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ─── Kanban board ─── */
.kanban-board {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 16px 24px 24px;
    min-height: calc(100vh - 220px);
    align-items: stretch;
    overflow-x: auto;
    background: var(--kanban-board-bg);
    border-top: 1px solid var(--border);
}

.kanban-column {
    flex: 1 1 280px;
    min-width: 280px;
    max-width: 360px;
    background: var(--kanban-column-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
    box-shadow: 0 1px 2px rgba(9, 30, 66, 0.08);
}

[data-theme="dark"] .kanban-column {
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.kanban-column-header {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--kanban-column-bg) 88%, var(--text-muted));
}

.kanban-column[data-category="todo"] .kanban-column-header {
    box-shadow: inset 0 3px 0 0 var(--status-todo-bg);
}

.kanban-column[data-category="in_progress"] .kanban-column-header {
    box-shadow: inset 0 3px 0 0 var(--status-progress-text);
}

.kanban-column[data-category="done"] .kanban-column-header {
    box-shadow: inset 0 3px 0 0 var(--status-done-text);
}

.kanban-column-header h3 {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.kanban-column-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--kanban-column-cards-bg);
    border: 1px solid var(--border);
}

.kanban-cards {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 160px;
    background: var(--kanban-column-cards-bg);
}

.kanban-cards.sortable-ghost-over,
.kanban-column.is-drag-over .kanban-cards {
    background: color-mix(in srgb, var(--brand) 6%, var(--kanban-column-cards-bg));
}

.kanban-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: auto;
    min-height: 104px;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 1px rgba(9, 30, 66, 0.13);
    border: 1px solid transparent;
    transition: box-shadow 0.1s, border-color 0.1s;
}

[data-theme="dark"] .kanban-card {
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    border-color: var(--border);
}

.kanban-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 2px 4px rgba(9, 30, 66, 0.13);
}

.kanban-card.sortable-ghost { opacity: 0.4; }
.kanban-card.sortable-drag { cursor: grabbing; }

.kanban-board.is-dragging .kanban-card a {
    pointer-events: none;
}

.kanban-card__handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0 -2px 0 -4px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: grab;
    touch-action: none;
}

.kanban-card__handle:hover {
    background: var(--hover);
    color: var(--text);
}

.kanban-card__handle:active {
    cursor: grabbing;
}

.kanban-card__top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 20px;
}

.kanban-card__key {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
}

.kanban-card__top-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.kanban-card__key:hover { color: var(--brand); text-decoration: none; }

.kanban-card__summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    flex: 0 1 auto;
    min-height: 0;
    max-height: 40px;
    overflow: hidden;
    font-size: 14px;
    color: var(--text);
    line-height: 1.43;
    text-decoration: none;
}

.kanban-card__summary:hover { color: var(--brand); text-decoration: none; }

.kanban-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    min-height: 24px;
    margin-top: auto;
    padding-top: 2px;
}

.kanban-card__assignee {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kanban-card__assignee-empty {
    display: block;
    width: 24px;
    height: 24px;
}

.priority-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    font-size: 14px;
    line-height: 1;
}

.priority-icon i {
    display: block;
    line-height: 1;
}

.priority-icon--highest { color: #DE350B; }
.priority-icon--high { color: #FF5630; }
.priority-icon--medium { color: #FFAB00; }
.priority-icon--low { color: #0065FF; }
.priority-icon--lowest { color: #5E6C84; }

.priority-picker__icon,
.issue-type-picker__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.form-group .priority-picker .user-picker__trigger,
.form-group .issue-type-picker .user-picker__trigger {
    padding: 8px 10px;
    border-width: 2px;
}

/* ─── Forms & modals ─── */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row.form-row--thirds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal[hidden] { display: none; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 16px 48px;
    overflow-y: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 560px;
    max-height: none;
    overflow: visible;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.modal .user-picker__menu {
    z-index: 210;
}

.modal-content--wide {
    max-width: 720px;
    padding: 28px 32px;
}

.modal-content h2 {
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.modal-actions--split {
    justify-content: space-between;
    align-items: center;
}

.modal-actions__primary {
    display: flex;
    gap: 8px;
}

.platform-dialog-modal {
    z-index: 300;
    align-items: center;
    padding-top: 0;
}

.modal-content--confirm {
    max-width: 840px;
    padding: 28px 32px 24px;
    text-align: center;
}

.modal-content--confirm h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.35;
}

.platform-dialog__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.platform-dialog__icon--primary {
    background: rgba(17, 128, 65, 0.12);
    color: var(--brand);
}

.platform-dialog__icon--warning {
    background: rgba(255, 171, 0, 0.15);
    color: #b38600;
}

.platform-dialog__icon--danger {
    background: rgba(222, 53, 11, 0.12);
    color: var(--error);
}

.platform-dialog__message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    margin: 0;
}

.platform-dialog__detail {
    font-size: 13px;
    line-height: 1.45;
    margin: 10px 0 0;
}

.platform-dialog__actions {
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.platform-dialog__actions .btn {
    min-width: 120px;
}

/* ─── Issue detail ─── */
.issue-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    padding: 0 24px 24px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.card h2 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.issue-description { font-size: 14px; }
.issue-description.rich-content { white-space: normal; }

.issue-description--editable {
    cursor: text;
    border-radius: var(--radius);
    padding: 8px 10px;
    margin: -8px -10px;
    min-height: 48px;
    transition: background 0.12s;
}

.issue-description--editable:hover,
.issue-description--editable:focus-visible {
    background: var(--hover);
    outline: none;
}

.rich-editor-host {
    position: relative;
}

.rich-editor-host--description .rich-editor {
    min-height: 140px;
}

.rich-editor {
    min-height: 88px;
    padding: 10px 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    line-height: 1.5;
    overflow-y: auto;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rich-editor:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand);
}

.rich-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.rich-editor__image,
.rich-content__image {
    display: block;
    max-width: min(100%, 560px);
    height: auto;
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.rich-content__figure {
    margin: 0;
}

.rich-content__figure a {
    display: inline-block;
}

.rich-editor__file-link {
    color: var(--brand);
    text-decoration: underline;
}

.comment-item__body.rich-content {
    white-space: normal;
    line-height: 1.5;
}

.issue-description-toolbar {
    margin-top: 8px;
}

/* ─── Comments (Jira-style threaded) ─── */
.card--comments {
    --comment-thread-line: #b3bac5;
    padding: 20px;
}

[data-theme="dark"] .card--comments {
    --comment-thread-line: #596773;
}

.comment-thread {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 16px;
}

.comment-branch {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr;
    column-gap: 12px;
    align-items: stretch;
}

.comment-thread-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

.comment-mention {
    color: var(--brand);
    font-weight: 600;
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    border-radius: 3px;
    padding: 0 2px;
}

.mention-menu {
    position: absolute;
    z-index: 20;
    margin-top: 4px;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.comment-compose__form,
.comment-reply-box form {
    position: relative;
}

.mention-menu__item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.mention-menu__item:hover {
    background: var(--hover);
}

.comment-thread-lines__path {
    fill: none;
    stroke: var(--comment-thread-line);
    stroke-width: 1.5;
    stroke-dasharray: 3 5;
    stroke-linecap: round;
    stroke-opacity: 0.55;
}

[data-theme="dark"] .comment-thread-lines__path {
    stroke-opacity: 0.45;
}

.comment-branch__rail,
.comment-branch__body {
    position: relative;
    z-index: 1;
}

.comment-branch__rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
    padding-top: 2px;
}

.comment-branch__avatar {
    flex-shrink: 0;
}

.comment-branch__body {
    min-width: 0;
}

.comment-branch--nested {
    display: grid;
    grid-template-columns: 40px 1fr;
    column-gap: 12px;
    margin-top: 20px;
}

.comment-replies {
    margin-top: 0;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment-item {
    padding: 0;
}

.comment-item__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin-bottom: 6px;
}

.comment-item__author {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.comment-item__time {
    font-size: 12px;
    color: var(--text-muted);
}

.comment-item__time::before {
    content: '·';
    margin-right: 8px;
    color: var(--text-muted);
    opacity: 0.6;
}

.comment-item__body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-item__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 8px;
}

.comment-item__edited {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.comment-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}

.comment-icon-btn:hover,
.comment-icon-btn.is-active {
    background: var(--hover);
    color: var(--text);
}

.comment-icon-btn.is-active {
    color: var(--brand);
}

.comment-icon-btn__plus {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.comment-react-wrap,
.comment-more-menu {
    position: relative;
}

.comment-emoji-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    z-index: 45;
    display: flex;
    gap: 4px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
}

.comment-emoji-picker__item {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    font-size: 18px;
    cursor: pointer;
}

.comment-emoji-picker__item:hover {
    background: var(--hover);
}

.comment-more-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    z-index: 45;
    min-width: 160px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
}

.comment-more-dropdown__item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    text-align: left;
    cursor: pointer;
}

.comment-more-dropdown__item:hover {
    background: var(--hover);
}

.comment-more-dropdown__item--danger {
    color: var(--error);
}

.comment-reactions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.comment-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
}

.comment-reaction-pill.is-active {
    border-color: var(--brand);
    background: rgba(17, 128, 65, 0.12);
}

.comment-reaction-pill--like {
    cursor: default;
}

.comment-edit-box {
    margin-top: 8px;
}

.comment-branch--highlight {
    animation: comment-highlight 2s ease;
}

@keyframes comment-highlight {
    0%, 100% { background: transparent; }
    20% { background: rgba(17, 128, 65, 0.08); }
}

.comment-reply-box {
    margin-top: 10px;
}

.comment-reply-box textarea {
    display: block;
    width: 100%;
    min-height: 64px;
    padding: 8px 10px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    line-height: 1.5;
    resize: vertical;
}

.comment-reply-box textarea:focus {
    outline: none;
    border-color: var(--brand);
}

.comment-reply-box__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.comment-compose {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    padding-top: 20px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
}

.comment-compose__avatar {
    padding-top: 6px;
}

.comment-compose__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.comment-compose__form textarea {
    display: block;
    width: 100%;
    min-height: 88px;
    padding: 10px 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.comment-compose__form textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand);
}

.comment-compose__form textarea::placeholder {
    color: var(--text-muted);
}

.comment-compose__toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-compose__hint {
    font-size: 12px;
}

.comment-reply-form .comment-compose__hint {
    display: none;
}

.comment-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.comment-attach-btn:hover {
    background: var(--hover);
    color: var(--text);
}

.comment-attachments-pending {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-pending__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    font-size: 12px;
}

.comment-pending__thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.comment-pending__icon {
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.comment-pending__name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comment-pending__size {
    color: var(--text-muted);
    flex-shrink: 0;
}

.comment-pending__remove {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
}

.comment-pending__remove:hover {
    color: var(--error);
}

.comment-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.comment-attachment--image {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 280px;
}

.comment-attachment--image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.comment-attachment--file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}

.comment-attachment--file:hover {
    background: var(--hover);
}

.comment-attachment__size {
    color: var(--text-muted);
    font-size: 12px;
}

.comment-compose__actions {
    display: flex;
    justify-content: flex-end;
}

/* ─── Profile page ─── */
.profile-page {
    padding: 0 24px 24px;
}

.profile-card {
    display: grid;
    grid-template-columns: 200px 1fr minmax(240px, 320px);
    gap: 40px 48px;
    align-items: start;
    padding: 32px;
    width: 100%;
}

.profile-card__avatar {
    text-align: center;
}

.profile-avatar-preview {
    margin-bottom: 12px;
}

.profile-card__hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.profile-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.profile-section-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.profile-card__upload {
    min-width: 0;
    padding-right: 48px;
    border-right: 1px solid var(--border);
}

.profile-card__info {
    min-width: 0;
}

.profile-info-list {
    margin: 0;
}

.profile-info-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.profile-info-item:first-child { padding-top: 0; }
.profile-info-item:last-child { border-bottom: none; padding-bottom: 0; }

.profile-info-item dt {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.profile-info-item dd {
    font-size: 14px;
    color: var(--text);
    margin: 0;
}

.profile-upload-form__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-message {
    margin-top: 12px;
    font-size: 14px;
}

.profile-message--success { color: var(--success, #00875a); }
.profile-message--error { color: var(--error); }

@media (max-width: 960px) {
    .profile-card {
        grid-template-columns: 160px 1fr;
    }

    .profile-card__info {
        grid-column: 1 / -1;
        padding-top: 24px;
        border-top: 1px solid var(--border);
    }

    .profile-card__upload {
        padding-right: 0;
        border-right: none;
    }
}

@media (max-width: 640px) {
    .profile-card {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px;
    }

    .profile-card__avatar {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-card__upload {
        padding-right: 0;
        border-right: none;
    }

    .profile-card__info {
        padding-top: 0;
        border-top: none;
    }
}

.issue-meta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.issue-meta dt { color: var(--text-muted); margin-top: 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.issue-meta dd { margin-top: 2px; }

.issue-meta__user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-picker {
    position: relative;
}

.user-picker__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    text-align: left;
    cursor: pointer;
}

.user-picker__trigger:hover {
    background: var(--hover);
}

.user-picker__avatar {
    flex-shrink: 0;
    display: flex;
}

.user-picker__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-picker__chevron {
    flex-shrink: 0;
    color: var(--text-muted);
}

.user-picker__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 240px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
    padding: 4px;
}

.user-picker__option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    text-align: left;
    cursor: pointer;
}

.user-picker__option:hover,
.user-picker__option:focus-visible {
    background: var(--hover);
    outline: none;
}

.user-picker__option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb {
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    padding: 16px 24px 0;
}

.breadcrumb:hover { color: var(--brand); }

/* ─── Issue page shell ─── */
.issue-shell {
    min-height: calc(100vh - 0px);
}

.issue-header {
    padding: 20px 24px 0;
}

.issue-header__nav {
    margin-bottom: 4px;
}

.issue-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
}

.issue-breadcrumb:hover {
    color: var(--brand);
}

.issue-breadcrumb:hover .project-key {
    color: var(--brand);
}

.issue-breadcrumb__sep {
    opacity: 0.5;
}

.issue-parent-link {
    margin: 0 0 12px;
    padding: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.issue-parent-link a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.issue-parent-link a:hover {
    text-decoration: underline;
}

.issue-parent-link__summary {
    color: var(--text-muted);
}

.issue-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 16px;
    flex-wrap: wrap;
}

.issue-detail-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.issue-header__labels {
    padding-bottom: 16px;
}

.issue-header__labels .issue-labels {
    margin-bottom: 0;
}

.issue-page-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 20px;
    font-weight: 500;
    flex: 1;
    min-width: 200px;
    line-height: 1.3;
    margin: 0;
}

.issue-summary-display {
    word-break: break-word;
}

.issue-summary-display--editable {
    cursor: text;
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
    transition: background 0.12s;
}

.issue-summary-display--editable:hover,
.issue-summary-display--editable:focus-visible {
    background: var(--hover);
    outline: none;
}

.issue-summary-input {
    flex: 1;
    min-width: 160px;
    font: inherit;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--brand);
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
}

.issue-summary-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.project-key-inline {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    flex-shrink: 0;
}

.text-muted { color: var(--text-muted); }

.alert {
    padding: 10px 12px;
    border-radius: var(--radius);
    margin: 0 24px 16px;
    font-size: 14px;
}

.alert-error { background: rgba(222, 53, 11, 0.1); color: var(--error); border: 1px solid rgba(222, 53, 11, 0.3); }
.alert-success { background: var(--status-done-bg); color: var(--status-done-text); border: 1px solid transparent; }

/* ─── Admin settings ─── */
.admin-settings {
    margin: 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-settings__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.admin-settings__logo-block {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 24px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    align-items: start;
}

.admin-settings__logo-label {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.admin-settings__logo-preview {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.sidebar-brand__preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
}

[data-theme="dark"] .sidebar-brand__preview {
    color: var(--sidebar-active-text);
}

.admin-settings__logo-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-top: 28px;
}

.admin-settings__logo-hint {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.admin-settings__mail-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    width: 100%;
}

.admin-settings__mail-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px 14px;
    margin-bottom: 12px;
}

.admin-settings__mail-form .mail-field--from-email { grid-column: span 8; }
.admin-settings__mail-form .mail-field--from-name { grid-column: span 4; }
.admin-settings__mail-form .mail-field--host { grid-column: span 6; }
.admin-settings__mail-form .mail-field--port { grid-column: span 2; }
.admin-settings__mail-form .mail-field--encryption { grid-column: span 4; }
.admin-settings__mail-form .mail-field--user { grid-column: span 6; }
.admin-settings__mail-form .mail-field--password { grid-column: span 6; }
.admin-settings__mail-form .mail-field--test-line {
    grid-column: span 12;
}

.mail-test-inline {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.mail-test-inline input {
    flex: 1 1 auto;
    min-width: 0;
}

.mail-test-inline .btn {
    flex: 0 0 auto;
    align-self: stretch;
    min-width: 140px;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    box-sizing: border-box;
}

.admin-settings__mail-save {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.admin-settings__mail-save .btn {
    width: auto;
}

.admin-settings__mail-save .btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.admin-settings__seed-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.admin-settings__seed-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px 20px;
}

.admin-settings__seed-dest {
    flex: 1 1 240px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-settings__seed-dest-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.admin-settings__seed-dest-value {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.admin-settings__seed-dest-hint {
    font-size: 12px;
    font-weight: 400;
}

.admin-settings__seed-count {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.admin-settings__seed-inline {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.admin-settings__seed-inline input {
    flex: 0 0 140px;
    width: 140px;
    min-width: 0;
}

.admin-settings__seed-inline .btn {
    flex: 0 0 auto;
    align-self: stretch;
    min-width: 200px;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    box-sizing: border-box;
}

.admin-settings__seed-inline .btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

#seed-feedback {
    margin-top: 12px;
}

#mail-settings-feedback {
    margin-bottom: 12px;
}

#mail-settings-feedback.alert-info {
    background: rgba(17, 128, 65, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
}

@media (max-width: 720px) {
    .admin-settings__mail-grid {
        grid-template-columns: 1fr;
    }

    .admin-settings__mail-form .mail-field[class*="mail-field--"] {
        grid-column: span 1;
        max-width: none;
    }

    .admin-settings__seed-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-settings__seed-dest {
        flex: 1 1 auto;
    }

    .admin-settings__seed-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-settings__seed-inline input {
        flex: 1 1 auto;
        width: 100%;
    }

    .admin-settings__seed-inline .btn {
        width: 100%;
        min-width: 0;
    }

    .mail-test-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .mail-test-inline .btn {
        width: 100%;
        min-width: 0;
    }
}

.admin-settings__card--danger {
    border-color: rgba(222, 53, 11, 0.35);
}

.admin-settings__card h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
}

.admin-settings__card h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.admin-settings__desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.admin-settings__card-header .admin-settings__desc + .admin-settings__desc {
    margin-top: 8px;
}

.admin-settings__danger-block {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.admin-settings__impact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.admin-settings__modal-list {
    margin: 12px 0 16px;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.admin-settings__confirm-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0 0;
    font-size: 14px;
    cursor: pointer;
}

.admin-settings__confirm-check input {
    margin-top: 3px;
}

.admin-settings__phrase {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--surface-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--error);
}

@media (max-width: 768px) {
    .admin-settings__logo-block,
    .admin-settings__danger-block {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .admin-settings__logo-actions {
        padding-top: 0;
    }

    .admin-settings__danger-block {
        align-items: stretch;
    }
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    margin: 0 24px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-state h2 { margin-bottom: 8px; font-weight: 500; }
.empty-state p { color: var(--text-muted); margin-bottom: 16px; }

/* Auth portal (login / install): ver css/auth-portal.css */

.status-active { color: var(--success); font-weight: 600; }
.status-inactive { color: var(--error); font-weight: 600; }

.badge {
    background: var(--surface-raised);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.data-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface-muted);
}

.page-header {
    display: flex;
    justify-content: space-between;
    padding: 24px;
    align-items: flex-start;
}

@media (max-width: 768px) {
    html:not(.sidebar-collapsed) .app-sidebar {
        width: var(--sidebar-width-collapsed);
    }

    html:not(.sidebar-collapsed) .sidebar-brand__text,
    html:not(.sidebar-collapsed) .sidebar-link__label,
    html:not(.sidebar-collapsed) .sidebar-user-trigger__info,
    html:not(.sidebar-collapsed) .sidebar-user-trigger__chevron {
        display: none;
    }

    html:not(.sidebar-collapsed) .user-dropdown {
        left: calc(100% + 8px);
        bottom: 0;
        right: auto;
        width: 240px;
    }

    html:not(.sidebar-collapsed) .sidebar-link {
        justify-content: center;
    }
}

/* ─── Issue enhancements ─── */
.issue-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.issue-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: -1px;
}

.issue-tab.is-active {
    color: var(--text);
    border-bottom-color: var(--brand);
}

.issue-tab-panel[hidden] { display: none; }

.activity-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.activity-item__text {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.5;
}

.activity-item__time {
    font-size: 12px;
    color: var(--text-muted);
}

.issue-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.issue-section-header h2 { margin: 0; }

.issue-watch-btn.is-watching {
    color: var(--brand);
    border-color: var(--brand);
}

.issue-labels, .label-editor__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.issue-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    background: color-mix(in srgb, var(--label-color, #6554c0) 18%, transparent);
    color: var(--label-color, #6554c0);
    border: 1px solid color-mix(in srgb, var(--label-color, #6554c0) 35%, transparent);
}

.issue-label--removable { cursor: pointer; }

.label-create {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.label-create input {
    flex: 1;
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

.subtask-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.subtask-item__key {
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}

.subtask-item__summary {
    flex: 1;
    color: var(--text);
    text-decoration: none;
}

.subtask-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.subtask-form input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

/* ─── Adjuntos estilo Jira ─── */

.attachments-panel__header {
    margin-bottom: 0;
}

.attachments-panel__title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.attachments-panel__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 2px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 0;
}

.attachments-panel__toggle svg {
    display: block;
    width: 14px;
    height: 14px;
}

.attachments-panel__toggle:hover {
    color: var(--text);
}

.attachments-panel.is-collapsed .attachments-panel__toggle svg {
    transform: rotate(-90deg);
}

.attachments-panel.card h2.attachments-panel__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.attachments-panel__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--text-muted) 18%, var(--surface));
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.attachments-panel__actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.attachments-panel__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.attachments-panel__action:hover {
    background: var(--hover);
    color: var(--text);
}

.attachments-panel__body {
    margin-top: 12px;
}

.attachments-panel.is-collapsed .attachments-panel__body {
    display: none;
}

.attachments-panel__empty {
    margin: 0;
    font-size: 13px;
}

.attachment-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.attachment-card-wrap {
    position: relative;
    width: 144px;
    flex-shrink: 0;
}

.attachment-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: color-mix(in srgb, var(--text) 6%, var(--surface));
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.attachment-card:hover {
    border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

.attachment-card__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 96px;
    background: color-mix(in srgb, var(--text) 4%, var(--bg));
    overflow: hidden;
}

.attachment-card__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.attachment-card__file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 36px;
    color: var(--text-muted);
}

.attachment-card__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: color-mix(in srgb, var(--text) 10%, var(--surface));
    min-height: 52px;
}

[data-theme="dark"] .attachment-card__info {
    background: color-mix(in srgb, #000 35%, var(--surface));
}

.attachment-card__name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.attachment-card__date {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

.attachment-card__delete {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}

.attachment-card-wrap:hover .attachment-card__delete,
.attachment-card__delete:focus-visible {
    opacity: 1;
}

.attachment-card__delete:hover {
    background: rgba(222, 53, 11, 0.9);
}

.inline-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.sidebar-field {
    margin-bottom: 14px;
}

.sidebar-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sidebar-field select,
.sidebar-field input[type="text"],
.sidebar-field input[type="date"],
.issue-inline-field {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
}

.issue-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.issue-filters--inline {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.issue-filters--inline .filter-select {
    flex-shrink: 0;
}

.issue-filters--inline .issue-filters__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.project-view-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 12px 24px 0;
}

.project-view-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-releases__toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.filter-select {
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
}

.my-issue-summary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.my-issues-tabs { margin-bottom: 16px; }

.my-issues-table th:nth-child(1),
.my-issues-table td.my-issues__priority {
    width: 56px;
    text-align: center;
}

.my-issues-table th:nth-child(2),
.my-issues-table td.my-issues__type {
    width: 44px;
    text-align: center;
}

.my-issues-table th:nth-child(3),
.my-issues-table td:nth-child(3) {
    width: 88px;
}

.my-issues-table th:nth-child(7),
.my-issues-table td.my-issues__assignee {
    width: 56px;
    text-align: center;
}

.my-issues__type .issue-type-icon {
    margin: 0 auto;
}

.my-issues__assignee .avatar {
    margin: 0 auto;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--error {
    border-color: #ff5630;
    color: #ff5630;
}

.toast--success { color: var(--brand); }

.status-pill--sm {
    font-size: 11px;
    padding: 2px 8px;
}

/* ─── Admin workflow ─── */
.workflow-panel {
    padding: 16px 24px 24px;
}

.workflow-panel .jira-panel {
    margin: 0;
}

.workflow-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.workflow-panel__header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.workflow-hint {
    margin: 0 0 16px;
    font-size: 13px;
}

.workflow-panel .jira-table th,
.workflow-panel .jira-table td {
    padding: 12px 16px;
}

.workflow-panel .jira-table th:first-child,
.workflow-panel .jira-table td:first-child {
    padding-left: 20px;
}

.workflow-panel .jira-table th:last-child,
.workflow-panel .jira-table td:last-child {
    padding-right: 20px;
}

.workflow-table__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.workflow-panel .badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.form-hint {
    margin: 4px 0 0;
    font-size: 12px;
}

.notification-settings {
    margin: 0 24px 24px;
}

.notification-settings__card {
    width: 100%;
    padding: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.notification-settings__intro {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.notification-settings__intro p {
    margin: 0;
}

.notification-settings__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification-settings__item + .notification-settings__item {
    border-top: 1px solid var(--border);
}

.notification-settings__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    cursor: pointer;
}

.notification-settings__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.notification-settings__label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.notification-settings__desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.notification-settings__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
}

.notification-settings__message {
    margin: 0;
    font-size: 14px;
}

.notification-settings__message--success {
    color: var(--brand);
}

.notification-settings__message--error {
    color: var(--error);
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch__track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: var(--border-strong);
    transition: background 0.15s ease;
}

.toggle-switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease;
}

.toggle-switch input:checked + .toggle-switch__track {
    background: var(--brand);
}

.toggle-switch input:checked + .toggle-switch__track::after {
    transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-switch__track {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.profile-card__notifications {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .issue-layout { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .kanban-board { overflow-x: auto; padding-bottom: 16px; }
    .kanban-column { flex: 0 0 280px; min-width: 280px; }
    .issue-row__link {
        grid-template-columns: 20px 72px 1fr;
        grid-template-rows: auto auto;
    }
    .issue-row__link .status-pill,
    .issue-row__link .avatar { display: none; }
}

.read-only-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--brand) 12%, var(--surface));
    color: var(--text);
    font-size: 13px;
}

.issue-actions-menu { position: relative; }

.issue-actions-menu__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    z-index: 20;
    padding: 4px;
}

.issue-actions-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
}

.issue-actions-menu__item:hover { background: var(--hover); }

.issue-actions-menu__item--danger { color: #de350b; }

.issue-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.issue-link-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.issue-link-item:last-child { border-bottom: none; }

.issue-link-item__type {
    font-size: 12px;
    color: var(--text-muted);
}

.issue-link-item__key {
    font-weight: 600;
    font-size: 12px;
}

.issue-link-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
}

.issue-link-form .inline-edit-actions {
    grid-column: 1 / -1;
}

.saved-filters,
.board-quick-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-filter-chip {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

.quick-filter-chip.is-active,
.quick-filter-chip:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.swimlane-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 8px 4px 4px;
}

.kanban-board--readonly .kanban-card__handle { display: none; }

.user-picker.is-readonly .user-picker__trigger {
    pointer-events: none;
    opacity: 0.7;
}

.workflow-transitions-wrap { overflow-x: auto; }

.workflow-transitions th,
.workflow-transitions td {
    text-align: center;
    white-space: nowrap;
}

.workflow-transitions th[scope="row"] {
    text-align: left;
}

/* ─── Project summary ─── */
.project-summary {
    padding: 20px 24px 24px;
}

.summary-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.summary-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    margin-bottom: 0;
}

.summary-kpi__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.summary-kpi__value {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text);
}

.summary-kpi__hint {
    font-size: 12px;
}

.summary-kpi--warning {
    border-color: color-mix(in srgb, #ff991f 35%, var(--border));
}

.summary-kpi--warning .summary-kpi__value {
    color: #ff991f;
}

.summary-kpi--danger {
    border-color: color-mix(in srgb, #de350b 35%, var(--border));
}

.summary-kpi--danger .summary-kpi__value {
    color: #de350b;
}

.summary-kpi--brand {
    border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}

.summary-kpi--brand .summary-kpi__value {
    color: var(--brand);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.summary-panel {
    margin-bottom: 0;
}

.summary-panel--wide {
    grid-column: 1 / -1;
}

.summary-panel__title {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.summary-status-list,
.summary-assignee-list,
.summary-issue-list,
.summary-epic-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.summary-status-item + .summary-status-item {
    margin-top: 10px;
}

.summary-status-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.summary-status-item__bar {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-muted);
    overflow: hidden;
}

.summary-status-item__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: color-mix(in srgb, var(--brand) 75%, #6554C0);
}

.summary-assignee-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
}

.summary-assignee-item:first-child {
    border-top: none;
    padding-top: 0;
}

.summary-assignee-item__name {
    font-size: 14px;
}

.summary-assignee-item__count {
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--surface-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.summary-issue-list li + li {
    border-top: 1px solid var(--border);
}

.summary-issue-link {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: inherit;
    text-decoration: none;
}

.summary-issue-link:hover {
    color: var(--brand);
    text-decoration: none;
}

.summary-issue-link__key {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.summary-issue-link__summary {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-epic-item {
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.summary-epic-item:first-child {
    border-top: none;
    padding-top: 0;
}

.summary-epic-item__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: inherit;
    text-decoration: none;
}

.summary-epic-item__head:hover {
    color: var(--brand);
    text-decoration: none;
}

.summary-epic-item__key {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.summary-epic-item__summary {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 960px) {
    .summary-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Closed sprint history ─── */
.backlog-panel--closed-sprints {
    margin-top: 0;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--text) 2%, var(--surface));
}

.closed-sprint-history__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    list-style: none;
    background: var(--surface-muted);
    border-bottom: 1px solid transparent;
}

.closed-sprint-history__summary::-webkit-details-marker {
    display: none;
}

.closed-sprint-history[open] > .closed-sprint-history__summary {
    border-bottom-color: var(--border);
}

.closed-sprint-history[open] .closed-sprint-history__toggle svg {
    transform: rotate(0deg);
}

.closed-sprint-history:not([open]) .closed-sprint-history__toggle svg {
    transform: rotate(-90deg);
}

.closed-sprint-history__toggle {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
}

.closed-sprint-list {
    padding: 8px 12px 12px;
}

.closed-sprint-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.closed-sprint-item + .closed-sprint-item {
    margin-top: 8px;
}

.closed-sprint-item__summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
}

.closed-sprint-item__summary::-webkit-details-marker {
    display: none;
}

.closed-sprint-item__summary::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid var(--text-muted);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.closed-sprint-item[open] > .closed-sprint-item__summary::before {
    transform: rotate(90deg);
}

.closed-sprint-item__name {
    font-size: 13px;
    font-weight: 600;
}

.closed-sprint-item__closed-at,
.closed-sprint-item__stat {
    font-size: 12px;
}

.closed-sprint-item__stat {
    margin-left: auto;
}

.closed-sprint-item__body {
    padding: 0 12px 12px 24px;
    font-size: 13px;
}

.closed-sprint-item__meta,
.closed-sprint-item__goal,
.closed-sprint-item__points,
.closed-sprint-item__note {
    margin: 0 0 8px;
}

.closed-sprint-item__meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.closed-sprint-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.closed-sprint-progress__track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-muted);
    overflow: hidden;
}

.closed-sprint-progress__track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: color-mix(in srgb, var(--brand) 80%, #00875a);
}

.closed-sprint-progress__label {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.summary-closed-sprint-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.summary-closed-sprint-item {
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.summary-closed-sprint-item:first-child {
    border-top: none;
    padding-top: 0;
}

.summary-closed-sprint-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Versiones */
.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    background: rgba(17, 128, 65, 0.12);
    color: var(--brand);
    border: 1px solid rgba(17, 128, 65, 0.25);
}

.version-badge--released {
    background: rgba(107, 119, 140, 0.12);
    color: var(--text-muted);
    border-color: rgba(107, 119, 140, 0.25);
}

.version-badge--xs {
    font-size: 11px;
    padding: 1px 6px;
}

.version-badge--removable {
    cursor: pointer;
}

.version-editor__tags,
.issue-row__versions,
.kanban-card__versions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.version-editor select {
    margin-top: 8px;
    width: 100%;
}

.version-create {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.version-create input {
    flex: 1;
    min-width: 0;
}

.version-badge--affected {
    background: rgba(101, 84, 192, 0.12);
    color: #6554c0;
    border-color: rgba(101, 84, 192, 0.25);
}

.issue-header__versions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.summary-panel__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.summary-panel__title-row .summary-panel__title {
    margin-bottom: 0;
}

.summary-version-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.summary-version-item {
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.summary-version-item:first-child {
    border-top: none;
    padding-top: 0;
}

.summary-version-item__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.summary-version-item__meta {
    margin: 0;
    font-size: 13px;
}

.version-detail__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.project-list__panel {
    margin: 0 24px 24px;
    overflow-x: auto;
}

.project-list__table {
    table-layout: fixed;
    width: 100%;
}

.project-list__table th:nth-child(1),
.project-list__table td:nth-child(1) {
    width: 56px;
    text-align: center;
}

.project-list__table th:nth-child(2),
.project-list__table td:nth-child(2) {
    width: 44px;
    text-align: center;
}

.project-list__table th:nth-child(3),
.project-list__table td:nth-child(3) {
    width: 88px;
}

.project-list__table th:nth-child(5),
.project-list__table td:nth-child(5) {
    width: 118px;
}

.project-list__table th:nth-child(6),
.project-list__table td:nth-child(6) {
    width: 56px;
    text-align: center;
}

.project-list__table th:nth-child(7),
.project-list__table td:nth-child(7) {
    width: 108px;
}

.project-list__table th:nth-child(8),
.project-list__table td:nth-child(8) {
    width: 52px;
    text-align: center;
}

.project-list__table th:nth-child(9),
.project-list__table td:nth-child(9) {
    width: 128px;
}

.project-list__table th,
.project-list__table td {
    overflow: hidden;
}

.project-list__table td:nth-child(7),
.project-list__table td:nth-child(9) {
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-list__priority,
.project-list__assignee .avatar {
    text-align: center;
}

.project-list__assignee .avatar {
    margin: 0 auto;
}

.project-list__type {
    vertical-align: middle;
}

.project-list__type .issue-type-icon {
    margin: 0 auto;
}

.project-list__summary-cell {
    overflow: hidden;
}

.project-list__table th:nth-child(5),
.project-list__table td:nth-child(5) {
    padding-right: 8px;
}

.project-list__table td:nth-child(5) .status-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.project-list__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 4px;
    align-items: start;
    min-width: 0;
}

.project-list__summary-body {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.project-list__summary-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}

.project-list__summary-meta {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.project-list__row--subtask .issue-row__key {
    padding-left: 8px;
}

.project-list__labels,
.project-list__versions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.project-list__summary-meta .issue-label--xs {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
    white-space: nowrap;
}

.project-list__sprint,
.project-list__points,
.project-list__updated {
    white-space: nowrap;
    font-size: 13px;
}

.project-list__points {
    text-align: center;
    color: var(--text-muted);
}

.project-releases {
    padding: 20px 24px 24px;
}

.project-releases__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.project-releases__intro h2 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: normal;
}

.project-releases__intro p {
    margin: 0;
    font-size: 14px;
    max-width: 640px;
}

.project-releases__layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    min-height: min(560px, calc(100vh - 280px));
}

.project-releases__sidebar,
.project-releases__detail {
    margin-bottom: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.project-releases__sidebar {
    overflow: auto;
}

.project-releases__group {
    padding: 16px 16px 12px;
}

.project-releases__group + .project-releases__group {
    border-top: 1px solid var(--border);
}

.project-releases__group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.project-releases__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--surface-muted);
    color: var(--text-muted);
}

.project-releases__empty {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.project-releases__empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 320px;
    margin-bottom: 0;
    padding: 40px 24px;
    text-align: center;
}

.project-releases__empty-state h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.project-releases__empty-state p {
    margin: 0;
    max-width: 420px;
    font-size: 14px;
}

.project-releases__empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand) 14%, transparent);
    color: var(--brand);
    font-size: 22px;
}

.version-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.version-list__item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.version-list__item:hover,
.version-list__item.is-active {
    background: color-mix(in srgb, var(--brand) 10%, transparent);
    border-color: color-mix(in srgb, var(--brand) 22%, transparent);
}

.version-list__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.version-list__name {
    font-weight: 600;
    color: var(--text);
}

.version-list__date,
.version-list__meta {
    font-size: 12px;
    color: var(--text-muted);
}

.project-releases__detail .project-releases__placeholder,
.project-releases__detail .version-detail {
    flex: 1;
    padding: 24px;
}

.project-releases__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    color: var(--text-muted);
}

.project-releases__placeholder i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 22px;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 14%, transparent);
}

.project-releases__placeholder p {
    margin: 0;
    max-width: 360px;
    font-size: 14px;
    line-height: 1.5;
}

.version-detail__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.version-detail__header h3 {
    margin: 0 0 8px;
}

.version-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.version-detail__notes,
.version-detail__section {
    margin-top: 20px;
}

.version-detail__notes h4,
.version-detail__section h4 {
    margin: 0 0 8px;
    font-size: 14px;
}

.version-detail__notes-body {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    line-height: 1.5;
    white-space: pre-wrap;
}

.version-detail__issues {
    list-style: none;
    margin: 0;
    padding: 0;
}

.version-detail__issue {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid var(--border);
}

.version-detail__issue:first-child {
    border-top: none;
}

.version-detail__issue a {
    font-weight: 600;
    white-space: nowrap;
}

.btn-danger-text {
    color: #de350b;
}

@media (max-width: 900px) {
    .project-releases__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .project-releases__layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .project-releases__detail {
        min-height: 280px;
    }
}
