/* Page Structure */
.page-wrapper {
    display: flex;
    height: 100vh;
    background: #f7fafc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    border-right: 1px solid #d1d5db;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #d1d5db;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    gap: 0;
}

.nav-btn {
    appearance: none;
    background: transparent;
    border: none;
    border-left: 4px solid transparent;
    padding: 10px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #f0f1f3;
    color: #374151;
}

.nav-btn.active {
    background: #fff;
    border-left-color: #0ea5a4;
    color: #0ea5a4;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-left: 0;
}

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    flex: 1;
}

.message {
    padding: 8px 12px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 6px;
    font-size: 13px;
    animation: slideIn 0.3s ease;
}

.message.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

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

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.tab-content {
    display: none;
}

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

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

.section-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

/* Table Wrapper */
.table-wrapper {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.table thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #374151;
}

.table tbody tr:hover {
    background: #f9fafb;
}

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

/* Buttons */
.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-primary {
    background: #0ea5a4;
    border-color: #0ea5a4;
    color: #fff;
}

.btn-primary:hover {
    background: #0d9488;
    border-color: #0d9488;
}

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

/* Links styled as buttons */
a.btn {
    text-decoration: none;
}

a.btn:hover {
    text-decoration: none;
}

/* Modal Dialog */
.dialog {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0;
    width: 750px !important;
    max-width: 95vw !important;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.dialog:not([open]) {
    display: none;
    pointer-events: none;
}

#pitchModal {
    width: 750px !important;
    max-width: 95vw !important;
}

#exportModal {
    width: 750px !important;
    max-width: 95vw !important;
}

/* Override Basecoat's container width constraint */
@media (min-width: 40rem) {
    .dialog>div {
        max-width: 750px !important;
    }

    #pitchModal>div {
        max-width: 750px !important;
    }

    #exportModal>div {
        max-width: 750px !important;
    }
}

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

.dialog>div {
    display: flex;
    flex-direction: column;
    height: auto;
}

/* More specific selector to override Basecoat's .dialog>*>header rule */
.dialog>*>header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.dialog>*>header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    flex: 0 1 auto;
}

.dialog>*>header button {
    appearance: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    transition: color 0.2s ease;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog header button:hover {
    color: #1f2937;
}

.dialog section {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Confirm Dialog */
.dialog-confirm {
    max-width: 350px;
    max-height: fit-content;
}

.dialog-confirm>div {
    height: auto;
}

/* Form */
form {
    display: flex;
    flex-direction: column;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: #0ea5a4;
    box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.1);
}

textarea.input {
    resize: vertical;
    min-height: 100px;
}

/* Export Content */
#exportContent {
    line-height: 1.6;
}

#exportContent p {
    margin: 0 0 12px 0;
    color: #374151;
}

#exportContent strong {
    color: #1f2937;
}

#exportContent pre {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .page-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #d1d5db;
    }

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

    .dialog {
        max-width: 95vw;
        width: auto;
    }

    .table {
        font-size: 13px;
    }

    .table th,
    .table td {
        padding: 8px 12px;
    }
}