:root {
    --bg-app: #fdfcf8;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --primary: #475569;
    --primary-hover: #1e293b;
    --text-main: #1f2937;
    --text-muted: #64748b;
    --text-inverse: #f8fafc;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --footer-bg: #1e293b;
}

html,
body {
    height: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    overflow: hidden;
}

#app {
    height: 100vh;
    overflow: hidden;
}

.app-shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#org-portal-frame-root {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);

    h1 {
        font-size: 2.5rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        letter-spacing: -0.025em;
        color: var(--primary-hover);
    }

    p {
        color: var(--text-muted);
        font-size: 1.1rem;
    }
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;

    h2 {
        margin-top: 0;
        font-size: 1.8rem;
        color: var(--primary-hover);
    }
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;

    &:hover {
        background: var(--primary-hover);
        transform: translateY(-1px);
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    }

    &:disabled {
        cursor: not-allowed;
        opacity: 0.65;
        transform: none;
        box-shadow: none;
    }

    & + & {
        margin-left: 1rem;
    }
}

.footer {
    margin-top: auto;
    background: var(--footer-bg);
    color: var(--text-inverse);
    display: block;

    .wrapper {
        max-width: 1200px;
        width: 100%;
        margin: 0 auto;
        padding: 3rem 2rem;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }

    h3 {
        color: var(--text-inverse);
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        font-weight: 700;
        margin-bottom: 1.5rem;
        border-bottom: 1px solid #475569;
        padding-bottom: 0.5rem;
        margin-right: 1rem;
    }

    ul {
        li {
            color: #cbd5e1;
            font-size: 0.95rem;
            margin-bottom: 0.75rem;
            cursor: pointer;
            transition: color 0.2s;

            &:hover {
                color: white;
            }
        }
    }
}

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

    &:hover {
        background: var(--bg-surface-hover);
        color: var(--text-main);
    }
}

.org-danger-btn {
    background: #7f1d1d;
    color: #fef2f2;

    &:hover {
        background: #991b1b;
    }
}

.org-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
}

.org-icon {
    width: 1rem;
    height: 1rem;
}

.org-page-header {
    text-align: left;
    margin-bottom: 0;
}

.org-page-heading {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.org-page-kicker {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.org-page-title {
    margin: 0;
}

.org-page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.org-page-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 960px) {
    .container {
        padding: 1.5rem;
    }

    .header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;

        h1 {
            font-size: 2rem;
        }
    }

    .footer .wrapper {
        grid-template-columns: 1fr;
    }

    .org-page-heading {
        gap: 0.3rem;
    }
}
