* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body, html {
    height: 100vh;
    overflow: hidden;
    background-color: #f4f6f9;
}

/* --- DESKTOP LAYOUT (3 Columns) --- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    grid-template-rows: 100vh;
    height: 100vh;
    width: 100vw;
}

.menu-left {
    background: #ffffff;
    border-right: 1px solid #e1e4e8;
    padding: 20px;
}

.content-panel {
    background: #f8f9fa;
    overflow-y: auto;
    padding: 20px;
}

.menu-right {
    background: #ffffff;
    border-left: 1px solid #e1e4e8;
    padding: 20px;
    overflow-y: auto;
}

/* UI Elements inside layout */
h2, h3 { margin-bottom: 15px; color: #333; }
ul { list-style: none; }
ul li { margin-bottom: 10px; }
ul li a { text-decoration: none; color: #0066cc; font-weight: 500; }

.card {
    background: #ffffff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.auth-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn {
    width: 100%;
    padding: 10px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn:hover { background: #0052a3; }
.logout-btn { background: #dc3545; margin-top: 10px; display: block; text-align: center; text-decoration: none;}
.logout-btn:hover { background: #bd2130; }

.alert { padding: 10px; margin-bottom: 15px; border-radius: 4px; font-size: 14px; }
.alert.error { background: #f8d7da; color: #721c24; }
.alert.success { background: #d4edda; color: #155724; }

.auth-tabs { display: flex; gap: 10px; margin-bottom: 15px; }
.auth-tabs button { flex: 1; padding: 8px; background: #e2e8f0; border: none; border-radius: 4px; cursor: pointer; }

/* --- MOBILE / WEB APP LAYOUT (Top & Bottom Static, Center Scrolling) --- */
@media (max-width: 768px) {
    .app-container {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 60px 1fr 70px; /* Top menu, Central Scroll, Bottom menu */
        height: 100vh;
    }

    .menu-left {
        grid-row: 1;
        border-right: none;
        border-bottom: 1px solid #e1e4e8;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
    }
    .menu-left h2 { display: none; }
    .menu-left ul { display: flex; gap: 15px; }

    .content-panel {
        grid-row: 2;
    }

    .menu-right {
        grid-row: 3;
        border-left: none;
        border-top: 1px solid #e1e4e8;
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 10px;
        overflow-y: hidden;
    }
    .menu-right h2, .menu-right p { display: none; }
    .auth-form { display: none !important; } /* Simplify mobile auth modals or redirect to dedicated states */
}
/* --- Loading Spinner Styles --- */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: #0066cc;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}