/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2328;
    background-color: #fff;
}

a {
    color: #0969da;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === Layout === */
.app-header {
    background-color: #24292f;
    color: #fff;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .logo {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-header .logo:hover {
    text-decoration: none;
    color: rgba(255,255,255,0.85);
}

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

.header-nav a {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
}

.header-nav a:hover {
    color: #fff;
    text-decoration: none;
    background-color: rgba(255,255,255,0.1);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
}

/* === Culture Selector (header dark background) === */
.culture-selector select {
    padding: 5px 12px;
    font-size: 14px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.culture-selector select:hover {
    background-color: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

.culture-selector select:focus {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9,105,218,0.3);
    background-color: rgba(255,255,255,0.15);
    color: #fff;
}

.culture-selector select option {
    background-color: #24292f;
    color: rgba(255,255,255,0.85);
}

.app-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 64px);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    border: 1px solid rgba(27,31,36,0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    font-family: inherit;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: #2da44e;
    border-color: rgba(27,31,36,0.15);
}

.btn-primary:hover {
    background-color: #2c974b;
}

.btn-default {
    color: #24292f;
    background-color: #f6f8fa;
    border-color: rgba(27,31,36,0.15);
}

.btn-default:hover {
    background-color: #f3f4f6;
}

.btn-danger {
    color: #cf222e;
    background-color: #f6f8fa;
    border-color: rgba(27,31,36,0.15);
}

.btn-danger:hover {
    color: #fff;
    background-color: #cf222e;
    border-color: #cf222e;
}

.btn-outline {
    color: #0969da;
    background-color: transparent;
    border-color: rgba(27,31,36,0.15);
}

.btn-outline:hover {
    color: #fff;
    background-color: #0969da;
    border-color: #0969da;
}

.btn-sm {
    padding: 3px 12px;
    font-size: 12px;
}

.btn-link {
    background: none;
    border: none;
    color: #0969da;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Forms === */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 5px 12px;
    font-size: 14px;
    line-height: 20px;
    color: #1f2328;
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.form-control:focus {
    background-color: #fff;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9,105,218,0.3);
}

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

select.form-control {
    appearance: auto;
}

.form-hint {
    font-size: 12px;
    color: #656d76;
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: #cf222e;
    margin-top: 4px;
}

/* === Auth Pages === */
.auth-container {
    max-width: 340px;
    margin: 60px auto;
    text-align: center;
}

.auth-container h1 {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 16px;
}

.auth-box {
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 20px;
    text-align: left;
}

.auth-box .form-group:last-of-type {
    margin-bottom: 16px;
}

.auth-box .btn {
    width: 100%;
    justify-content: center;
    padding: 8px 16px;
}

.auth-footer {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-danger {
    background-color: #ffebe9;
    border: 1px solid rgba(255,129,130,0.4);
    color: #cf222e;
}

.alert-success {
    background-color: #dafbe1;
    border: 1px solid rgba(74,194,107,0.4);
    color: #116329;
}

/* === Status === */
.status-open {
    color: #fff;
    background-color: #2da44e;
}

.status-closed {
    color: #fff;
    background-color: #8250df;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
}

/* === Labels === */
.label-badge {
    display: inline-block;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    border-radius: 20px;
    white-space: nowrap;
    color: #fff;
}

/* === Issue List === */
.issue-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.filter-bar select {
    padding: 5px 12px;
    font-size: 14px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background-color: #f6f8fa;
    color: #1f2328;
    outline: none;
}

.filter-bar select:focus {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9,105,218,0.3);
}

.search-input {
    padding: 5px 12px;
    font-size: 14px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background-color: #f6f8fa;
    outline: none;
    min-width: 200px;
}

.search-input:focus {
    background-color: #fff;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9,105,218,0.3);
}

.status-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #d0d7de;
}

.status-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #656d76;
    cursor: pointer;
    padding: 4px 0;
    border: none;
    background: none;
    font-family: inherit;
}

.status-tab:hover {
    color: #1f2328;
}

.status-tab.active {
    color: #1f2328;
    font-weight: 600;
}

.status-tab .count {
    background-color: rgba(27,31,36,0.08);
    padding: 0 6px;
    border-radius: 10px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

.issue-table {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
}

.issue-row {
    display: flex;
    align-items: flex-start;
    padding: 8px 16px;
    border-bottom: 1px solid #d0d7de;
    gap: 8px;
}

.issue-row:last-child {
    border-bottom: none;
}

.issue-row:hover {
    background-color: #f6f8fa;
}

.issue-icon {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
}

.issue-icon.open {
    color: #2da44e;
}

.issue-icon.closed {
    color: #8250df;
}

.issue-content {
    flex: 1;
    min-width: 0;
}

.issue-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.issue-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2328;
}

.issue-title:hover {
    color: #0969da;
    text-decoration: none;
}

.issue-meta {
    font-size: 12px;
    color: #656d76;
    margin-top: 4px;
}

.issue-comment-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #656d76;
    flex-shrink: 0;
    margin-top: 4px;
}

/* === Issue Detail === */
.issue-detail-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px - 48px);
}

.issue-header {
    padding-bottom: 16px;
    border-bottom: 1px solid #d0d7de;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.issue-header h1 {
    font-size: 32px;
    font-weight: 400;
    margin: 0 0 8px 0;
    line-height: 1.25;
}

.issue-header h1 .issue-number {
    color: #656d76;
    font-weight: 300;
}

.issue-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #656d76;
}

.issue-body-layout {
    display: flex;
    gap: 24px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.issue-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.issue-sidebar {
    width: 256px;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-section {
    padding: 16px 0;
    border-bottom: 1px solid #d0d7de;
}

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

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    color: #656d76;
    margin-bottom: 8px;
}

.sidebar-value {
    font-size: 14px;
    color: #1f2328;
}

.sidebar-empty {
    font-size: 14px;
    color: #656d76;
}

/* === Markdown Content === */
.markdown-body {
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-body h1 { font-size: 2em; padding-bottom: 0.3em; border-bottom: 1px solid #d0d7de; }
.markdown-body h2 { font-size: 1.5em; padding-bottom: 0.3em; border-bottom: 1px solid #d0d7de; }
.markdown-body h3 { font-size: 1.25em; }

.markdown-body p { margin-top: 0; margin-bottom: 16px; }

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(175,184,193,0.2);
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
    margin-bottom: 16px;
}

.markdown-body pre code {
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 0;
    font-size: 100%;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: #656d76;
    border-left: 0.25em solid #d0d7de;
    margin: 0 0 16px 0;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.markdown-body table th, .markdown-body table td {
    padding: 6px 13px;
    border: 1px solid #d0d7de;
}

.markdown-body table th {
    font-weight: 600;
    background-color: #f6f8fa;
}

.markdown-body table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.markdown-body img {
    max-width: 100%;
}

.markdown-body a {
    color: #0969da;
}

/* === Comments === */
.comment-list {
    margin-top: 16px;
}

.comment-item {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    margin-bottom: 16px;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background-color: #f6f8fa;
    border-bottom: 1px solid #d0d7de;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
}

.comment-author {
    font-weight: 600;
    color: #1f2328;
}

.comment-time {
    color: #656d76;
    font-size: 12px;
}

.comment-body {
    padding: 16px;
}

.comment-actions {
    display: flex;
    gap: 8px;
}

.comment-form {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    margin-top: 16px;
}

.comment-form-header {
    padding: 8px 16px;
    background-color: #f6f8fa;
    border-bottom: 1px solid #d0d7de;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.comment-form-body {
    padding: 16px;
}

.comment-form-body textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

.comment-form-body textarea:focus {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9,105,218,0.3);
}

.comment-form-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0 16px 16px;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
    padding: 16px 0;
}

.pagination .page-btn {
    padding: 5px 12px;
    font-size: 14px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background-color: #fff;
    color: #0969da;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.pagination .page-btn:hover {
    background-color: #f6f8fa;
    text-decoration: none;
}

.pagination .page-btn.active {
    background-color: #0969da;
    color: #fff;
    border-color: #0969da;
}

.pagination .page-btn.disabled {
    color: #8c959f;
    cursor: not-allowed;
    opacity: 0.5;
}

/* === Project Cards === */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.project-card {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 16px;
    transition: border-color 0.15s;
}

.project-card:hover {
    border-color: #0969da;
}

.project-card h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.project-card h3 a {
    color: #0969da;
    font-weight: 600;
}

.project-card p {
    color: #656d76;
    font-size: 14px;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #656d76;
}

.project-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-stat .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.project-stat .dot.open { background-color: #2da44e; }
.project-stat .dot.closed { background-color: #8250df; }

/* === Project Detail / Dashboard === */
.sub-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #d0d7de;
    margin-bottom: 24px;
}

.sub-nav a, .sub-nav button {
    padding: 8px 16px;
    font-size: 14px;
    color: #656d76;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    font-family: inherit;
}

.sub-nav a:hover, .sub-nav button:hover {
    color: #1f2328;
    text-decoration: none;
}

.sub-nav a.active, .sub-nav button.active {
    color: #1f2328;
    font-weight: 600;
    border-bottom-color: #fd8c73;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s;
}

.stat-card-link:hover {
    border-color: #0969da;
    text-decoration: none;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #1f2328;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #656d76;
    margin-top: 4px;
}

/* === Settings Layout === */
.settings-layout {
    display: flex;
    gap: 24px;
}

.settings-nav {
    width: 200px;
    flex-shrink: 0;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #1f2328;
    border-radius: 6px;
    text-decoration: none;
    margin-bottom: 2px;
    transition: background-color 0.15s;
}

.settings-nav-item:hover {
    background-color: #f6f8fa;
    text-decoration: none;
}

.settings-nav-item.active {
    background-color: #f6f8fa;
    font-weight: 600;
    color: #1f2328;
}

.settings-nav-item svg {
    color: #656d76;
    flex-shrink: 0;
}

.settings-nav-item.active svg {
    color: #1f2328;
}

.settings-content {
    flex: 1;
    min-width: 0;
}

/* === Milestone === */
.milestone-item {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.milestone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.milestone-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2328;
}

.milestone-due {
    font-size: 12px;
    color: #656d76;
}

.milestone-due.overdue {
    color: #cf222e;
}

.milestone-desc {
    font-size: 14px;
    color: #656d76;
    margin-bottom: 12px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #eaeef2;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-bar-fill {
    height: 100%;
    background-color: #2da44e;
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: #656d76;
}

/* === Label Management === */
.label-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #d0d7de;
}

.label-list-item:last-child {
    border-bottom: none;
}

.label-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.label-color-preview {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
}

.label-actions {
    display: flex;
    gap: 8px;
}

.color-options {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
}

.color-option:hover {
    opacity: 0.8;
}

.color-option.selected {
    border-color: #1f2328;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1f2328;
}

/* === Members === */
.member-list {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
}

.member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #d0d7de;
}

.member-row:last-child {
    border-bottom: none;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-name {
    font-weight: 600;
    font-size: 14px;
}

.member-email {
    color: #656d76;
    font-size: 12px;
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    background-color: #ddf4ff;
    color: #0969da;
}

/* === Admin Users === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
}

.data-table th, .data-table td {
    padding: 8px 16px;
    text-align: left;
    border-bottom: 1px solid #d0d7de;
    font-size: 14px;
}

.data-table th {
    background-color: #f6f8fa;
    font-weight: 600;
    font-size: 12px;
    color: #656d76;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f6f8fa;
}

/* === Confirm Dialog === */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(27,31,35,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-box {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(140,149,159,0.2);
}

.dialog-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dialog-message {
    font-size: 14px;
    color: #656d76;
    margin-bottom: 20px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* === Tab Preview/Write === */
.tab-bar {
    display: flex;
    border-bottom: 1px solid #d0d7de;
    margin-bottom: 12px;
}

.tab-bar button {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    background: none;
    cursor: pointer;
    color: #656d76;
    border-bottom: 2px solid transparent;
    font-family: inherit;
}

.tab-bar button:hover {
    color: #1f2328;
}

.tab-bar button.active {
    color: #1f2328;
    font-weight: 600;
    border-bottom-color: #fd8c73;
}

/* === Page Header === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1, .page-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 400;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: #656d76;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2328;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* === Loading === */
.loading {
    text-align: center;
    padding: 48px 16px;
    color: #656d76;
    font-size: 14px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .app-header {
        padding: 0 16px;
    }

    .app-main {
        padding: 16px;
    }

    .issue-detail-container {
        height: auto;
    }

    .issue-body-layout {
        flex-direction: column;
        overflow: visible;
    }

    .issue-main {
        overflow-y: visible;
    }

    .issue-sidebar {
        width: 100%;
        overflow-y: visible;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .header-nav {
        display: none;
    }

    .issue-list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar {
        flex-direction: column;
    }

    .settings-layout {
        flex-direction: column;
    }

    .settings-nav {
        width: 100%;
        display: flex;
        gap: 4px;
        overflow-x: auto;
        border-bottom: 1px solid #d0d7de;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .settings-nav-item {
        white-space: nowrap;
        margin-bottom: 0;
    }
}

/* === SVG Icon Helpers === */
.icon-sm {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: text-bottom;
}

/* === Blazor Error UI === */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* === Mention === */
.mention {
    color: #0969da;
    font-weight: 600;
    background: #ddf4ff;
    padding: 0 4px;
    border-radius: 3px;
}

.mention-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 200px;
}

.mention-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.mention-item:hover, .mention-item.active {
    background: #f6f8fa;
}

/* === Priority Badge === */
.priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.priority-none { background: #f6f8fa; color: #656d76; }
.priority-low { background: #ddf4ff; color: #0969da; }
.priority-medium { background: #fff8c5; color: #9a6700; }
.priority-high { background: #ffebe9; color: #cf222e; }
.priority-critical { background: #cf222e; color: white; }

/* === Timeline Events === */
.timeline-event {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: #656d76;
    border-left: 2px solid #d0d7de;
    margin-left: 20px;
}
.timeline-event-icon {
    color: #8b949e;
    font-size: 10px;
}
.timeline-event-time {
    margin-left: auto;
    font-size: 12px;
    white-space: nowrap;
}

/* === Profile Page === */
.profile-page {
    max-width: 600px;
    margin: 32px auto;
    padding: 0 16px;
}
.profile-page h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d0d7de;
}
.profile-section {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 20px;
}
.profile-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
}
.header-user-link {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}
.header-user-link:hover {
    color: #fff;
    text-decoration: none;
}
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success {
    background: #dafbe1;
    border: 1px solid #a7f3d0;
    color: #116329;
}
.alert-error {
    background: #ffebe9;
    border: 1px solid #ffc1ba;
    color: #82071e;
}

/* Notification Bell & Panel */
.notification-bell-wrapper {
    position: relative;
}
.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    color: #e6edf3;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.notification-bell:hover {
    color: #ffffff;
}
.notification-count-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #cf222e;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.notification-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 420px;
    max-height: 480px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #30363d;
}
.notification-panel-title {
    font-weight: 600;
    font-size: 14px;
    color: #e6edf3;
}
.notification-panel-empty {
    padding: 32px 16px;
    text-align: center;
    color: #8b949e;
}
.notification-panel-list {
    overflow-y: auto;
    max-height: 420px;
}
.notification-panel-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #21262d;
    text-decoration: none;
    color: #e6edf3;
    transition: background 0.15s;
}
.notification-panel-item:hover {
    background: #1c2128;
    text-decoration: none;
}
.notification-panel-item.unread {
    background: #0d1117;
    border-left: 3px solid #58a6ff;
}
.notification-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #21262d;
}
.notification-icon.mention { color: #58a6ff; }
.notification-icon.assign { color: #3fb950; }
.notification-icon.comment { color: #e6edf3; }
.notification-icon.close { color: #8250df; }
.notification-icon.reopen { color: #3fb950; }
.notification-item-content {
    flex: 1;
    min-width: 0;
}
.notification-text {
    font-size: 13px;
    line-height: 1.4;
}
.notification-text strong {
    color: #f0f6fc;
}
.notification-issue-title {
    color: #58a6ff;
    font-weight: 500;
}
.notification-time {
    font-size: 12px;
    color: #656d76;
    margin-top: 2px;
}

/* Watch Button */
.watch-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: #21262d;
    color: #e6edf3;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    justify-content: center;
    transition: border-color 0.15s;
}
.watch-button:hover {
    border-color: #58a6ff;
}
.watch-button.watching {
    border-color: #58a6ff;
    color: #58a6ff;
}

/* Notification Dialog */
.notification-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notification-dialog {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    width: 340px;
    max-width: 90vw;
    overflow: hidden;
}
.notification-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #30363d;
    font-weight: 600;
    font-size: 14px;
    color: #e6edf3;
}
.notification-dialog-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.notification-dialog-close:hover {
    color: #e6edf3;
}
.notification-dialog-body {
    padding: 8px 0;
}
.notification-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background 0.15s;
}
.notification-option:hover {
    background: #1c2128;
}
.notification-option.selected {
    border-left-color: #58a6ff;
    background: #1c2128;
}
.notification-option input[type="radio"] {
    margin-top: 3px;
    accent-color: #58a6ff;
}
.notification-option-title {
    font-size: 13px;
    font-weight: 600;
    color: #e6edf3;
}
.notification-option-desc {
    font-size: 12px;
    color: #8b949e;
    margin-top: 2px;
}
.notification-custom-types {
    padding: 8px 16px 8px 42px;
    border-top: 1px solid #30363d;
}
.notification-custom-types label {
    font-size: 13px;
    color: #e6edf3;
}
.notification-custom-types input[type="checkbox"] {
    accent-color: #58a6ff;
}
.notification-dialog-footer {
    padding: 12px 16px;
    border-top: 1px solid #30363d;
}
