* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

/* Top Navigation Bar */
.top-nav {
    background-color: #1a1a1a;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
}

.top-nav-left {
    display: flex;
    align-items: center;
}

.sourcery-logo {
    height: 40px;
    width: auto;
}

.vercel-logo {
    height: 24px;
    width: auto;
    margin-right: 16px;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-icon {
    color: #ffffff;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.nav-icon:hover {
    opacity: 0.8;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #4a9eff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-avatar svg {
    width: 18px;
    height: 18px;
}

.user-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 400;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Statistics Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.stat-card.active {
    border-color: #3b82f6;
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.stat-icon-circle {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.severity-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.severity-segment {
    fill: none;
    stroke-width: 3;
    stroke-dasharray: 25 75;
}

.severity-segment.critical {
    stroke: #ef4444;
}

.severity-segment.high {
    stroke: #f59e0b;
}

.severity-segment.medium {
    stroke: #3b82f6;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background-color: #3b82f6;
}

.stat-icon.yellow {
    background-color: #f59e0b;
}

.stat-icon.gray {
    background-color: #9ca3af;
}

.stat-content {
    flex: 1;
}

.severity-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 13px;
}

.severity-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
}

.severity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.severity-dot.critical {
    background-color: #ef4444;
}

.severity-dot.high {
    background-color: #f59e0b;
}

.severity-dot.medium {
    background-color: #3b82f6;
}

.severity-dot.low {
    background-color: #6b7280;
}

.stat-number {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    user-select: none;
}

.toggle-label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.toggle-container input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 36px;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    position: relative;
    transition: background-color 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-container input[type="checkbox"]:checked + .toggle-slider {
    background-color: #f59e0b;
}

.toggle-container input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.dropdown {
    position: relative;
}

.dropdown-button {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.dropdown-button:hover {
    background-color: #f9f9f9;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    padding: 8px;
    display: none;
    z-index: 100;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: #f9fafb;
}

.dropdown-item input[type="radio"],
.dropdown-item input[type="checkbox"] {
    display: none;
}

.radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.dropdown-item input[type="radio"]:checked + .radio-circle {
    border-color: #f59e0b;
    background-color: #f59e0b;
}

.dropdown-item input[type="radio"]:checked + .radio-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: translate(-50%, -60%) rotate(-45deg);
}

.checkbox-square {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
    background-color: white;
}

.dropdown-item input[type="checkbox"]:checked + .checkbox-square {
    border-color: #f59e0b;
    background-color: #f59e0b;
}

.dropdown-item input[type="checkbox"]:checked + .checkbox-square::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: translate(-50%, -60%) rotate(-45deg);
}

.filter-button {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    font-family: inherit;
}

.filter-button:hover {
    background-color: #f9f9f9;
}

/* Table */
.table-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.issues-table {
    width: 100%;
    border-collapse: collapse;
}

.issues-table thead {
    background-color: #f9fafb;
    border-bottom: 1px solid #e0e0e0;
}

.issues-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: capitalize;
}

.issues-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.issues-table tbody tr:hover {
    background-color: #f9fafb;
}

.issues-table tbody tr:last-child {
    border-bottom: none;
}

.issues-table td {
    padding: 16px;
    font-size: 14px;
    vertical-align: middle;
}

.col-type {
    width: 60px;
}

.col-name {
    min-width: 300px;
}

.col-severity {
    width: 120px;
}

.col-repository {
    width: 180px;
}

.col-status {
    width: 100px;
}

.col-assignee {
    width: 120px;
}

.col-actions {
    width: 50px;
}

/* Issue Type Icons */
.issue-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.issue-icon svg {
    width: 20px;
    height: 20px;
}

/* Issue Name */
.issue-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.issue-title {
    color: #111;
    font-weight: 500;
    line-height: 1.4;
}

.issue-location {
    color: #666;
    font-size: 13px;
}

.issue-location a {
    color: #666;
    text-decoration: underline;
}

.issue-location a:hover {
    color: #333;
}

/* Severity Badge */
.severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.severity-badge.critical {
    background-color: #fee2e2;
    color: #dc2626;
}

.severity-badge.high {
    background-color: #fef3c7;
    color: #d97706;
}

.severity-badge.medium {
    background-color: #dbeafe;
    color: #2563eb;
}

.severity-badge.low {
    background-color: #f3f4f6;
    color: #6b7280;
}

.severity-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status */
.status-text {
    color: #666;
    font-size: 14px;
}

/* Assignee */
.col-assignee {
    padding: 16px;
}

.assignee-button {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s;
}

.assignee-button:hover {
    background-color: #f9fafb;
}

.assignee-button svg {
    width: 16px;
    height: 16px;
    color: #666;
}

.assignee-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
}

.assignee-icon {
    width: 16px;
    height: 16px;
}

/* Actions Column */
.col-actions {
    padding: 16px 16px 16px 0;
    text-align: center;
}

.more-menu-button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
}

.more-menu-button:hover {
    background-color: #f3f4f6;
}

.more-menu-button svg {
    width: 16px;
    height: 16px;
    color: #666;
}

.issues-table tbody tr:hover .more-menu-button {
    opacity: 1;
    visibility: visible;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 8px;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 180px;
    display: none;
    z-index: 2100;
}

.context-menu.active {
    display: block;
}

.context-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    color: #333;
}

.context-menu-item:hover {
    background-color: #f9fafb;
}

.context-menu-item svg {
    flex-shrink: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#task-modal {
    z-index: 2200;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 24px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.modal-close:hover {
    background-color: #f3f4f6;
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-input:read-only {
    background-color: #f9fafb;
    color: #666;
}

select.form-input {
    cursor: pointer;
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.btn-primary {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background-color: #f59e0b;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
    background-color: #d97706;
}

.btn-primary:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
}

/* Issue Detail Modal */
.issue-detail-dialog {
    max-width: 1100px;
    width: 95%;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 32px 32px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.issue-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 14px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #fca5a5;
    color: #dc2626;
    background-color: #fee2e2;
}

.btn-actions {
    padding: 8px 20px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-actions:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.modal-body {
    padding: 24px 32px 32px;
}

.issue-detail-content {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 28px;
}

.detail-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.issue-detail-body {
    max-height: calc(90vh - 220px);
    overflow-y: auto;
}

.detail-section {
    padding: 24px 0;
    border-bottom: 1px solid #d1d5db;
}

.detail-section:first-child {
    padding-top: 0;
}

.detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #111;
    line-height: 1.4;
}

.detail-section h4 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #111;
}

.detail-section p {
    margin: 0 0 12px 0;
    line-height: 1.7;
    color: #374151;
    font-size: 16px;
}

.detail-section p strong {
    font-weight: 600;
    color: #111;
    font-size: 16px;
}


/* Expandable Section */
.expandable-section {
    padding: 20px 0 24px 0 !important;
}

.expand-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    color: #111;
}

.expand-button:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.expand-icon {
    transition: transform 0.2s;
}

.expand-button.expanded .expand-icon {
    transform: rotate(180deg);
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.expandable-content.expanded {
    max-height: 600px;
    margin-top: 12px;
}

.code-block-header {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.copy-button {
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: background-color 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-button:hover {
    background-color: #f3f4f6;
}

.ai-prompt-text {
    margin: 0;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: #1f2937;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* Location Block */
.location-block {
    margin-top: 16px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
}

.location-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.location-header strong {
    font-weight: 600;
}

.location-header svg {
    flex-shrink: 0;
}

.icon-button {
    margin-left: auto;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.code-snippet {
    margin: 0;
    padding: 20px;
    background-color: #fff;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: #1f2937;
    overflow-x: auto;
}

/* Related Issues Table */
.related-issues-table {
    width: 100%;
    margin-bottom: 32px;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.related-issues-table thead tr {
    border-bottom: 2px solid #d1d5db;
}

.related-issues-table th {
    text-align: left;
    padding: 12px 16px;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
}

.related-issues-table th:last-child {
    text-align: right;
}

.related-issues-table tbody tr {
    border-bottom: 1.5px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.15s;
}

.related-issues-table tbody tr:hover {
    background-color: #f9fafb;
}

.related-issues-table tbody tr:last-child {
    border-bottom: none;
}

.related-issues-table td {
    padding: 14px 16px;
    font-size: 15px;
    color: #111827;
}

.related-issues-table td:last-child {
    text-align: right;
    color: #6b7280;
    font-weight: 500;
}

.related-issues-table tbody tr td:first-child {
    color: #111827;
    font-weight: 400;
}

.related-issues-table tbody tr:hover td:first-child {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .table-container {
        overflow-x: auto;
    }

    .issues-table {
        min-width: 800px;
    }
}
