* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Form controls don't inherit font by default — make them match the UI */
button,
input,
select,
textarea {
    font-family: inherit;
}

/* Login page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(90deg, #0f0f3d 0%, #1a0f4d 25%, #6b2d7d 50%, #a61e8f 75%, #ff6b5b 100%);
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.login-card h1 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #7f8c8d;
    margin-bottom: 24px;
}

.login-error {
    background: #ffe5e5;
    color: #e74c3c;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.google-btn:hover {
    border-color: #667eea;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.25);
}

.google-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

/* User badge in header */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2c3e50;
}

.user-badge img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.logout-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.logout-link:hover {
    text-decoration: underline;
}

body.dark-mode .user-badge {
    color: #d4d4d4;
}

body.dark-mode .logout-link {
    color: #007acc;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #eceef2;
    min-height: 100vh;
    padding: 20px;
}

/* Generic floating box. Scoped to .container's direct children because
   Jira-rendered comment HTML also uses class="panel" ({noformat} blocks). */
.container > .panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 16px 24px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 22px;
}

/* Brand block (left) */
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.title-bar h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.brand-sub {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* Toolbar (right): search + filter + actions */
.toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Keep search, refresh and theme toggle on one line */
.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

/* Compact search (#5) */
.search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #e4e7ec;
    color: #5f6b76;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-clear:hover {
    background: #cfd4dc;
    color: #2c3e50;
}

.search-clear.hidden {
    display: none;
}

body.dark-mode .search-clear {
    background: #555;
    color: #d4d4d4;
}

body.dark-mode .search-clear:hover {
    background: #6a6a6a;
}

.search-input {
    width: 210px;
    height: 38px;
    padding: 0 34px 0 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #2c3e50;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8c8d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='20' y1='20' x2='16.5' y2='16.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 16px 16px;
    transition: border-color 0.2s ease, width 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    width: 250px;
}

/* Filter dropdown popover (#6) */
.filter-dropdown {
    position: relative;
}

.filter-dropdown .filters-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 300px;
    margin: 0;
    z-index: 50;
}

.filter-dropdown .filters-panel-content {
    flex-direction: column;
    gap: 10px;
}

.filter-dropdown .filter-group {
    min-width: 0;
}

/* Active filters as a thin floating row (chips only, no panel box) */
.active-filters-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.active-filters-bar:has(.filter-chip),
.active-filters-bar:has(.clear-filters-btn:not(.hidden)) {
    margin-bottom: 20px;
}

.user-meta {
    font-size: 13px;
    color: #7f8c8d;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta strong {
    color: #2c3e50;
    font-weight: 600;
}

body.dark-mode .user-meta {
    color: #a0a0a0;
}

body.dark-mode .user-meta strong {
    color: #d4d4d4;
}

/* Standalone filter row under the title (outside any panel box) */
.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* In-panel group selector for the reporter chart */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.chart-header .chart-title {
    margin-bottom: 0;
}

.panel-toggle {
    height: 32px;
    padding: 0 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.panel-toggle:hover,
.panel-toggle:focus {
    outline: none;
    border-color: #667eea;
    color: #667eea;
}

body.dark-mode .panel-toggle {
    background: #3e3e42;
    color: #d4d4d4;
    border-color: #555;
}

body.dark-mode .panel-toggle:hover,
body.dark-mode .panel-toggle:focus {
    border-color: #007acc;
    color: #007acc;
}

.search-container {
    position: relative;
}

.board {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 15px;
    min-height: 600px;
}

.column {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #f0f0f0;
}

.column-header h2 {
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
}

.column-header .count {
    background: #c9189f;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Priority-specific colors */
.column[data-priority="Lowest"] .column-header h2 {
    color: #3498db;
}

.column[data-priority="Lowest"] .column-header {
    border-bottom-color: #3498db;
}

.column[data-priority="Low"] .column-header h2 {
    color: #5dade2;
}

.column[data-priority="Low"] .column-header {
    border-bottom-color: #5dade2;
}

.column[data-priority="Medium"] .column-header h2 {
    color: #f39c12;
}

.column[data-priority="Medium"] .column-header {
    border-bottom-color: #f39c12;
}

.column[data-priority="High"] .column-header h2 {
    color: #e67e22;
}

.column[data-priority="High"] .column-header {
    border-bottom-color: #e67e22;
}

.column[data-priority="Critical"] .column-header h2 {
    color: #e74c3c;
}

.column[data-priority="Critical"] .column-header {
    border-bottom-color: #e74c3c;
}

.column[data-priority="Highest"] .column-header h2 {
    color: #c0392b;
}

.column[data-priority="Highest"] .column-header {
    border-bottom-color: #c0392b;
}

.cards-container {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
}

.card {
    position: relative;
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* "Developer Feedback" attention badge: [ 3d ] [chat icon], top-right */
.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #34495e;
    pointer-events: none;
}

/* Age pill sits to the LEFT of the icon. Renders as a plain pulsing dot
   until the day count loads, then expands to e.g. "3d". */
.card-badge-age {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    padding: 0 6px;
    background: #e02424;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 8px;
    animation: badge-pulse 1.8s ease-in-out infinite;
    pointer-events: auto;
}

.card-badge-age:empty {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224, 36, 36, 0.55); }
    50% { box-shadow: 0 0 0 5px rgba(224, 36, 36, 0); }
}

body.dark-mode .card-badge {
    color: #d4d4d4;
}

body.dark-mode .card-badge-age {
    background: #d64545;
    color: #ffffff;
}

.card:active {
    cursor: grabbing;
}

.card.dragging {
    cursor: grabbing;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
}

.card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.card.hidden {
    display: none;
}

.card-id {
    font-weight: bold;
    color: #667eea;
    font-size: 16px;
    margin-bottom: 8px;
}

.card-id a {
    text-decoration: none;
    font-weight: bold;
}

.card-summary {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 12px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.card-details {
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

.card-detail {
    font-size: 15px;
    color: #7f8c8d;
    margin-bottom: 5px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.card-detail strong {
    color: #34495e;
    min-width: 70px;
    flex-shrink: 0;
}

.card-detail span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

/* Netloc can be a long URL — keep it on one line and truncate with an ellipsis
   so it never spills out of the card (card/column size is unaffected). */
.card-netloc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .card-detail strong {
    color: #d4d4d4;
}

.cards-container.drag-over {
    background: rgba(102, 126, 234, 0.1);
    border: 2px dashed #667eea;
    border-radius: 8px;
}

.card.drag-over-card {
    border-top: 3px solid #667eea;
}

body.dark-mode .card.drag-over-card {
    border-top: 3px solid #007acc;
}

.drop-indicator {
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
        transform: scaleY(1);
    }
    50% {
        opacity: 1;
        transform: scaleY(1.2);
    }
}

body.dark-mode .drop-indicator {
    background: linear-gradient(90deg, #007acc 0%, #005a9e 100%);
    box-shadow: 0 2px 8px rgba(0, 122, 204, 0.5);
}

/* ID selectors on purpose: Jira-rendered comment HTML uses class="error"
   (failed macros) and similar generic class names — class selectors here
   would bleed into the modal's rich text. */
#loading,
#error {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#error {
    color: #e74c3c;
    background: #ffe5e5;
}

#loading {
    color: #667eea;
}

/* Responsive design */
@media (max-width: 1400px) {
    .board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .board {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Dark mode toggle switch */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-checkbox {
    display: none;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-label .toggle-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 24px;
}

.toggle-label .toggle-switch {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: left 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked + .toggle-label {
    background-color: #667eea;
}

.toggle-checkbox:checked + .toggle-label .toggle-switch {
    left: 26px;
}

/* Dark mode styles */
body.dark-mode {
    background: linear-gradient(90deg, #000000 0%, #1e1e1e 100%);
    color: #d4d4d4;
}

body.dark-mode .container > .panel {
    background: #252526;
    color: #d4d4d4;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .title-bar h1 {
    color: #d4d4d4;
}

body.dark-mode .brand-sub {
    color: #a0a0a0;
}

body.dark-mode .search-input {
    background-color: #3e3e42;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='20' y1='20' x2='16.5' y2='16.5'/%3E%3C/svg%3E");
    color: #d4d4d4;
    border-color: #555;
}

body.dark-mode .search-input:focus {
    border-color: #007acc;
}

body.dark-mode .column {
    background: #252526;
}

body.dark-mode .column-header {
    background: #252526;
}

body.dark-mode .column-header h2 {
    color: #d4d4d4;
}

body.dark-mode .column-header .count {
    background: #3e3e42;
    color: #d4d4d4;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .cards-container {
    background: #252526;
}

body.dark-mode .card {
    background: #3e3e42;
    color: #d4d4d4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border-color: #555;
}

body.dark-mode .card-id a {
    color: #007acc;
}

body.dark-mode .card-summary {
    color: #d4d4d4;
}

body.dark-mode .card-detail strong {
    color: #d4d4d4;
}

body.dark-mode .toggle-checkbox:checked + .toggle-label {
    background-color: #007acc;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-label {
    font-size: 12px;
    font-weight: bold;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

body.dark-mode .stat-card {
    background: #252526;
}

body.dark-mode .stat-label {
    color: #a0a0a0;
}

body.dark-mode .stat-value {
    color: #d4d4d4;
}

@media (max-width: 1024px) {
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.refresh-btn {
    height: 38px;
    padding: 0 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

body.dark-mode .refresh-btn {
    background: #3e3e42;
    border-color: #555;
    color: #d4d4d4;
}

body.dark-mode .refresh-btn:hover {
    border-color: #007acc;
    color: #007acc;
}

.theme-icon {
    font-size: 13px;
    line-height: 1;
    color: #7f8c8d;
}

body.dark-mode .theme-icon {
    color: #a0a0a0;
}

.filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.filter-toggle-btn,
.add-filter-btn,
.clear-filters-btn,
.apply-filters-btn,
.primary-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: #ffffff;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-toggle-btn:hover,
.add-filter-btn:hover,
.clear-filters-btn:hover,
.apply-filters-btn:hover,
.primary-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Active state for quick-filter toggle buttons (Support Team, Show Done) */
.filter-toggle-btn.active {
    border-color: #667eea;
    color: #667eea;
    background: #eef1ff;
}

body.dark-mode .filter-toggle-btn.active {
    border-color: #007acc;
    color: #007acc;
    background: #2d2d30;
}

.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    font-size: 12px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.filter-chip button {
    background: transparent;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.filters-panel {
    margin-top: 10px;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
}

.filters-panel-content {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-dropdown-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-dropdown-btn:hover {
    border-color: #667eea;
    background: #f9f9f9;
}

.filter-dropdown-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.filter-dropdown-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.filter-options {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
    max-height: 200px;
    overflow-y: auto;
}

.filter-options.hidden {
    display: none;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.filter-option:hover {
    background: #ffffff;
}

.filter-option input[type="checkbox"] {
    cursor: pointer;
}

.filter-panel-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.filters-panel.hidden {
    display: none;
}

.clear-filters-btn.hidden {
    display: none;
}

body.dark-mode .filters-panel {
    background: #252526;
    border-color: #3e3e42;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

body.dark-mode .filter-dropdown-btn {
    background: #3e3e42;
    border-color: #555;
    color: #d4d4d4;
}

body.dark-mode .filter-dropdown-btn:hover {
    border-color: #007acc;
    background: #2d2d30;
}

body.dark-mode .filter-dropdown-btn.active {
    border-color: #007acc;
    background: linear-gradient(135deg, #007acc 0%, #005a9e 100%);
    color: #ffffff;
}

body.dark-mode .filter-options {
    background: #2d2d30;
    border-color: #555;
}

body.dark-mode .filter-option {
    color: #d4d4d4;
}

body.dark-mode .filter-option:hover {
    background: #3e3e42;
}

body.dark-mode .filter-panel-actions {
    border-top-color: #555;
}

body.dark-mode .filter-toggle-btn,
body.dark-mode .add-filter-btn,
body.dark-mode .clear-filters-btn,
body.dark-mode .apply-filters-btn,
body.dark-mode .primary-btn {
    background: #3e3e42;
    border-color: #555;
    color: #d4d4d4;
}

body.dark-mode .filter-toggle-btn:hover,
body.dark-mode .add-filter-btn:hover,
body.dark-mode .clear-filters-btn:hover,
body.dark-mode .apply-filters-btn:hover,
body.dark-mode .primary-btn:hover {
    border-color: #007acc;
    color: #007acc;
}

body.dark-mode .filter-chip {
    background: #3e3e42;
    border-color: #555;
    color: #d4d4d4;
}

body.dark-mode .filter-chip button {
    color: #a0a0a0;
}

body.dark-mode .filter-chip button:hover {
    color: #d4d4d4;
}

/* ===================================================================
   Overview charts (priority bar chart + status donut)
   =================================================================== */
.charts-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.chart-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.chart-title {
    font-size: 13px;
    font-weight: bold;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

/* Bar chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: grid;
    grid-template-columns: 72px 1fr 34px;
    align-items: center;
    gap: 12px;
}

.bar-label {
    font-size: 13px;
    color: #2c3e50;
    font-weight: 600;
}

.bar-track {
    background: #f0f0f0;
    border-radius: 6px;
    height: 20px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    min-width: 2px;
    transition: width 0.4s ease;
}

.bar-count {
    font-size: 13px;
    font-weight: bold;
    color: #2c3e50;
    text-align: right;
}

/* Reporter chart: wider labels for reporter names */
.reporter-chart .bar-row {
    grid-template-columns: 140px 1fr 34px;
}

.reporter-chart .bar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-more {
    margin-top: 4px;
    font-size: 12px;
    color: #7f8c8d;
}

body.dark-mode .bar-more {
    color: #a0a0a0;
}

/* Donut chart */
.donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex: 1;
}

.donut {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(#e0e0e0 0% 100%);
    flex-shrink: 0;
    transition: background 0.4s ease;
}

.donut-center {
    position: absolute;
    inset: 36px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-center span {
    font-size: 38px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
}

.donut-center small {
    font-size: 10px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #2c3e50;
}

.legend-label {
    margin-right: 4px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-count {
    color: #7f8c8d;
    font-size: 12px;
    font-weight: 600;
}

.legend-empty {
    color: #7f8c8d;
    font-size: 13px;
}

@media (max-width: 900px) {
    .charts-dashboard {
        grid-template-columns: 1fr;
    }
}

/* Dark mode */
body.dark-mode .chart-panel {
    background: #252526;
}

body.dark-mode .chart-title {
    color: #a0a0a0;
}

body.dark-mode .bar-label,
body.dark-mode .bar-count {
    color: #d4d4d4;
}

body.dark-mode .bar-track {
    background: #3e3e42;
}

body.dark-mode .donut-center {
    background: #252526;
}

body.dark-mode .donut-center span {
    color: #d4d4d4;
}

body.dark-mode .legend-row {
    color: #d4d4d4;
}

body.dark-mode .legend-count,
body.dark-mode .legend-empty {
    color: #a0a0a0;
}

/* ===================================================================
   Ticket modal
   =================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: #ffffff;
    color: #2c3e50;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    width: min(900px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: #f7f8fa;
    border-bottom: 1px solid #e4e7ec;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    text-decoration: none;
    line-height: 1.3;
}

.modal-title:hover {
    text-decoration: underline;
}

.modal-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #ffffff;
    color: #2c3e50;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.modal-close:hover {
    border-color: #667eea;
    color: #667eea;
}

.modal-body {
    display: flex;
    gap: 24px;
    padding: 20px 22px;
    overflow-y: auto;
}

.modal-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-meta {
    width: 200px;
    flex-shrink: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: #f7f8fa;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
}

.meta-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
}

.meta-value {
    font-size: 14px;
    color: #2c3e50;
    overflow-wrap: anywhere;
}

/* Collapsible description */
/* Styled to match .modal-subheading so all modal section titles look alike */
.desc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
}

.desc-caret {
    transition: transform 0.15s ease;
    font-size: 11px;
}

.desc-toggle.open .desc-caret {
    transform: rotate(90deg);
}

.modal-description {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #fafafa;
    font-size: 14px;
    line-height: 1.5;
    max-height: 320px;
    overflow: auto;
    overflow-wrap: anywhere;
}

.modal-description.hidden {
    display: none;
}

.modal-description img,
.comment-body img {
    max-width: 100%;
    height: auto;
}

/* Add comment */
.comment-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    color: #2c3e50;
    background: #ffffff;
}

.comment-input:focus {
    outline: none;
    border-color: #667eea;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.comment-status {
    font-size: 13px;
    color: #7f8c8d;
}

.modal-subheading {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.modal-comments {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
}

.comment:last-child {
    border-bottom: none;
}

.comment-head {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: #2c3e50;
}

.comment-date {
    font-size: 12px;
    color: #7f8c8d;
}

.comment-body {
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
    overflow-wrap: anywhere;
}

.modal-empty {
    font-size: 13px;
    color: #7f8c8d;
}

@media (max-width: 700px) {
    .modal-body {
        flex-direction: column-reverse;
    }
    .modal-meta {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
}

/* Modal dark mode */
body.dark-mode .modal {
    background: #252526;
    color: #d4d4d4;
}

body.dark-mode .modal-header {
    border-bottom-color: #3e3e42;
}

body.dark-mode .modal-title {
    color: #6bb3e8;
}

body.dark-mode .modal-close {
    background: #3e3e42;
    border-color: #555;
    color: #d4d4d4;
}

body.dark-mode .meta-value,
body.dark-mode .comment-author,
body.dark-mode .comment-body {
    color: #d4d4d4;
}

body.dark-mode .modal-description {
    background: #2d2d30;
    border-color: #3e3e42;
}

body.dark-mode .comment-input {
    background: #3e3e42;
    border-color: #555;
    color: #d4d4d4;
}

body.dark-mode .comment {
    border-bottom-color: #3e3e42;
}

body.dark-mode .desc-toggle,
body.dark-mode .modal-subheading {
    color: #a0a0a0;
}

body.dark-mode .modal-header {
    background: #2d2d30;
    border-bottom-color: #3e3e42;
}

body.dark-mode .modal-meta {
    background: #2d2d30;
    border-color: #3e3e42;
}

/* Rich content (description + comments): keep wide content contained.
   Code blocks scroll horizontally instead of overlapping the box; the modal
   itself never gains a horizontal scrollbar. */
.modal-description pre,
.comment-body pre {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre;
    background: #f4f5f7;
    border: 1px solid #e4e7ec;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 8px 0;
    font-size: 13px;
}

.modal-description table,
.comment-body table,
.modal-description .code,
.comment-body .code,
.modal-description .codeContent,
.comment-body .codeContent,
.modal-description .preformatted,
.comment-body .preformatted {
    display: block;
    overflow-x: auto;
    max-width: 100%;
}

.modal-description :not(pre) > code,
.comment-body :not(pre) > code {
    background: #f4f5f7;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 13px;
}

.modal-description a,
.comment-body a {
    color: #5563c1;
}

/* Restore rich-text typography inside Jira-rendered HTML — the global
   `* { margin:0; padding:0 }` reset otherwise crams paragraphs and
   renders bullet lists flush against the text (unreadable). */
.modal-description p,
.comment-body p {
    margin: 0 0 8px;
}

.modal-description p:last-child,
.comment-body p:last-child {
    margin-bottom: 0;
}

.modal-description ul,
.comment-body ul,
.modal-description ol,
.comment-body ol {
    margin: 6px 0 10px;
    padding-left: 24px;
}

.modal-description ul,
.comment-body ul {
    list-style-type: disc;
}

.modal-description ol,
.comment-body ol {
    list-style-type: decimal;
}

.modal-description li,
.comment-body li {
    margin-bottom: 4px;
}

.modal-description li > ul,
.comment-body li > ul,
.modal-description li > ol,
.comment-body li > ol {
    margin: 4px 0;
}

.modal-description blockquote,
.comment-body blockquote {
    margin: 8px 0;
    padding: 4px 12px;
    border-left: 3px solid #dcdfe4;
    color: #5f6b76;
}

body.dark-mode .modal-description blockquote,
body.dark-mode .comment-body blockquote {
    border-left-color: #555;
    color: #a0a0a0;
}

body.dark-mode .modal-description pre,
body.dark-mode .comment-body pre,
body.dark-mode .modal-description :not(pre) > code,
body.dark-mode .comment-body :not(pre) > code {
    background: #1b1b1c;
    border-color: #3e3e42;
}

body.dark-mode .modal-description a,
body.dark-mode .comment-body a {
    color: #6bb3e8;
}

/* ===================================================================
   Floating "Loading issues…" toast — fixed to the viewport bottom so
   it's visible without scrolling.
   =================================================================== */
#loading {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    border-radius: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

body.dark-mode #loading {
    background: #2d2d30;
    color: #d4d4d4;
}

body.dark-mode #loading::before {
    border-color: #007acc;
    border-top-color: transparent;
}

/* ===================================================================
   Card hover tooltip (latest comment)
   =================================================================== */
.card-tooltip {
    position: fixed;
    z-index: 1200;
    max-width: 340px;
    padding: 10px 12px;
    background: #2c3e50;
    color: #f0f3f6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    font-size: 13px;
    line-height: 1.45;
    pointer-events: none;
}

.card-tooltip.hidden {
    display: none;
}

.card-tooltip .tooltip-head {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 4px;
}

.card-tooltip .tooltip-author {
    font-weight: 600;
}

.card-tooltip .tooltip-date {
    font-size: 11px;
    opacity: 0.75;
}

.card-tooltip .tooltip-body {
    overflow-wrap: anywhere;
}

.card-tooltip .tooltip-empty {
    opacity: 0.75;
    font-style: italic;
}

body.dark-mode .card-tooltip {
    background: #1b1b1c;
    border: 1px solid #3e3e42;
}

/* ===================================================================
   Modal AI summary
   =================================================================== */
.summary-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.summary-head .modal-subheading {
    margin-bottom: 0;
}

.panel-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.summary-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.summary-progress.hidden {
    display: none;
}

.summary-progress-track {
    flex: 1;
    height: 8px;
    background: #ececec;
    border-radius: 4px;
    overflow: hidden;
}

.summary-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.25s ease;
}

.summary-progress-label {
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    min-width: 34px;
    text-align: right;
}

.summary-result {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #dcd4f5;
    border-left: 3px solid #667eea;
    border-radius: 8px;
    background: #f7f5ff;
    font-size: 14px;
    line-height: 1.5;
}

.summary-result.hidden {
    display: none;
}

.summary-result.summary-error {
    background: #ffe5e5;
    border-color: #e74c3c;
    color: #c0392b;
}

.summary-meta {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: #7f8c8d;
}

body.dark-mode .summary-progress-track {
    background: #3e3e42;
}

body.dark-mode .summary-progress-fill {
    background: linear-gradient(90deg, #007acc 0%, #005a9e 100%);
}

body.dark-mode .summary-result {
    background: #2a2d3e;
    border-color: #3e4a6b;
    border-left-color: #007acc;
    color: #d4d4d4;
}

body.dark-mode .summary-result.summary-error {
    background: #3e2a2a;
    border-color: #7a3e3e;
    color: #e08c8c;
}

body.dark-mode .summary-meta {
    color: #a0a0a0;
}
