/* Atlas UI - Minimalist Stylesheet */
/* file: internal/adapters/ui/static/style.css */

/* =============================================================================
   Theme Variables (v2.0.0)
   ============================================================================= */

/* Dark Theme (Default) */
:root {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border: #30363d;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --text-link: #58a6ff;
    --accent: #238636;
    --accent-hover: #2ea043;
    --danger: #da3633;
    --danger-hover: #f85149;
    --success: #238636;
    --warning: #d29922;
    --radius: 6px;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Light Theme */
[data-theme="light"] {
    --bg: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --border: #d0d7de;
    --text: #1f2328;
    --text-muted: #656d76;
    --text-link: #0969da;
    --accent: #1a7f37;
    --accent-hover: #2da44e;
    --danger: #cf222e;
    --danger-hover: #a40e26;
    --success: #1a7f37;
    --warning: #9a6700;
    --shadow: 0 1px 3px rgba(31, 35, 40, 0.12);
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    background: var(--border);
    color: var(--text);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* Show/hide icons based on theme */
.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: none;
}

/* Icon Button (Admin, etc.) */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--border);
    color: var(--text);
}

.icon-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.icon-btn.active:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Reindex Button */
.reindex-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reindex-btn svg {
    transition: transform 0.3s ease;
}

.reindex-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    min-width: 280px;
    max-width: 400px;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--text-link);
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.info .toast-icon {
    color: var(--text-link);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-muted);
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease-in forwards;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.version {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius);
}

nav {
    display: flex;
    gap: 24px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

nav a:hover,
nav a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

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

.token-display {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(218, 54, 51, 0.1);
    border: 1px solid var(--danger);
    color: #f85149;
}

.alert-success {
    background: rgba(35, 134, 54, 0.1);
    border: 1px solid var(--success);
    color: #3fb950;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
    background: var(--border);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
    background: transparent;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-secondary {
    background: transparent;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.section-actions .btn svg {
    flex-shrink: 0;
}

/* Search Box */
.search-box input {
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 300px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--text-link);
}

/* Repository Cards */
.repo-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.repo-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, background 0.2s;
}

.repo-card:hover {
    border-color: var(--text-link);
    background: var(--bg-tertiary);
}

.repo-icon {
    color: var(--text-muted);
}

.repo-info {
    flex: 1;
}

.repo-name {
    font-weight: 600;
    font-family: var(--font-mono);
}

.repo-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

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

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

tr:hover td {
    background: var(--bg-tertiary);
}

.filename {
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filename svg {
    color: var(--text-muted);
}

.hash {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

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

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-link);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.form-group input:focus {
    outline: none;
    border-color: var(--text-link);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* File Input */
.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-drop-zone {
    padding: 32px;
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--text-link);
    background: rgba(88, 166, 255, 0.05);
}

.file-drop-zone svg {
    margin-bottom: 8px;
}

.file-drop-zone p {
    margin-bottom: 8px;
}

#file-name {
    font-family: var(--font-mono);
    color: var(--text);
}

/* Spinner */
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.htmx-request .spinner {
    display: inline-block;
}

.htmx-request .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Search Results */
.search-results {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.search-results h3 {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.search-results.empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

/* Login Page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-container {
    width: 100%;
    max-width: 360px;
    padding: 24px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
}

.login-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.login-footer {
    text-align: center;
    margin-top: 16px;
    color: var(--text-muted);
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 48px;
}

.error-icon {
    color: var(--danger);
    margin-bottom: 16px;
}

.error-page h1 {
    margin-bottom: 16px;
}

.error-message {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-family: var(--font-mono);
}

/* Pull Command / Copy Container */
.pull-command {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.pull-command h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.copy-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.command-line {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    overflow-x: auto;
    white-space: nowrap;
}

.copy-btn {
    flex-shrink: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 1000px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* Details Grid */
.details-grid {
    display: grid;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: var(--text);
}

.detail-value.mono {
    font-family: var(--font-mono);
}

.detail-value.small {
    font-size: 12px;
    word-break: break-all;
}

.hash-full {
    font-size: 12px;
    word-break: break-all;
    flex: 1;
}

.detail-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* File Viewer */
.file-viewer {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    overflow: auto;
    max-height: 60vh;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Search Highlight (v4.6.0) */
.search-match {
    background: rgba(255, 235, 59, 0.5);
    padding: 0 2px;
    border-radius: 2px;
}

.search-match.current {
    background: rgba(255, 152, 0, 0.8);
    outline: 2px solid var(--accent);
}

/* Checkbox Column */
.checkbox-col {
    width: 40px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Metadata Section */
.metadata-section {
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
}

.metadata-section summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    user-select: none;
}

.metadata-section summary:hover {
    background: var(--bg-tertiary);
}

.metadata-section[open] summary {
    border-bottom: 1px solid var(--border);
}

.metadata-fields {
    padding: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group.half {
    flex: 1;
}

.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--text-link);
}

.form-group input[type="url"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.form-group input[type="url"]:focus {
    outline: none;
    border-color: var(--text-link);
}

.checkbox-group {
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-group small {
    margin-top: 8px;
    margin-left: 28px;
}

/* Release Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-release {
    background: var(--accent);
    color: white;
}

.badge-version {
    background: var(--bg-tertiary);
    color: var(--text);
    border: 1px solid var(--border);
}

/* Metadata Display in Details */
.metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.metadata-grid .detail-item {
    background: var(--bg);
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.metadata-grid .detail-item.full-width {
    grid-column: 1 / -1;
}

.metadata-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.metadata-header h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================================================
   Commit Group Styles (v1.8.0)
   ============================================================================= */

.commit-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.commit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.commit-header:hover {
    background: var(--border);
}

.commit-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.expand-icon {
    color: var(--text-muted);
    transition: transform 0.2s;
}

.commit-group:not(.collapsed) .expand-icon {
    transform: rotate(90deg);
}

.commit-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.commit-id svg {
    color: var(--text-link);
}

.commit-id.no-commit {
    color: var(--text-muted);
}

.commit-id.no-commit svg {
    color: var(--text-muted);
}

/* Version/Release Group Styles (v1.9.0) */
.version-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    background: rgba(40, 167, 69, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.version-id svg {
    color: var(--success);
}

.release-group {
    border-color: rgba(40, 167, 69, 0.3);
}

.release-group .commit-header {
    background: rgba(40, 167, 69, 0.05);
}

.release-group .commit-header:hover {
    background: rgba(40, 167, 69, 0.1);
}

.commit-stats {
    display: flex;
    gap: 16px;
}

.commit-stats .stat {
    font-size: 12px;
    color: var(--text-muted);
}

.commit-content {
    border-top: 1px solid var(--border);
}

.commit-group.collapsed .commit-content {
    display: none;
}

.commit-group table {
    border: none;
    border-radius: 0;
}

/* =============================================================================
   View Toggle (v1.8.0)
   ============================================================================= */

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius);
}

.view-toggle .btn {
    padding: 4px 10px;
    font-size: 12px;
    border: none;
    background: transparent;
}

.view-toggle .btn.btn-active {
    background: var(--accent);
    color: white;
}

.view-toggle .btn:hover:not(.btn-active) {
    background: var(--border);
}

/* =============================================================================
   Sortable Headers (v1.8.0)
   ============================================================================= */

.sortable-header {
    cursor: pointer;
    position: relative;
    padding-right: 24px !important;
    user-select: none;
    transition: background 0.2s;
}

.sortable-header:hover {
    background: var(--border);
}

.sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-muted);
}

.sortable-header.sort-asc .sort-icon::after {
    content: "\25B2"; /* Triangle up */
}

.sortable-header.sort-desc .sort-icon::after {
    content: "\25BC"; /* Triangle down */
}

.sortable-header:not(.sort-asc):not(.sort-desc) .sort-icon::after {
    content: "\25B4\25BE"; /* Both arrows, subtle */
    opacity: 0.4;
}

/* =============================================================================
   Fixed Line Breaks for Filename and Actions (v1.8.0)
   ============================================================================= */

.filename-cell {
    min-width: 150px;
}

.filename-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filename-content svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.filename-text {
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.size-cell {
    white-space: nowrap;
}

.hash-cell {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.created-cell {
    white-space: nowrap;
}

.actions-cell {
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.actions-col {
    text-align: right;
}

/* Badge for commit in flat view */
.badge-commit {
    background: var(--bg-tertiary);
    color: var(--text-link);
    border: 1px solid var(--text-link);
    font-family: var(--font-mono);
}

/* =============================================================================
   Table Improvements (v1.8.0)
   ============================================================================= */

/* Make artifact list scrollable */
.artifact-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.sortable {
    table-layout: auto;
    min-width: 100%;
}

table.sortable th,
table.sortable td {
    overflow: visible;
}

/* Commit group content scrollable */
.commit-content {
    border-top: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* =============================================================================
   Resizable Columns (v1.9.0)
   ============================================================================= */

table.resizable {
    table-layout: fixed;
}

table.resizable th {
    position: relative;
    overflow: hidden;
}

table.resizable th.resizable-col {
    min-width: 50px;
}

.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
}

.resize-handle:hover,
.resize-handle.active {
    background: var(--text-link);
}

.resize-handle::before {
    content: '';
    position: absolute;
    top: 25%;
    right: 2px;
    width: 2px;
    height: 50%;
    background: var(--border);
    border-radius: 1px;
}

.resize-handle:hover::before,
.resize-handle.active::before {
    background: transparent;
}

/* Prevent text selection during resize */
body.resizing {
    cursor: col-resize !important;
    user-select: none;
}

body.resizing * {
    cursor: col-resize !important;
}

/* Reset button for column widths */
.reset-columns-btn {
    font-size: 11px;
    padding: 2px 8px;
    opacity: 0.7;
}

.reset-columns-btn:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        gap: 16px;
    }

    nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .search-box input {
        width: 100%;
    }

    .repo-list {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .filename-text {
        max-width: 150px;
    }

    .view-toggle {
        flex-wrap: wrap;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-actions {
        flex-wrap: wrap;
        width: 100%;
    }
}

/* =============================================================================
   Storage Summary (v2.6.0)
   ============================================================================= */

.storage-summary {
    display: flex;
    gap: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.storage-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.storage-label {
    color: var(--text-muted);
    font-size: 14px;
}

.storage-value {
    color: var(--text);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Repository Timestamp (v2.6.0) */
.repo-timestamp {
    color: var(--text-muted);
    font-size: 12px;
}

/* Group Timestamp and Actions (v2.6.0) */
.group-timestamp {
    color: var(--text-muted);
    font-size: 12px;
}

.group-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 12px;
}

.group-actions .btn {
    padding: 4px 8px;
}

.group-actions .btn svg {
    width: 14px;
    height: 14px;
}

.commit-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .storage-summary {
        flex-direction: column;
        gap: 12px;
    }

    .group-actions {
        display: flex;
        margin-left: 0;
        margin-top: 8px;
    }

    .commit-stats {
        flex-wrap: wrap;
    }
}

/* =============================================================================
   Git Repository UI Styles
   ============================================================================= */

/* Clone URL Card */
.clone-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.clone-card h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.clone-url-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.clone-url {
    flex: 1;
    background: var(--bg-secondary);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--text-primary);
}

.clone-hint {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Sections */
.section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.section h2 svg {
    color: var(--text-muted);
}

/* Branch List */
.branch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.branch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.branch-item.default {
    border-left: 3px solid var(--primary-color);
}

.branch-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-primary);
}

.branch-sha {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-muted);
}

/* Commit List */
.commit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.commit-item {
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.commit-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.commit-sha {
    font-family: monospace;
    font-size: 12px;
    color: var(--primary-color);
    background: var(--card-bg);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.commit-message {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.commit-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.commit-author {
    font-weight: 500;
}

.empty-hint {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Repository Description */
.repo-description-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Modal Styles */
dialog.modal {
    display: none; /* Hidden by default, overrides .modal display:none */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: none;
    border-radius: 12px;
    padding: 0;
    background: var(--card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 450px;
    width: 90%;
}

dialog.modal[open] {
    display: block; /* Show when dialog is opened via showModal() */
}

dialog.modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    padding: 24px;
}

.modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Branch Item as Link */
a.branch-item {
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

a.branch-item:hover {
    background: var(--card-bg);
}

a.branch-item.selected {
    background: var(--card-bg);
    border: 1px solid var(--primary-color);
}

.badge-selected {
    background: var(--success-color, #22c55e);
    color: white;
}

/* Section Header Inline */
.section-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header-inline h2 {
    margin: 0;
}

/* Branch Selector */
.branch-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.branch-selector label {
    font-size: 13px;
    color: var(--text-muted);
}

.branch-selector select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: monospace;
    cursor: pointer;
}

.branch-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.branch-selector select:hover {
    border-color: var(--primary-color);
}
