:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--bg-card);
    padding: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.content {
    flex: 1;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
}

.charts-container {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    height: 400px;
}

/* Buttons */
.btn-primary {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Servers Grid */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.server-card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: default;
}

.server-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(99, 102, 241, 0.3);
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.server-details {
    flex: 1;
}

.server-details p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.server-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
}

.server-actions button {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Button Tooltips */
.server-actions button::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.server-actions button::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    border: 6px solid transparent;
    border-top-color: rgba(59, 130, 246, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1001;
    pointer-events: none;
}

.server-actions button:hover::after,
.server-actions button:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Button Hover Effect */
.server-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.server-actions button:active {
    transform: translateY(0);
}

.server-actions button[data-tooltip=""]::after,
.server-actions button[data-tooltip=""]::before,
.server-actions button:not([data-tooltip])::after,
.server-actions button:not([data-tooltip])::before {
    display: none;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.local {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge.ssh {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

/* Modal */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow: hidden;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* When active, we need !important to override inline styles if JS sets block,
   OR we fix the JS. Let's fix the CSS to be robust. */
.modal.active {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #1e293b;
    /* Explicit dark color for contrast */
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    /* Wider */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    position: relative;
    margin: 0;
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.close {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 10;
    line-height: 1;
}

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

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


/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label:not(.toggle-switch) {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #0f172a;
    /* Darker than card */
    border: 1px solid #334155;
    /* Visible border */
    border-radius: 8px;
    color: #f8fafc;
    /* Light text */
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #020617;
    /* Even darker on focus */
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

/* Helper text for inputs */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #64748b;
    /* Visible placeholder */
}

/* ========================================
   Bootstrap-compatible Styles for Logs Page
   ======================================== */

/* Container */
.container-fluid {
    width: 100%;
    padding: 0;
}

/* Row and Column Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col,
[class*="col-"] {
    flex: 1;
    padding: 0 0.5rem;
}

.col-auto {
    flex: 0 0 auto;
    width: auto;
}

.col-md-2 {
    flex: 0 0 16.666%;
    max-width: 16.666%;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.g-3 {
    gap: 1rem;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Form Controls */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f8fafc;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    background-color: #020617;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-control::placeholder {
    color: #64748b;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

.btn-link {
    background: transparent;
    color: var(--accent);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
}

.btn-link:hover {
    color: var(--text-primary);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table thead th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table tbody tr {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.bg-success,
.badge.local {
    background-color: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge.bg-danger,
.badge.danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge.bg-secondary {
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.badge.bg-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge.bg-primary {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

/* Pagination */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    gap: 0.25rem;
}

.pagination.justify-content-center {
    justify-content: center;
}

.page-item {
    margin: 0;
}

.page-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

.page-item.active .page-link {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

.page-item.disabled .page-link {
    color: #475569;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Utilities */
.text-muted {
    color: var(--text-secondary) !important;
}

.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.align-items-center {
    align-items: center;
}

.float-end {
    float: right;
}

.w-100 {
    width: 100%;
}

/* Margin utilities */
.mb-0 {
    margin-bottom: 0 !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* Visually hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Spinner */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25em solid var(--accent);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Bootstrap Icons fallback */
.bi {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

/* Empty state icon styling */
#emptyState .bi {
    font-size: 4rem;
    color: #334155;
}

/* Code styling for logs */
.table code {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .col-md-2,
    .col-md-3,
    .col-md-4,
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    .card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .float-end {
        float: none;
        margin-top: 0.5rem;
    }
}

/* Additional Button Styles */
.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
}

.btn-outline-secondary:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.5rem 0.75rem;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 0;
}

.btn-group .btn,
.btn-group button {
    border-radius: 0;
}

.btn-group .btn:first-child,
.btn-group button:first-child {
    border-radius: 0.5rem 0 0 0.5rem;
}

.btn-group .btn:last-child,
.btn-group button:last-child {
    border-radius: 0 0.5rem 0.5rem 0;
}

.btn-group-sm .btn,
.btn-group-sm button {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Additional column sizes */
.col-lg-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Gap utilities */
.gap-2 {
    gap: 0.5rem;
}

/* Small text */
.small {
    font-size: 0.875rem;
}

/* Form control color (for color picker) */
.form-control-color {
    width: 3rem;
    height: 2.5rem;
    padding: 0.25rem;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.375rem;
}

/* Additional alignment */
.align-items-start {
    align-items: flex-start;
}

/* Empty state styling */
.empty-state {
    background-color: var(--bg-card);
    border-radius: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* ========================================
   Sidebar User Section
   ======================================== */

.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar nav {
    /* flex: 1; Removed to keep user section close to nav items */
    margin-bottom: 2rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-top: 1rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-user .user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-user .user-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.sidebar-user .user-link:hover {
    color: var(--accent);
}

.sidebar-user .user-link i {
    width: 20px;
    height: 20px;
}

.sidebar-user .user-name {
    font-size: 0.875rem;
}

.sidebar-user .user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 1.75rem;
}

.sidebar-user .logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-user .logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.sidebar-user .logout-btn i {
    width: 16px;
    height: 16px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.page-header h1 i {
    color: var(--accent);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    text-align: left;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table tbody tr {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tbody td {
    padding: 1rem 1.5rem;
}

/* Additional Badge Colors */
.badge-info {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.badge-success {
    background-color: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-secondary {
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

/* Flash Messages Container */
.flash-messages {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 500px;
}

/* Alert Styles */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
    animation: slideIn 0.3s ease-out;
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(34, 197, 94, 0.2));
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #4ade80;
    backdrop-filter: blur(12px);
}

.alert-error {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(239, 68, 68, 0.2));
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    backdrop-filter: blur(12px);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(234, 179, 8, 0.2));
    border: 1px solid rgba(234, 179, 8, 0.5);
    color: #facc15;
    backdrop-filter: blur(12px);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s, background-color 0.2s;
}

.alert-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

/* CSS Variables for consistency */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #334155;
}

/* ========================================
   Tooltips System
   ======================================== */

.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
    border-radius: 50%;
    cursor: help;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.tooltip-icon:hover {
    background: rgba(59, 130, 246, 0.4);
    transform: scale(1.1);
}

.tooltip-content {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.75rem;
    padding: 0.75rem 1rem;
    background: #1e293b;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.5;
    width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.tooltip-content::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: rgba(59, 130, 246, 0.3);
}

.tooltip-icon:hover+.tooltip-content,
.tooltip-content:hover {
    opacity: 1;
    visibility: visible;
}

.tooltip-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #22c55e;
}

.tooltip-content .tooltip-example {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ========================================
   Repository Type Selector
   ======================================== */

.repo-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.repo-type-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-dark);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.repo-type-option:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.05);
}

.repo-type-option.active {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.repo-type-option input[type="radio"] {
    display: none;
}

.repo-type-option .repo-icon {
    font-size: 1.5rem;
}

.repo-type-option .repo-info {
    flex: 1;
}

.repo-type-option .repo-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.repo-type-option .repo-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ========================================
   Dynamic Form Fields
   ======================================== */

.dynamic-fields {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.dynamic-fields .field-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dynamic-fields .field-header i {
    color: var(--accent);
}

.dynamic-fields .field-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.path-preview {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}

.path-preview-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.path-preview-label i {
    color: #22c55e;
    width: 14px;
    height: 14px;
}

.path-preview-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #22c55e;
    word-break: break-all;
}

/* Form Label with Tooltip */
.label-with-tooltip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.label-with-tooltip label {
    margin-bottom: 0;
}

/* ========================================
   Toggle Switch
   ======================================== */

.toggle-switch {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s;
    vertical-align: middle;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.toggle-label-text {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.toggle-label-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========================================
   Empty State Cards
   ======================================== */

.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    max-width: 500px;
    margin: 2rem auto;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    max-width: 380px;
}