/* 
 * Meal Feedback Portal - CSS Component
 * Version: 1.0.12
 * Last Modified: 2025-12-06 13:50:00 HST
 * Description: Added portal-welcome-row for inline info/welcome/close layout
 * v1.0.12: Added portal-welcome-row flexbox for inline header layout
 * v1.0.11: Much larger fonts for Portrait Desktop Mode to compensate for viewport scaling (~3x)
 * v1.0.10: Increased nav-button sizes and fonts for Portrait Desktop Mode readability
 * v1.0.9: Added 2-column grid to Portrait Desktop Mode media query for mobile browsers in desktop mode
 * v1.0.8: Force 2-column grid for nav-buttons on phones in portrait orientation
 * v1.0.7: Tighter header spacing, reduced padding and margins
 * v1.0.6: Compact header layout, portal-info-btn styles
 * v1.0.5: Added --css-version custom property for dynamic version display
 * v1.0.4: Added styles for auto-login masked credentials display, welcome user name, 5-click version easter egg
 * v1.0.3: Added login screen logo styling
 */

        /* ============================================ */
        /* CSS VERSION CONSTANT (v1.0.12)              */
        /* ============================================ */
        :root {
            --css-version: '1.0.12';
            --css-last-modified: '2025-12-06 13:50:00 HST';
        }
        
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            margin: 0;
            padding: 0;
            min-height: 100vh;
            color: #333;
            display: flex;
            flex-direction: column;
            overflow-x: hidden;
        }
        
        /* ===== ENHANCED LOGIN LAYOUT ===== */
        #loginScreen {
            display: block;
            min-height: 100vh;
            padding: 0;
            margin: 0;
            background: transparent;
        }
        
        .login-container {
            background: white;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            width: 100%;
            max-width: 600px;
            margin: 0 auto;
            padding: 0;
            position: relative;
            animation: slideDown 0.5s ease-out;
            overflow: visible;
        }
        
        .login-about-btn {
            position: absolute;
            top: 15px;
            left: 15px;
            background: rgba(102, 126, 234, 0.15);
            border: 2px solid rgba(102, 126, 234, 0.4);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            font-size: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 100;
        }
        
        .login-about-btn:hover {
            background: rgba(102, 126, 234, 0.25);
            transform: scale(1.05);
            border-color: rgba(102, 126, 234, 0.6);
        }
        
        #loginScreen .login-container .login-help-btn {
            position: absolute !important;
            top: 15px !important;
            right: 15px !important;
            background: rgba(76, 175, 80, 0.3) !important;
            border: 3px solid rgba(76, 175, 80, 0.8) !important;
            border-radius: 50% !important;
            width: 40px !important;
            height: 40px !important;
            font-size: 20px !important;
            cursor: pointer !important;
            transition: all 0.3s ease;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            z-index: 1000 !important;
            visibility: visible !important;
            opacity: 1 !important;
        }
        
        .login-help-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(76, 175, 80, 0.3) !important;
            border: 3px solid rgba(76, 175, 80, 0.8) !important;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            font-size: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex !important;
            align-items: center;
            justify-content: center;
            z-index: 100;
            visibility: visible !important;
            opacity: 1 !important;
        }
        
        #loginScreen .login-container .login-help-btn:hover,
        .login-help-btn:hover {
            background: rgba(76, 175, 80, 0.4) !important;
            transform: scale(1.05);
            border-color: rgba(76, 175, 80, 1) !important;
        }
        
        .login-form {
            padding: 40px;
        }
        
        .login-header {
            text-align: center;
            margin-bottom: 25px;
        }
        
        .login-header h1 {
            color: #333;
            font-weight: 600;
            font-size: 24px;
        }
        
        /* ===== LOGIN LOGO ===== */
        .login-logo-container {
            text-align: center;
            margin-bottom: 20px;
        }
        
        .login-logo {
            width: 120px;
            height: 120px;
            border-radius: 20px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #333;
        }
        
        .form-group input[type="text"],
        .form-group input[type="password"],
        .form-group input[type="email"],
        .form-group input[type="tel"] {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s;
        }
        
        .form-group input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        
        /* Password field wrapper for toggle button */
        .login-password-wrapper {
            position: relative;
            display: block;
        }
        
        .login-password-wrapper input[type="password"],
        .login-password-wrapper input[type="text"] {
            padding-right: 45px;
        }
        
        .login-password-toggle {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            font-size: 18px;
            padding: 5px;
            color: #666;
            transition: color 0.3s;
            z-index: 10;
        }
        
        .login-password-toggle:hover {
            color: #333;
        }
        
        .checkbox-group {
            margin: 20px 0;
        }
        
        .checkbox-group label {
            cursor: pointer;
            user-select: none;
        }
        
        .checkbox-group input[type="checkbox"] {
            margin-right: 8px;
        }
        
        .checkbox-group small {
            display: block;
            color: #666;
            margin-top: 5px;
            font-size: 12px;
        }
        
        /* ===== LOGIN BUTTON ROW CONTAINER ===== */
        .login-button-row {
            display: flex;
            gap: 12px;
            align-items: stretch;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        
        .login-button {
            padding: 14px 24px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            height: 52px;
            min-width: 120px;
            flex: 1 1 0;
            white-space: nowrap;
        }
        
        .login-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        }
        
        .login-button:disabled {
            background: #ccc;
            cursor: not-allowed;
            transform: none;
        }
        
        /* Passkey button styling - matches login button */
        .passkey-button-inline {
            padding: 14px 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 15px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            height: 52px;
            min-width: 120px;
            flex: 1 1 0;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        }
        
        .passkey-button-inline:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }
        
        .passkey-button-inline:disabled {
            background: #ccc;
            cursor: not-allowed;
            transform: none;
        }
        
        /* ===== LOGIN FOOTER ROW ===== */
        
        .login-footer-row {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 15px;
            margin-top: 20px;
            flex-wrap: wrap;
        }
        
        .login-footer-row .checkbox-group {
            margin-bottom: 0;
            flex: 1;
            min-width: 150px;
        }
        
        .help-tutorial-button {
            background: linear-gradient(135deg, #4caf50, #66bb6a);
            color: white;
            border: none;
            padding: 14px 20px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
            box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
            height: 52px;
            min-width: 120px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            flex: 1 1 0;
        }
        
        .help-tutorial-button:hover {
            background: linear-gradient(135deg, #45a049, #5cb85c);
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
        }
        
        .help-tutorial-button:active {
            transform: translateY(0);
        }
        
        /* ===== RECENT LOGINS POPUP ===== */
        .recent-logins-popup {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            animation: fadeIn 0.3s;
        }
        
        .recent-logins-popup.show {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .recent-logins-content {
            background: white;
            border-radius: 16px;
            padding: 0;
            width: 90%;
            max-width: 700px;
            max-height: 80vh;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.3s ease-out;
        }
        
        @keyframes slideUp {
            from {
                transform: translateY(20px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }
        
        .recent-logins-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 25px;
            position: relative;
        }
        
        .recent-logins-header h2 {
            margin: 0;
            font-size: 24px;
            font-weight: 600;
        }
        
        .recent-logins-header p {
            margin: 8px 0 0 0;
            opacity: 0.95;
            font-size: 14px;
        }
        
        .recent-logins-close {
            position: absolute;
            right: 20px;
            top: 20px;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            font-size: 24px;
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
        }
        
        .recent-logins-close:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }
        
        .recent-logins-body {
            padding: 25px;
            overflow-y: auto;
            max-height: calc(80vh - 180px);
        }
        
        .no-recent-logins {
            text-align: center;
            padding: 40px 20px;
            color: #666;
        }
        
        .no-recent-logins .icon {
            font-size: 48px;
            margin-bottom: 15px;
            opacity: 0.5;
        }
        
        .recent-logins-list {
            display: block;
        }
        
        .recent-login-item {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 10px;
            padding: 4px 10px;
            background: #f8f9fa;
            margin-bottom: 2px;
            border-radius: 4px;
            align-items: center;
            height: 22px;
            line-height: 22px;
        }
        
        .recent-login-item:hover {
            background: #e9ecef;
        }
        
        .login-name {
            color: #333;
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .login-time {
            color: #666;
            font-size: 12px;
            white-space: nowrap;
        }
        
        .recent-logins-footer {
            padding: 20px;
            border-top: 2px solid #f0f0f0;
            text-align: center;
            background: #f8f9fa;
        }
        
        /* ===== PORTAL MAIN SCREEN ===== */
        .portal-container {
            max-width: 100%;
            margin: 0;
            padding: 20px;
            position: relative;
        }
        
        .closeme {
            background: rgba(255, 255, 255, 0.9);
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            font-size: 24px;
            color: #666;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
            flex-shrink: 0;
        }
        
        .closeme:hover {
            background: white;
            color: #333;
            transform: scale(1.1);
        }
        
        /* ===== PORTAL INFO BUTTON (v1.0.6) ===== */
        .portal-info-btn {
            background: rgba(255, 255, 255, 0.9);
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            font-size: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
            flex-shrink: 0;
        }
        
        .portal-info-btn:hover {
            background: white;
            transform: scale(1.1);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }
        
        /* ===== PORTAL WELCOME ROW (v1.0.12) ===== */
        .portal-welcome-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 15px;
            margin-bottom: 10px;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
            border-radius: 12px;
        }
        
        .portal-welcome-row .portal-welcome-user {
            flex: 1;
            text-align: center;
            margin: 0 15px;
        }
        
        .portal-content {
            background: white;
            border-radius: 20px;
            padding: 15px 30px 30px 30px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            margin-top: 10px;
        }
        
        .portal-header {
            text-align: center;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 2px solid #f0f0f0;
            position: relative;
        }
        
        .portal-header h1 {
            color: #333;
            margin-bottom: 0;
            font-size: 24px;
            font-weight: 600;
        }
        
        .portal-header .about-link {
            color: #667eea;
            text-decoration: none;
            cursor: pointer;
            font-size: 14px;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            margin-top: 10px;
        }
        
        .portal-header .about-link:hover {
            text-decoration: underline;
        }
        
        .portal-section {
            margin-bottom: 25px;
        }
        
        .portal-section h2 {
            color: #333;
            margin-bottom: 20px;
            font-size: 24px;
            font-weight: 500;
        }
        
        .nav-buttons {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-bottom: 30px;
        }
        
        .nav-button {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            border-radius: 12px;
            padding: 15px 10px;
            color: white;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            min-height: 80px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
        }
        
        .nav-button:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        }
        
        .nav-button .icon {
            font-size: 24px;
            margin-bottom: 6px;
        }
        
        .nav-button .title {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 3px;
            line-height: 1.2;
        }
        
        .nav-button .subtitle {
            font-size: 11px;
            opacity: 0.9;
            font-weight: 400;
            line-height: 1.2;
        }
        
        .security-buttons {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }
        
        .security-button {
            background: #f8f9fa;
            border: 2px solid #e9ecef;
            border-radius: 10px;
            padding: 15px 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }
        
        .security-button:hover {
            border-color: #667eea;
            background: #f0f7ff;
        }
        
        /* Portal warnings */
        .portal-default-warning {
            background: linear-gradient(135deg, #fff3cd, #fff8e1);
            border: 2px solid #ffc107;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 30px;
            display: flex;
            align-items: center;
            gap: 15px;
            animation: slideDown 0.5s ease-out;
        }
        
        .portal-default-warning .icon {
            font-size: 36px;
            flex-shrink: 0;
        }
        
        .portal-default-warning .content {
            flex: 1;
        }
        
        .portal-default-warning .title {
            font-weight: 600;
            font-size: 16px;
            color: #856404;
            margin-bottom: 5px;
        }
        
        .portal-default-warning .message {
            font-size: 14px;
            color: #856404;
            margin-bottom: 10px;
        }
        
        .portal-default-warning .action-button {
            background: #ffc107;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            color: #333;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .portal-default-warning .action-button:hover {
            background: #ffb300;
            transform: translateY(-2px);
        }
        
        /* ===== MODAL STYLES ===== */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            animation: fadeIn 0.3s;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        @keyframes slideDown {
            from {
                transform: translateY(-20px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }
        
        .modal-content {
            background-color: white;
            margin: 5% auto;
            padding: 30px;
            border-radius: 20px;
            width: 90%;
            max-width: 600px;
            max-height: 85vh;
            overflow-y: auto;
            position: relative;
            box-shadow: 0 20px 40px rgba(0,0,0,0.2);
        }
        
        .modal-header {
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 2px solid #f0f0f0;
        }
        
        .modal-header h2 {
            color: #333;
            font-size: 28px;
            font-weight: 600;
            margin: 0;
        }
        
        .modal-close {
            position: absolute;
            right: 20px;
            top: 20px;
            font-size: 28px;
            font-weight: bold;
            color: #aaa;
            cursor: pointer;
            transition: color 0.3s;
        }
        
        .modal-close:hover {
            color: #000;
        }
        
        .modal-section {
            margin-bottom: 25px;
        }
        
        .modal-section h3 {
            color: #667eea;
            font-size: 18px;
            margin-bottom: 15px;
            font-weight: 600;
        }
        
        .modal-section p {
            line-height: 1.6;
            color: #666;
        }
        
        .info-grid {
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 12px 20px;
            margin-top: 15px;
        }
        
        .info-label {
            font-weight: 600;
            color: #333;
        }
        
        .info-value {
            color: #666;
        }
        
        /* Profile modal specific */
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 15px;
        }
        
        .form-row-single {
            margin-bottom: 15px;
        }
        
        .password-field-wrapper {
            position: relative;
        }
        
        .password-toggle {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            font-size: 18px;
            padding: 5px;
        }
        
        .password-strength {
            height: 4px;
            background: #e9ecef;
            border-radius: 2px;
            margin-top: 8px;
            overflow: hidden;
        }
        
        .password-strength-bar {
            height: 100%;
            width: 0%;
            transition: all 0.3s;
        }
        
        .password-strength-label {
            font-size: 12px;
            margin-top: 5px;
            font-weight: 500;
        }
        
        .default-password-warning {
            background: #fff3cd;
            border: 2px solid #ffc107;
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 20px;
            display: flex;
            align-items: start;
            gap: 10px;
        }
        
        .default-password-warning .icon {
            font-size: 24px;
            flex-shrink: 0;
        }
        
        .default-password-warning .content {
            flex: 1;
        }
        
        .default-password-warning .title {
            font-weight: 600;
            color: #856404;
            margin-bottom: 5px;
        }
        
        .default-password-warning .message {
            font-size: 14px;
            color: #856404;
        }
        
        .modal-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 25px;
        }
        
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }
        
        .btn-secondary {
            background: #f8f9fa;
            color: #333;
            border: 1px solid #dee2e6;
        }
        
        .btn-secondary:hover {
            background: #e9ecef;
        }
        
        .btn:disabled {
            background: #ccc;
            cursor: not-allowed;
            transform: none;
        }
        
        /* Messages */
        .message {
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
        }
        
        .message.error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        
        .message.success {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        
        .message.warning {
            background: #fff3cd;
            color: #856404;
            border: 1px solid #ffeaa7;
        }
        
        .loading {
            text-align: center;
            padding: 20px;
            color: #666;
        }
        
        .copyright {
            text-align: center;
            padding-top: 20px;
            border-top: 1px solid #e9ecef;
            color: #666;
            font-size: 14px;
        }
        
        .spinner {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255,255,255,0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        .hidden {
            display: none !important;
        }
        
        /* Responsive adjustments */
        @media (max-width: 768px) {
            .portal-container {
                padding: 10px;
            }
            
            .portal-content {
                padding: 15px;
                border-radius: 15px;
            }
            
            .portal-header {
                margin-bottom: 25px;
                padding-bottom: 20px;
            }
            
            .portal-header h1 {
                font-size: 24px;
            }
            
            .nav-buttons {
                grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
                gap: 8px;
            }
            
            .nav-button {
                padding: 8px 5px;
                min-height: 60px;
                border-radius: 10px;
            }
            
            .nav-button .icon {
                font-size: 18px;
                margin-bottom: 3px;
            }
            
            .nav-button .title {
                font-size: 11px;
                margin-bottom: 2px;
            }
            
            .nav-button .subtitle {
                font-size: 9px;
            }
            
            .security-buttons {
                grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
                gap: 10px;
            }
            
            .security-button {
                padding: 10px 12px;
                font-size: 13px;
                border-radius: 8px;
            }
            
            .modal-content {
                margin: 10% auto;
                padding: 20px;
                width: 95%;
            }
            
            .form-row {
                grid-template-columns: 1fr;
            }
            
            .recent-login-item {
                flex-direction: column;
                text-align: center;
                gap: 8px;
            }
            
            .login-time {
                font-size: 12px;
            }
        }
        
        /* Phone portrait - force 2 columns for navigation buttons (v1.0.8) */
        @media (max-width: 500px) and (orientation: portrait) {
            .nav-buttons {
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 8px;
            }
            
            .security-buttons {
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 8px;
            }
        }
        
        /* Portrait Desktop Mode - for mobile browsers in desktop mode */
        @media (min-width: 769px) and (orientation: portrait) {
            /* LOGIN FORM SCALING FOR PORTRAIT DESKTOP MODE */
            .login-form {
                max-width: 90% !important;
                padding: 90px 40px !important;
            }
            
            .login-header {
                margin-bottom: 40px !important;
            }
            
            .login-header h1 {
                font-size: 80px !important;
                margin-bottom: 20px !important;
            }
            
            .form-group {
                margin-bottom: 35px !important;
            }
            
            .form-group label {
                font-size: 32px !important;
                margin-bottom: 12px !important;
            }
            
            .form-group input[type="text"],
            .form-group input[type="password"],
            .form-group input[type="email"],
            .form-group input[type="tel"] {
                padding: 28px !important;
                font-size: 36px !important;
                border-width: 3px !important;
                border-radius: 12px !important;
            }
            
            .login-password-wrapper input[type="password"],
            .login-password-wrapper input[type="text"] {
                padding-right: 65px !important;
            }
            
            .login-password-toggle {
                font-size: 32px !important;
                right: 15px !important;
            }
            
            .checkbox-group {
                margin: 35px 0 !important;
            }
            
            .checkbox-group label {
                font-size: 28px !important;
            }
            
            .checkbox-group input[type="checkbox"] {
                width: 28px !important;
                height: 28px !important;
                margin-right: 12px !important;
            }
            
            .checkbox-group small {
                font-size: 22px !important;
                margin-top: 10px !important;
            }
            
            .login-footer-row {
                flex-direction: column;
                gap: 20px;
                align-items: stretch;
            }
            
            .help-tutorial-button {
                width: 100%;
                padding: 18px 20px !important;
                font-size: 32px !important;
                border-radius: 12px !important;
            }
            
            .login-button {
                padding: 30px !important;
                font-size: 38px !important;
                border-radius: 12px !important;
                margin-top: 10px !important;
            }
            
            .login-about-btn {
                width: 70px !important;
                height: 70px !important;
                font-size: 36px !important;
                top: 25px !important;
                left: 25px !important;
            }
            
            #loginScreen .login-container .login-help-btn,
            .login-help-btn {
                width: 70px !important;
                height: 70px !important;
                font-size: 36px !important;
                top: 25px !important;
                right: 25px !important;
                display: flex !important;
                visibility: visible !important;
            }
            
            /* PORTAL NAVIGATION - Force 2 columns in desktop mode (v1.0.9) */
            .nav-buttons {
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 10px !important;
            }
            
            .nav-button {
                padding: 20px 12px !important;
                min-height: 120px !important;
            }
            
            .nav-button .icon {
                font-size: 48px !important;
                margin-bottom: 10px !important;
            }
            
            .nav-button .title {
                font-size: 32px !important;
                margin-bottom: 6px !important;
            }
            
            .nav-button .subtitle {
                font-size: 24px !important;
            }
            
            .security-buttons {
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 10px !important;
            }
            
            .security-button {
                padding: 18px 14px !important;
                font-size: 32px !important;
            }
            
            /* PORTAL WELCOME ROW - Scaled for desktop mode (v1.0.12) */
            .portal-welcome-row {
                padding: 20px 25px !important;
                margin-bottom: 20px !important;
            }
            
            .portal-welcome-row .portal-info-btn,
            .portal-welcome-row .closeme {
                width: 70px !important;
                height: 70px !important;
                font-size: 36px !important;
            }
            
            .portal-welcome-row .portal-welcome-user {
                font-size: 32px !important;
            }
        }

/* ============================================
   PWA UPDATE SYSTEM STYLES (v1.0.1)
   ============================================ */

/* Update Banner */
.pwa-update-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: slideUp 0.3s ease-out;
}

.pwa-update-banner.show {
    display: flex;
}

.pwa-update-banner.error {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.pwa-update-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pwa-update-icon {
    font-size: 24px;
}

.pwa-update-text {
    flex: 1;
}

.pwa-update-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.pwa-update-text small {
    font-size: 13px;
    opacity: 0.9;
}

.pwa-update-dismiss {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.pwa-update-dismiss:hover {
    background: rgba(255,255,255,0.3);
}

/* Debug Console */
.pwa-debug-console {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 10001;
    padding: 20px;
    overflow-y: auto;
}

.pwa-debug-console.show {
    display: block;
}

.pwa-debug-panel {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.pwa-debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}

.pwa-debug-header h2 {
    margin: 0;
    color: #667eea;
    font-size: 24px;
}

.pwa-debug-close {
    background: #f5f5f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pwa-debug-close:hover {
    background: #e0e0e0;
}

.pwa-debug-section {
    margin-bottom: 24px;
}

.pwa-debug-section h3 {
    color: #764ba2;
    font-size: 18px;
    margin-bottom: 12px;
}

.pwa-debug-info {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.pwa-debug-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.pwa-debug-row:last-child {
    border-bottom: none;
}

.pwa-debug-label {
    font-weight: 600;
    color: #555;
}

.pwa-debug-value {
    color: #333;
    font-family: 'Courier New', monospace;
}

.pwa-debug-value.status-ok {
    color: #28a745;
}

.pwa-debug-value.status-error {
    color: #dc3545;
}

.pwa-debug-value.status-warning {
    color: #ffc107;
}

.pwa-debug-log {
    background: #2d2d2d;
    color: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.pwa-debug-log div {
    margin-bottom: 4px;
}

.pwa-debug-log .error {
    color: #ff6b6b;
}

.pwa-debug-log .warning {
    color: #ffd93d;
}

.pwa-debug-log .success {
    color: #6bcf7f;
}

.pwa-debug-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.pwa-debug-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-debug-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pwa-debug-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pwa-debug-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.pwa-debug-btn-secondary:hover {
    background: #e0e0e0;
}

/* About Modal - Update Log Button */
.update-log-button {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.update-log-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .pwa-update-banner {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    
    .pwa-update-content {
        flex-direction: column;
        text-align: center;
    }
    
    .pwa-update-dismiss {
        width: 100%;
    }
    
    .pwa-debug-panel {
        padding: 16px;
    }
    
    .pwa-debug-actions {
        flex-direction: column;
    }
}

/* ============================================
   MASKED CREDENTIALS STYLES (v1.0.4)
   ============================================ */

/* Masked field appearance */
.masked-field {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.masked-field:focus {
    background-color: #fff !important;
}

/* Not You Link */
.not-you-link {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.not-you-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.not-you-link a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.not-you-link a::before {
    content: "👤";
}

.not-you-link.hidden {
    display: none;
}

/* ============================================
   WELCOME USER MESSAGE (v1.0.4)
   ============================================ */

.portal-welcome-user {
    text-align: center;
    font-size: 16px;
    color: #667eea;
    font-weight: 500;
    margin-bottom: 2px;
    padding: 0;
}

.portal-welcome-user.hidden {
    display: none;
}

/* ============================================
   COMPONENT VERSIONS PANEL (v1.0.4)
   ============================================ */

.component-versions-panel {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.component-versions-panel.hidden {
    display: none;
}

.component-versions-panel h4 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.version-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: white;
    margin-bottom: 4px;
    border-radius: 6px;
    font-size: 13px;
}

.version-row:last-child {
    margin-bottom: 0;
}

.version-name {
    color: #495057;
    font-family: 'Courier New', monospace;
}

.version-num {
    color: #667eea;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Make version clickable in About modal */
#systemVersion {
    cursor: pointer;
    transition: color 0.2s;
}

#systemVersion:hover {
    color: #667eea;
}

/* ============================================
   AUTO-LOGIN LOADING STATE (v1.0.4)
   ============================================ */

.auto-login-loading {
    position: relative;
}

.auto-login-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 15px;
    width: 16px;
    height: 16px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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