/* Shared layout for all qxeet pages */
:root {
    --md-sys-color-primary: #667eea;
    --md-sys-color-secondary: #764ba2;
    --md-sys-color-surface: #f8f9fa;
    --md-sys-color-on-surface: #1c1b1f;
    --header-height: 60px;
    --nav-height: 60px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 28px;
    background: url('../assets/qxeet-icon-192.png') no-repeat center;
    background-size: contain;
}

.logo-text {
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-alias {
    font-weight: 600;
    color: #333;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.header-user-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #667eea;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}

.header-user-btn:hover {
    background: rgba(102, 126, 234, 0.12);
    transform: scale(1.05);
}

.header-user-btn .material-symbols-outlined {
    font-size: 26px;
}

.header-link:hover {
    text-decoration: underline;
}

.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    padding-bottom: 40px;
}

.error-message {
    background: #fdecea;
    color: #b3261e;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
}

.success-message {
    background: #e6f4ea;
    color: #1e7d32;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
}

.loading {
    text-align: center;
    padding: 30px 0;
    color: #999;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

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

.card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 24px;
}

.primary-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.15s ease;
}

.primary-btn:hover {
    transform: translateY(-1px);
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #667eea;
    border-radius: 12px;
    background: transparent;
    color: #667eea;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.danger-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: #b3261e;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.qr-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.qr-modal.active {
    display: flex;
}

.qr-content {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    max-width: 320px;
}

.qr-title {
    margin-bottom: 8px;
}

.qr-code {
    display: flex;
    justify-content: center;
    margin: 12px 0;
}

.qr-close {
    margin-top: 8px;
    padding: 10px 28px;
    border: none;
    border-radius: 10px;
    background: #667eea;
    color: #fff;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 600px) {
    .user-alias {
        display: none;
    }
}
