/* GitHub-style Admin Theme */

:root {
    /* GitHub Light Colors */
    --gh-bg-primary: #ffffff;
    --gh-bg-secondary: #f6f8fa;
    --gh-bg-tertiary: #f3f4f6;
    --gh-border-default: #d0d7de;
    --gh-border-muted: #d8dee4;
    --gh-text-primary: #1f2328;
    --gh-text-secondary: #656d76;
    --gh-text-tertiary: #8c959f;
    --gh-accent-fg: #0969da;
    --gh-success-fg: #1f883d;
    --gh-warning-fg: #9a6700;
    --gh-danger-fg: #cf222e;

    /* Dynamic Components */
    --gh-bg-surface: #ffffff;
    --gh-border-subtle: #d0d7de;
}

html,
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 14px;
    line-height: 1.5;
    background-color: var(--gh-bg-secondary);
}

/* GitHub Header Style - Light */
.github-header {
    background-color: #24292f !important;
    border-bottom: 1px solid #30363d;
    color: white !important;
}

/* GitHub Header Style - Dark */
.github-header-dark {
    background-color: #161b22 !important;
    border-bottom: 1px solid #30363d;
    color: white !important;
}

.github-header .mud-input-outlined .mud-input-slot,
.github-header-dark .mud-input-outlined .mud-input-slot {
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

.github-search .mud-input-outlined .mud-input-slot {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
}

.github-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Sidebar - Light */
.github-sidebar {
    border-right: 1px solid #d0d7de !important;
    background-color: #ffffff !important;
}

/* Sidebar - Dark */
.github-sidebar-dark {
    border-right: 1px solid #30363d !important;
    background-color: #0d1117 !important;
}

/* Main content - Light */
.github-main {
    background-color: #f6f8fa !important;
    min-height: 100vh;
}

/* Main content - Dark */
.github-main-dark {
    background-color: #0d1117 !important;
    min-height: 100vh;
}

/* Cards - GitHub style */
.mud-card {
    border: 1px solid #d0d7de;
    box-shadow: 0 1px 0 rgba(31, 35, 40, 0.04) !important;
    border-radius: 6px;
}

.mud-card:hover {
    box-shadow: 0 3px 6px rgba(140, 149, 159, 0.15) !important;
}

/* Tables - GitHub style Light */
.mud-table {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
}

.mud-table-head {
    background-color: #f6f8fa;
}

.mud-table-head .mud-table-cell {
    font-weight: 600;
    color: #1f2328;
    border-bottom: 1px solid #d0d7de;
}

.mud-table-body .mud-table-row {
    border-bottom: 1px solid #d8dee4;
}

.mud-table-body .mud-table-row:last-child {
    border-bottom: none;
}

.mud-table-body .mud-table-row:hover {
    background-color: #f3f4f6;
}

/* Tables - Dark Mode */
.github-main-dark .mud-table {
    border-color: #30363d;
}

.github-main-dark .mud-table-head {
    background-color: #161b22 !important;
}

.github-main-dark .mud-table-head .mud-table-cell {
    color: #f0f6fc;
    border-bottom-color: #30363d;
}

.github-main-dark .mud-table-body .mud-table-row {
    border-bottom-color: #21262d;
}

.github-main-dark .mud-table-body .mud-table-row:hover {
    background-color: #1f242b !important;
}

/* Cards - Dark Mode */
.github-main-dark .mud-card {
    border-color: #30363d;
    background-color: #161b22 !important;
}

/* Buttons - GitHub style */
.mud-button-filled-primary {
    background-color: #1f883d !important;
    font-weight: 500;
}

.mud-button-filled-primary:hover {
    background-color: #1a7f37 !important;
}

.mud-button-outlined {
    border-color: var(--gh-border-default);
}

.mud-button-outlined:hover {
    background-color: var(--gh-bg-secondary);
}

/* Chips - GitHub labels style */
.mud-chip {
    font-size: 12px;
    font-weight: 500;
    border-radius: 9999px;
    padding: 0 10px;
    height: 24px;
}

.mud-chip-color-success {
    background-color: #dafbe1 !important;
    color: #1f883d !important;
}

.mud-chip-color-error {
    background-color: #ffebe9 !important;
    color: #cf222e !important;
}

.mud-chip-color-info {
    background-color: #ddf4ff !important;
    color: #0969da !important;
}

.mud-chip-color-warning {
    background-color: #fff8c5 !important;
    color: #9a6700 !important;
}

/* Dialogs */
.mud-dialog {
    border-radius: 12px;
    border: 1px solid var(--gh-border-subtle) !important;
    background-color: var(--gh-bg-surface) !important;
}

.mud-dialog-title {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gh-border-subtle);
    font-weight: 600;
    color: var(--gh-text-primary);
}

.mud-dialog-content {
    padding: 24px !important;
    color: var(--gh-text-primary);
}

.mud-dialog-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--gh-border-subtle);
    background-color: var(--gh-bg-secondary);
}

/* Text fields - Light */
.mud-input-outlined .mud-input-slot {
    border-radius: 6px;
    border-color: #d0d7de;
}

.mud-input-outlined .mud-input-slot:focus-within {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.3);
}

/* Text fields - Dark Mode */
.mud-theme-dark .mud-input-outlined .mud-input-slot {
    border-color: #30363d;
    background-color: #0d1117;
}

.mud-theme-dark .mud-input-outlined input,
.mud-theme-dark .mud-input-outlined textarea {
    color: #f0f6fc;
}

/* Chips - Dark Mode */
.mud-theme-dark .mud-chip-color-success {
    background-color: rgba(46, 160, 67, 0.2) !important;
    color: #3fb950 !important;
}

.mud-theme-dark .mud-chip-color-error {
    background-color: rgba(248, 81, 73, 0.2) !important;
    color: #f85149 !important;
}

.mud-theme-dark .mud-chip-color-info {
    background-color: rgba(56, 139, 253, 0.2) !important;
    color: #58a6ff !important;
}

.mud-theme-dark .mud-chip-color-warning {
    background-color: rgba(210, 153, 34, 0.2) !important;
    color: #d29922 !important;
}

/* Alerts */
.mud-alert {
    border-radius: 6px;
    border-width: 1px;
}

/* Icons in tables */
.mud-icon-button {
    transition: background-color 0.15s ease;
}

.mud-icon-button:hover {
    background-color: var(--gh-bg-tertiary);
}

/* Code style */
code {
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
    font-size: 12px;
    background-color: rgba(175, 184, 193, 0.2);
    padding: 0.2em 0.4em;
    border-radius: 6px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #8c959f;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #656d76;
}

/* Dark mode overrides */
.mud-theme-dark {
    --gh-bg-primary: #0d1117;
    --gh-bg-secondary: #161b22;
    --gh-bg-tertiary: #1f242b;
    --gh-border-default: #30363d;
    --gh-border-muted: #21262d;
    --gh-text-primary: #f0f6fc;
    --gh-text-secondary: #8b949e;
    --gh-text-tertiary: #6e7681;

    --gh-bg-surface: #161b22;
    --gh-border-subtle: #30363d;
}

.mud-theme-dark .github-header {
    background-color: #161b22 !important;
}

.mud-theme-dark .github-sidebar {
    background-color: #0d1117 !important;
    border-color: #30363d !important;
}

.mud-theme-dark .mud-chip-color-success {
    background-color: rgba(46, 160, 67, 0.2) !important;
    color: #3fb950 !important;
}

.mud-theme-dark .mud-chip-color-error {
    background-color: rgba(248, 81, 73, 0.2) !important;
    color: #f85149 !important;
}

.mud-theme-dark code {
    background-color: rgba(110, 118, 129, 0.4);
}

/* Dark mode - Papers */
.mud-theme-dark .mud-paper {
    background-color: #161b22 !important;
    border-color: #30363d;
}

/* Dark mode - Buttons */
.mud-theme-dark .mud-button-outlined {
    border-color: #30363d;
    color: #c9d1d9;
}

.mud-theme-dark .mud-button-outlined:hover {
    background-color: #21262d;
}

/* Dark mode - Dialogs */
.mud-theme-dark .mud-dialog,
.mud-theme-dark .mud-dialog-container .mud-dialog,
.mud-theme-dark .mud-popover .mud-paper,
.mud-theme-dark .mud-overlay-dialog .mud-dialog {
    background-color: #161b22 !important;
    border-color: #30363d !important;
    color: #c9d1d9 !important;
}

.mud-theme-dark .mud-dialog .mud-dialog-title,
.mud-theme-dark .mud-dialog-title {
    border-bottom-color: #30363d !important;
    color: #f0f6fc !important;
    background-color: #161b22 !important;
}

.mud-theme-dark .mud-dialog .mud-dialog-content,
.mud-theme-dark .mud-dialog-content {
    color: #c9d1d9 !important;
    background-color: #161b22 !important;
}

.mud-theme-dark .mud-dialog .mud-dialog-actions,
.mud-theme-dark .mud-dialog-actions {
    background-color: #0d1117 !important;
    border-top-color: #30363d !important;
}

/* Dark mode - Select popover */
.mud-theme-dark .mud-popover,
.mud-theme-dark .mud-popover-paper {
    background-color: #161b22 !important;
    border-color: #30363d !important;
}

.mud-theme-dark .mud-list-item,
.mud-theme-dark .mud-select-item {
    color: #c9d1d9 !important;
}

.mud-theme-dark .mud-list-item:hover,
.mud-theme-dark .mud-select-item:hover {
    background-color: #21262d !important;
}

/* Dark mode - Progress bars */
.mud-theme-dark .mud-progress-linear {
    background-color: #21262d;
}

/* Dark mode - Select/Dropdown */
.mud-theme-dark .mud-menu .mud-list {
    background-color: #161b22 !important;
}

.mud-theme-dark .mud-menu .mud-list-item:hover {
    background-color: #21262d !important;
}

/* Dark mode - Date picker */
.mud-theme-dark .mud-picker {
    background-color: #161b22 !important;
    border-color: #30363d;
}

.mud-theme-dark .mud-picker-content {
    background-color: #161b22 !important;
}

/* Dark mode - Alerts */
.mud-theme-dark .mud-alert-filled-info {
    background-color: rgba(56, 139, 253, 0.15) !important;
    color: #58a6ff !important;
}

.mud-theme-dark .mud-alert-filled-success {
    background-color: rgba(46, 160, 67, 0.15) !important;
    color: #3fb950 !important;
}

.mud-theme-dark .mud-alert-filled-warning {
    background-color: rgba(210, 153, 34, 0.15) !important;
    color: #d29922 !important;
}

.mud-theme-dark .mud-alert-filled-error {
    background-color: rgba(248, 81, 73, 0.15) !important;
    color: #f85149 !important;
}

/* Dark mode - Tooltips */
.mud-theme-dark .mud-tooltip {
    background-color: #1f242b !important;
    color: #f0f6fc !important;
    border-color: #30363d;
}

/* Dark mode - Avatar */
.mud-theme-dark .mud-avatar {
    background-color: #21262d;
}

/* Dark mode - Nav menu */
.mud-theme-dark .mud-nav-link {
    color: #c9d1d9;
}

.mud-theme-dark .mud-nav-link:hover {
    background-color: #21262d;
}

.mud-theme-dark .mud-nav-link.active {
    background-color: rgba(56, 139, 253, 0.15);
    color: #58a6ff;
}

/* Dark mode - Breadcrumbs */
.mud-theme-dark .mud-breadcrumb-item {
    color: #8b949e;
}

.mud-theme-dark .mud-breadcrumb-item a {
    color: #58a6ff;
}

/* Dark mode - Switch */
.mud-theme-dark .mud-switch-track {
    background-color: #30363d;
}

/* Dark mode - Pagination */
.mud-theme-dark .mud-pagination-item {
    color: #c9d1d9;
}

.mud-theme-dark .mud-pagination-item:hover {
    background-color: #21262d;
}

/* Dark mode - Body background */
.mud-theme-dark {
    background-color: #0d1117 !important;
}

.mud-theme-dark body,
.mud-theme-dark html {
    background-color: #0d1117 !important;
}