/* cowork-db Frontend Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --text: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn.disabled,
.btn[aria-disabled="true"] {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
}

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

.btn-copy:hover {
    background: var(--primary-dark);
}

.code-actions {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 6rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.hero .tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Features Section */
.features {
    padding: 5rem 0;
    background: var(--bg);
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

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

.feature-card {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
}

/* Beta Section */
.beta {
    padding: 5rem 0;
    background: var(--bg-secondary);
    text-align: center;
}

.beta h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.beta-card {
    max-width: 400px;
    margin: 0 auto;
    padding: 2.5rem;
    background: var(--bg);
    border-radius: 0.75rem;
    border: 2px solid var(--border);
    box-shadow: 0 4px 6px var(--shadow);
}

.beta-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.beta-summary {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.beta-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.feature-list {
    list-style: none;
    margin-bottom: 2rem;
    text-align: left;
}

.feature-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    background: var(--bg);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Dashboard */
.dashboard {
    min-height: calc(100vh - 4rem);
    background: var(--bg-secondary);
    padding: 3rem 0;
}

.loading-state {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

.onboarding-card {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem;
    background: var(--bg);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px var(--shadow);
}

.onboarding-card h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.intro {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.step-list {
    margin: 2rem 0;
}

.step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.step-content h3 {
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-secondary);
}

.dashboard-content {
    max-width: 900px;
    margin: 0 auto;
}

.dashboard-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.status-card,
.install-card,
.access-card,
.error-card {
    background: var(--bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.dashboard {
    background:
        radial-gradient(1200px 500px at 10% -20%, rgba(37, 99, 235, 0.08), transparent 60%),
        radial-gradient(900px 500px at 90% -10%, rgba(16, 185, 129, 0.07), transparent 55%),
        var(--bg-secondary);
}

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

.status-header h2 {
    font-size: 1.5rem;
}

.badge {
    padding: 0.375rem 0.875rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-details {
    display: grid;
    gap: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-item .label {
    font-weight: 500;
}

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

#userNamespace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    word-break: break-all;
}

.install-card h2,
.access-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.help-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.command-platform {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.command-platform label {
    font-size: 0.9rem;
    font-weight: 600;
}

.command-platform select {
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg);
    padding: 0.45rem 0.65rem;
}

.platform-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.code-block {
    position: relative;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    display: block;
    padding-right: 5rem;
}

.info-box {
    background: #fef3c7;
    border-left: 4px solid var(--warning);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0.25rem;
}

.info-box strong {
    display: block;
    margin-bottom: 0.5rem;
}

.info-box ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

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

.access-item {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.access-item h3 {
    margin-bottom: 0.5rem;
}

.access-item p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.regenerate-section {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.regenerate-section .help-text {
    margin-top: 0.5rem;
}

.error-card {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

.error-card h2 {
    color: var(--danger);
    margin-bottom: 1rem;
}

.error-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero .tagline {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .feature-grid,
    .access-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-content h1 {
        font-size: 1.75rem;
    }

    .onboarding-card {
        padding: 2rem 1.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

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

.modal-content {
    background: var(--bg);
    border-radius: 0.75rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.btn-close:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.modal-body code {
    background: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.code-block-large {
    max-height: 300px;
    overflow: auto;
}

.code-block-large pre {
    white-space: pre;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Platform Selector */
.platform-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.platform-tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.platform-tab:hover {
    color: var(--primary);
    background: var(--bg-secondary);
}

.platform-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.platform-content {
    display: none;
}

.platform-content.active {
    display: block;
}

.instructions {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
}

.instructions h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.instructions ol {
    margin-left: 1.25rem;
    color: var(--text-secondary);
}

.instructions ol li {
    margin-bottom: 0.5rem;
}

.instructions .note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--success);
    font-style: italic;
}

/* Regenerate section improvements */
.regenerate-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Documentation Page */
.docs-page {
    padding: 2rem 0 4rem;
}

.docs-header {
    text-align: center;
    margin-bottom: 3rem;
}

.docs-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.docs-header .lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.docs-header .beta-banner {
    margin: 1rem auto 0;
    max-width: 700px;
    padding: 0.875rem 1rem;
    border: 1px solid #fde68a;
    background: #fffbeb;
    border-radius: 0.5rem;
    color: #78350f;
}

.docs-content {
    max-width: 800px;
    margin: 0 auto;
}

.docs-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

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

.docs-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.docs-section h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text);
}

.docs-section h4 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
    color: var(--text);
}

.docs-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.docs-section ul, .docs-section ol {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.docs-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

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

.docs-section a:hover {
    text-decoration: underline;
}

.docs-section code {
    background: var(--bg-secondary);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Architecture diagram */
.architecture-diagram {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.architecture-diagram pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre;
}

/* Step cards */
.step-card {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-card .step-number {
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.step-card p {
    margin-bottom: 0.75rem;
}

.step-card ul {
    margin-bottom: 0;
}

.requirements-box {
    background: #fef3c7;
    border-left: 4px solid var(--warning);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0.25rem;
}

.requirements-box strong {
    color: var(--text);
    display: block;
    margin-bottom: 0.5rem;
}

.requirements-box ul {
    margin: 0.5rem 0 0 1.5rem;
    color: var(--text);
}

/* Tools grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.tool-card {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
}

.tool-card h4 {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--primary);
    margin: 0 0 0.5rem;
}

.tool-card p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-secondary);
}

.tools-cta {
    text-align: center;
    margin-top: 1.5rem;
}

/* FAQ */
.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item h4 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.faq-item p {
    margin: 0;
}

/* Nav active state */
.nav-links a.active {
    color: var(--primary);
    font-weight: 500;
}

.regenerate-section .btn {
    flex-shrink: 0;
}

.regenerate-section .help-text {
    flex-basis: 100%;
    margin-top: 0.5rem;
}

/* API Keys Card */
.api-keys-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.api-keys-card h2 {
    margin-bottom: 0.5rem;
}

.api-keys-list {
    margin: 1rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.api-keys-list .empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.api-keys-list .empty-state .hint {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.api-key-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
    background: var(--bg-secondary);
    border-left-width: 4px;
}

.api-key-item.revoked,
.api-key-item.expired {
    opacity: 0.6;
}

.api-key-item.active {
    border-left-color: var(--success);
}

.api-key-item.revoked {
    border-left-color: var(--danger);
}

.api-key-item.expired {
    border-left-color: var(--secondary);
}

.key-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.key-name {
    font-weight: 500;
}

.key-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

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

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

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

.key-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.api-keys-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.key-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    border: none;
    border-radius: 0.5rem;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Ensure dialogs are hidden by default */
dialog:not([open]) {
    display: none;
}

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

.modal-content {
    padding: 1.5rem;
}

.modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.form-advanced {
    margin-top: 1rem;
    border: 1px dashed var(--border);
    border-radius: 0.5rem;
    padding: 0.875rem;
    background: rgba(248, 250, 252, 0.8);
}

.form-advanced summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-advanced[open] summary {
    margin-bottom: 0.75rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.warning-box {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.warning-box strong {
    color: #92400e;
}

.warning-box p {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: #92400e;
}

.warning-text {
    color: var(--danger);
    font-size: 0.9rem;
}

.api-key-display {
    position: relative;
    word-break: break-all;
}

.api-key-display code {
    display: block;
    padding-right: 80px;
    font-size: 0.8rem;
}

.mcp-config-hint {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.375rem;
}

.mcp-config-hint p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.mcp-config-hint pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    overflow-x: auto;
    margin: 0;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.loading-text {
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem;
}

.error-text {
    color: var(--danger);
    text-align: center;
    padding: 1rem;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-content {
    padding: 2rem;
}

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

.sidebar-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: background 0.2s, color 0.2s;
}

.btn-close:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

/* Sidebar overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 999;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}
