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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f1f5f9;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Help panel */
.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 40;
}

.help-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    max-width: 48rem;
    background: #ffffff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 50;
    display: flex;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.help-panel-visible {
    transform: translateX(0);
}

.help-panel-hidden {
    transform: translateX(100%);
}

.help-panel-nav {
    width: 33.333%;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.help-panel-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.help-panel-nav-title {
    font-weight: 600;
    color: #1e293b;
}

.help-nav-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.help-nav-section {
    margin-bottom: 0.25rem;
}

.help-nav-section-btn {
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #475569;
    transition: background 0.15s, color 0.15s;
}

.help-nav-section-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.help-nav-section-btn.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
}

.help-nav-sublist {
    margin-top: 0.25rem;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 2px solid #e2e8f0;
}

.help-nav-subbtn {
    width: 100%;
    text-align: left;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    color: #64748b;
    transition: background 0.15s, color 0.15s;
}

.help-nav-subbtn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.help-panel-content-wrap {
    width: 66.666%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.help-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.help-panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.help-panel-close {
    font-size: 1.5rem;
    line-height: 1;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.help-panel-close:hover {
    color: #475569;
    background: #f1f5f9;
}

.help-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: #334155;
}

.help-panel-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    scroll-margin-top: 1rem;
}

.help-panel-body h3:first-child {
    margin-top: 0;
}

.help-panel-body p {
    margin-bottom: 0.75rem;
}

.help-panel-body ul {
    list-style-type: disc;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.help-panel-body li {
    margin-bottom: 0.375rem;
}

.help-panel-body code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    vertical-align: middle;
}

.help-icon:hover {
    color: #2563eb;
}

@media (max-width: 768px) {
    .help-panel {
        max-width: 100%;
        flex-direction: column;
    }

    .help-panel-nav {
        width: 100%;
        max-height: 40%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .help-panel-content-wrap {
        width: 100%;
        flex: 1;
    }
}
