:root {
    color-scheme: light dark;
    --sidebar-width: 260px;
    --background: #f5f6f8;
    --sidebar-bg: #212529;
    --sidebar-text: #ffffff;
    --accent: #0d6efd;
    --accent-text: #ffffff;
    --text-color: #212529;
    --border-color: #dee2e6;
    font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text-color);
}

a {
    color: inherit;
    text-decoration: none;
}

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
    height: 100%;
}

.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    gap: 24px;
    justify-content: space-between;
}

.sidebar__title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sidebar__logo {
    width: 120px;
    height: 120px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
}

.sidebar__top {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar__user {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar__user-label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar__user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
    letter-spacing: 0.01em;
}

.sidebar__footer {
    margin-top: auto;
}

.sidebar__button {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: inherit;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease, border 0.2s ease;
}

.sidebar__button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
}

.sidebar__section-title {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.7;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.sidebar__menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar__menu-item {
    padding: 12px 14px;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar__menu-item.is-active,
.sidebar__menu-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar__menu-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar__menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.9;
}

.sidebar__menu-text {
    flex: 1;
    min-width: 0;
}

.sidebar__menu-name {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
}

.sidebar__menu-description {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 2px;
    line-height: 1.3;
}

.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100%;
}

.content {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: auto;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px;
}

.message {
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.message--success {
    background: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.message--error {
    background: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.message--info {
    background: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    padding: 24px;
}

.card__title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.card__description {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 24px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 420px;
}

.form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form__label {
    font-size: 0.9rem;
    font-weight: 500;
}

.form__input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.form input,
.form select,
.form textarea {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.form__error {
    font-size: 0.85rem;
    color: #dc3545;
}

.form__submit {
    align-self: flex-start;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.form__submit:hover {
    opacity: 0.85;
}

.iframe-container {
    margin: 0;
    border-radius: 0;
    border: none;
    overflow: hidden;
    min-height: 0;
    background: #ffffff;
    flex: 1;
    display: flex;
}

.iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    color: rgba(33, 37, 41, 0.7);
    font-size: 1rem;
}

.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
    overflow: auto;
}

.workspace__iframe {
    flex: 1;
    display: flex;
}

.workspace__placeholder {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(33, 37, 41, 0.7);
    font-size: 1rem;
}

.home-page {
    padding: 48px 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.home-page__header {
    text-align: center;
    margin-bottom: 48px;
}

.home-page__logo {
    margin-bottom: 24px;
}

.home-page__logo img {
    max-width: 500px;
    max-height: 300px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.home-page__title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.home-page__subtitle {
    font-size: 1.1rem;
    color: rgba(33, 37, 41, 0.7);
    margin: 0;
}

.home-page__apps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 350px));
    gap: 24px;
    width: 100%;
    justify-content: center;
}

.app-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.app-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    flex-shrink: 0;
}

.app-card__icon svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.app-card__icon--telepulse {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.app-card__icon--postgram {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.app-card__icon--botlab {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.app-card__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-color);
    width: 100%;
}

.app-card__description {
    font-size: 0.95rem;
    color: rgba(33, 37, 41, 0.7);
    line-height: 1.6;
    margin: 0 0 24px 0;
    flex: 1;
    width: 100%;
}

.app-card__link {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.app-card__link:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

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

    .sidebar {
        flex-direction: column;
        gap: 16px;
    }

    .content {
        padding: 24px 20px;
    }

    .home-page {
        padding: 32px 20px;
    }

    .home-page__title {
        font-size: 1.5rem;
    }

    .home-page__subtitle {
        font-size: 1rem;
    }

    .home-page__apps {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .app-card {
        padding: 24px;
    }
}

