/* styles */
        :root {
            --primary: #2E7D32;
            --primary-dark: #1B5E20;
            --primary-light: #4CAF50;
            --secondary: #FF6F00;
            --secondary-dark: #E65100;
            --secondary-light: #FFB300;
            --background: #F5F5F5;
            --surface: #FFFFFF;
            --error: #D32F2F;
            --text-primary: #212121;
            --text-secondary: #757575;
            --divider: #BDBDBD;
            --success: #388E3C;
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background-color: var(--background);
            color: var(--text-primary);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            -webkit-font-smoothing: antialiased;
        }

        .app-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            max-width: 100%;
            margin: 0 auto;
            width: 100%;
            background: var(--surface);
        }

        /* Header */
        .header {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            padding: 1rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header h1 {
            font-size: 1.5rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .header .subtitle {
            font-size: 0.875rem;
            opacity: 0.9;
            margin-top: 0.25rem;
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logout-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 0.25rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
            transition: background 0.3s ease;
        }

        .logout-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .logout-btn .material-icons {
            font-size: 1.125rem;
        }

        /* Footer */
        .footer {
            text-align: center;
            margin-top: 20px;
            padding: 1rem;
            font-size: 0.85rem;
            color: var(--text-secondary);
            background: var(--background);
            border-top: 1px solid #ccc;
            position: fixed;
            bottom: 0;
            width: 100%;
        }




        /* Navigation */
        .nav-tabs {
            display: flex;
            background: var(--surface);
            border-bottom: 1px solid var(--divider);
            position: sticky;
            top: 4.5rem;
            z-index: 99;
        }

        .nav-tab {
            flex: 1;
            padding: 1rem;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 0.875rem;
            font-weight: 500;
            text-transform: uppercase;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
        }

        .nav-tab.active {
            color: var(--primary);
        }

        .nav-tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--primary);
        }

        .nav-tab:hover {
            background: rgba(0,0,0,0.05);
        }

        /* Content Area */
        .content {
            flex: 1;
            padding: 1rem;
            overflow-y: auto;
        }

        .screen {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .screen.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Home Screen */
        .home-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            padding: 2rem 1rem;
        }

        .home-card {
            background: var(--surface);
            border-radius: 1rem;
            padding: 2rem 1rem;
            text-align: center;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        .home-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 12px rgba(0,0,0,0.15);
            border-color: var(--primary-light);
        }

        .home-card .icon {
            font-size: 3rem;
            margin-bottom: 0.5rem;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .home-card h3 {
            font-size: 1.25rem;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
        }

        .home-card p {
            font-size: 0.875rem;
            color: var(--text-secondary);
        }

        /* Forms */
        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
            font-weight: 500;
            font-size: 0.875rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .form-control {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid var(--divider);
            border-radius: 0.5rem;
            font-size: 1rem;
            transition: all 0.3s ease;
            background: var(--surface);
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
        }

        textarea.form-control {
            resize: vertical;
            min-height: 100px;
        }

        select.form-control {
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 0.75rem center;
            padding-right: 2.5rem;
        }

        /* Buttons */
        .btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 0.5rem;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
            color: white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        }

        .btn-secondary {
            background: var(--surface);
            color: var(--primary);
            border: 2px solid var(--primary);
        }

        .btn-secondary:hover {
            background: var(--primary);
            color: white;
        }

        .btn-danger {
            background: var(--error);
            color: white;
        }

        .btn-danger:hover {
            background: #B71C1C;
        }

        .btn-block {
            width: 100%;
        }

        .btn-icon {
            padding: 0.5rem;
            border-radius: 50%;
            min-width: auto;
        }

        /* Scanner */
        .scanner-container {
            background: var(--surface);
            border-radius: 1rem;
            padding: 1rem;
            margin-bottom: 1.5rem;
            border: 2px dashed var(--primary);
            text-align: center;
        }

        .scanner-container .material-icons {
            font-size: 3rem;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }

        /* Image Upload */
        .image-upload-container {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .image-upload-box {
            aspect-ratio: 1;
            border: 2px dashed var(--divider);
            border-radius: 0.5rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            background: var(--background);
            position: relative;
            overflow: hidden;
        }

        .image-upload-box:hover {
            border-color: var(--primary);
            background: rgba(46, 125, 50, 0.05);
        }

        .image-upload-box img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            position: absolute;
            top: 0;
            left: 0;
        }

        .image-upload-box .upload-icon {
            color: var(--text-secondary);
            z-index: 1;
        }

        .image-upload-box .remove-image {
            position: absolute;
            top: 0.25rem;
            right: 0.25rem;
            background: var(--error);
            color: white;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2;
            cursor: pointer;
        }

        /* Records List */
        .record-card {
            background: var(--surface);
            border-radius: 0.5rem;
            padding: 1rem;
            margin-bottom: 0.75rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
        }

        .record-card:hover {
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
            transform: translateX(5px);
        }

        .record-header {
            display: flex;
            justify-content: space-between;
            align-items: start;
            margin-bottom: 0.5rem;
        }

        .record-id {
            font-weight: 600;
            color: var(--primary);
            font-size: 0.875rem;
        }

        .record-location {
            background: var(--primary-light);
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 1rem;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .record-description {
            color: var(--text-secondary);
            font-size: 0.875rem;
            line-height: 1.4;
            margin-bottom: 0.75rem;
        }

        .record-actions {
            display: flex;
            gap: 0.5rem;
        }

        /* Detail View */
        .detail-header {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            padding: 1rem;
            margin: -1rem -1rem 1rem -1rem;
            border-radius: 0.5rem 0.5rem 0 0;
        }

        .detail-images {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .detail-images img {
            width: 100%;
            border-radius: 0.5rem;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .detail-images img:hover {
            transform: scale(1.05);
        }

        .detail-info {
            background: var(--background);
            padding: 1rem;
            border-radius: 0.5rem;
            margin-bottom: 1rem;
        }

        .detail-info-row {
            display: flex;
            justify-content: space-between;
            padding: 0.5rem 0;
            border-bottom: 1px solid var(--divider);
        }

        .detail-info-row:last-child {
            border-bottom: none;
        }

        .detail-info-label {
            font-weight: 500;
            color: var(--text-secondary);
            font-size: 0.875rem;
        }

        .detail-info-value {
            color: var(--text-primary);
            text-align: right;
            font-size: 0.875rem;
        }

        /* Settings */
        .settings-section {
            background: var(--surface);
            border-radius: 0.5rem;
            padding: 1rem;
            margin-bottom: 1rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .settings-section h3 {
            color: var(--primary);
            margin-bottom: 1rem;
            font-size: 1.125rem;
        }

        .location-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem;
            background: var(--background);
            border-radius: 0.25rem;
            margin-bottom: 0.5rem;
        }

        .location-item .location-name {
            flex: 1;
            font-weight: 500;
        }

        .location-item .location-actions {
            display: flex;
            gap: 0.5rem;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: var(--surface);
            border-radius: 1rem;
            padding: 1.5rem;
            max-width: 500px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            animation: slideUp 0.3s ease;
        }

        @keyframes slideUp {
            from { transform: translateY(50px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .modal-header {
            margin-bottom: 1rem;
        }

        .modal-header h2 {
            color: var(--primary);
            font-size: 1.25rem;
        }

        .modal-body {
            margin-bottom: 1rem;
        }

        .modal-footer {
            display: flex;
            gap: 0.5rem;
            justify-content: flex-end;
        }

        /* Auth Screen */
        .auth-container {
            display: flex;
            flex-direction: column;
            justify-content: center;
            min-height: 100vh;
            padding: 2rem;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        }

        .auth-card {
            background: var(--surface);
            border-radius: 1rem;
            padding: 2rem;
            max-width: 400px;
            margin: 0 auto;
            width: 100%;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }

        .auth-logo {
            text-align: center;
            margin-bottom: 2rem;
        }

        .auth-logo .material-icons {
            font-size: 4rem;
            color: var(--primary);
        }

        .auth-logo h2 {
            color: var(--primary);
            margin-top: 0.5rem;
        }

/* JPB Logout */
.float-right-element {
  float: right;
}







        /* Loading Spinner */
        .spinner {
            border: 3px solid var(--divider);
            border-top: 3px solid var(--primary);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 2rem auto;
        }

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

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
        }

        .empty-state .material-icons {
            font-size: 4rem;
            color: var(--divider);
            margin-bottom: 1rem;
        }

        .empty-state h3 {
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
        }

        .empty-state p {
            color: var(--text-secondary);
            font-size: 0.875rem;
        }

        /* Responsive */
        @media (max-width: 640px) {
            .header h1 {
                font-size: 1.25rem;
            }
            
            .nav-tab {
                font-size: 0.75rem;
                padding: 0.75rem 0.5rem;
            }
            
            .home-grid {
                grid-template-columns: 1fr;
            }
        }

        /* iOS Specific Styles */
        @supports (-webkit-touch-callout: none) {
            .form-control {
                font-size: 16px; /* Prevents zoom on focus */
            }
            
            body {
                padding-bottom: env(safe-area-inset-bottom);
            }
        }

        /* Success Message */
        .success-message {
            background: var(--success);
            color: white;
            padding: 1rem;
            border-radius: 0.5rem;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            animation: slideDown 0.3s ease;
        }

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

        .hidden {
            display: none !important;
        }
