* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #202124;
    background: #f7f9fc;
}

.webapp-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

.min-w-0 {
    min-width: 0;
}

.install-popup {
    position: fixed;
    z-index: 10;
    top: 16px;
    left: 50%;
    width: min(640px, calc(100% - 32px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(60, 64, 67, 0.18);
    transform: translateX(-50%);
}

.install-popup[hidden] {
    display: none;
}

.install-popup strong,
.install-popup span {
    display: block;
}

.install-popup strong {
    margin-bottom: 2px;
    font-size: 15px;
}

.install-popup span {
    color: #5f6368;
    font-size: 14px;
}

.install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.install-button,
.install-close {
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
}

.install-button {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid #1a73e8;
    background: #1a73e8;
    color: #ffffff;
    font-weight: 700;
}

.install-close {
    width: 38px;
    height: 38px;
    border: 1px solid #dadce0;
    background: #ffffff;
    color: #5f6368;
}

.login-home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 32px 20px;
}

.login-logo {
    display: block;
    width: min(260px, 72vw);
    height: auto;
}

.google-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #ffffff;
    color: #202124;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.2);
}

.google-login-button:hover,
.google-login-button:focus {
    background: #f8fafd;
    border-color: #c9d7f0;
}

.login-error {
    max-width: 420px;
    margin: 0;
    color: #b3261e;
    font-size: 15px;
    text-align: center;
}

.app-header {
    padding: 0;
    background: transparent;
}

.app-topbar {
    min-height: 68px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #202124;
    box-shadow: 0 8px 22px rgba(32, 33, 36, 0.18);
}

.app-topbar .container-fluid {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
    padding-left: 32px !important;
    padding-right: 32px !important;
    padding-top: 12px;
    padding-bottom: 18px;
}

.app-user {
    max-width: none;
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-user-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    object-fit: cover;
    object-position: center;
}

.app-user-name {
    display: block;
    min-width: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.logout-button {
    min-height: 40px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: #dc3545;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.24);
}

.logout-button:hover,
.logout-button:focus {
    background: #bb2d3b;
    color: #ffffff;
    text-decoration: none;
}

.app-main {
    min-height: calc(100vh - 68px);
    padding: 0;
}

@media (min-width: 992px) {
    .app-topbar .container-fluid {
        padding-left: 48px !important;
        padding-right: 48px !important;
    }
}

@media (max-width: 560px) {
    .install-popup {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-header {
        padding: 0;
    }

    .app-topbar {
        min-height: 60px;
    }

    .app-topbar .container-fluid {
        min-height: 60px;
        gap: 8px;
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-top: 10px;
        padding-bottom: 16px;
    }

    .app-user {
        gap: 10px;
    }

    .app-user-avatar {
        width: 38px;
        height: 38px;
    }

    .app-user-name {
        font-size: 17px;
    }

    .logout-button {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .app-main {
        min-height: calc(100vh - 60px);
    }
}
