/* Environment Shell Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #ffffff;
    color: #333;
    line-height: 1.5;
}

.screen {
    min-height: 100vh;
}

/* ==================== LOGIN SCREEN ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.login-header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: #1f2937;
}

.login-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.login-form {
    padding: 2rem;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.login-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #d6a854;
    box-shadow: 0 0 0 3px rgba(214, 168, 84, 0.15);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.login-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #d6a854 0%, #c49643 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.login-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #c49643 0%, #b38a3b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214, 168, 84, 0.3);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.button-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.login-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.login-footer p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

/* ==================== MAIN APP SCREEN ==================== */
#main-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 60px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 100;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: flex;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    color: #374151;
}

.sidebar-toggle:hover {
    background: #f3f4f6;
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem 0.375rem 0.375rem;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    border-color: #d6a854;
    background: #fffbeb;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #d6a854 0%, #c49643 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar svg {
    width: 18px;
    height: 18px;
    color: white;
}

.user-menu-btn .chevron {
    width: 16px;
    height: 16px;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.user-menu-btn.open .chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    overflow: hidden;
    z-index: 1000;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-info {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.user-email {
    font-size: 0.875rem;
    color: #374151;
    word-break: break-all;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.dropdown-item:hover {
    background: #f9fafb;
}

.dropdown-item.logout {
    color: #dc2626;
}

.dropdown-item.logout:hover {
    background: #fef2f2;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
}

/* Sidebar - Hidden by default */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 280px;
    height: calc(100vh - 60px);
    background: white;
    border-right: 1px solid #e5e7eb;
    z-index: 90;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-header h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.sidebar-nav {
    padding: 0.75rem 0;
}

.module-list {
    list-style: none;
}

.module-item {
    margin: 0.25rem 0.75rem;
}

.module-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.module-btn:hover {
    background: #f3f4f6;
}

.module-btn.active {
    background: linear-gradient(135deg, rgba(214, 168, 84, 0.1) 0%, rgba(196, 150, 67, 0.1) 100%);
    color: #b38a3b;
    font-weight: 500;
}

.module-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.module-btn.active svg {
    color: #d6a854;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 80;
}

.sidebar-overlay.open {
    display: block;
}

/* Main Content */
.main-content {
    margin-left: 0;
    height: calc(100vh - 60px);
    background: #f5f5f5;
    overflow: hidden;
}

.module-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* ==================== DASHBOARD ==================== */
.dashboard-view {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
    background: #ffffff;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.dashboard-header h1 span {
    color: #d6a854;
}

.dashboard-header p {
    color: #6b7280;
    font-size: 1rem;
}

.dashboard-modules {
    max-width: 900px;
    margin: 0 auto;
}

.module-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.module-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.module-card:hover {
    border-color: #d6a854;
    box-shadow: 0 4px 20px rgba(214, 168, 84, 0.15);
    transform: translateY(-2px);
}

.module-card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(214, 168, 84, 0.1) 0%, rgba(196, 150, 67, 0.15) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.module-card-icon svg {
    width: 28px;
    height: 28px;
    color: #d6a854;
}

.module-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.module-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 320px;
    }

    .logo-text {
        display: none;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .module-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-card {
        margin: 0.5rem;
        border-radius: 12px;
    }

    .login-header {
        padding: 2rem 1.5rem 1.25rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-form {
        padding: 1.5rem;
    }

    .app-header {
        padding: 0 1rem;
    }

    .dashboard-view {
        padding: 1rem;
    }

    .dashboard-header {
        padding-top: 1rem;
        margin-bottom: 2rem;
    }
}
