/**
 * Android-like Material Design Styles
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Prevent text selection on mobile (app-like) */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in input fields and content areas */
input, textarea, select, [contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    /* Prevent zoom on focus */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    --secondary-color: #dc004e;
    --background: #f5f5f5;
    --surface: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --divider: #e0e0e0;
    --error: #d32f2f;
    --success: #388e3c;
    --warning: #f57c00;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-elevated: 0 4px 8px rgba(0,0,0,0.15);
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
}

html {
    height: 100%;
    height: -webkit-fill-available;
    height: calc(var(--vh, 1vh) * 100);
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Prevent horizontal scrolling */
    overflow-x: hidden;
    /* Force full-screen on mobile */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    height: calc(var(--vh, 1vh) * 100);
    margin: 0;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* App-like smooth scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    /* Prevent text selection on mobile (app-like) */
    -webkit-user-select: none;
    user-select: none;
    /* Prevent pull-to-refresh */
    overscroll-behavior: none;
    /* Prevent horizontal scrolling */
    overflow-x: hidden;
    /* Force full-screen */
    touch-action: pan-y;
}

/* PWA Standalone mode adjustments - Full App Experience */
@media all and (display-mode: standalone),
       all and (display-mode: fullscreen) {
    html, body {
        height: 100vh;
        height: -webkit-fill-available;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
        position: fixed;
        margin: 0;
        padding: 0;
    }
    
    body {
        padding-top: 0;
        padding-bottom: 0;
        background: var(--background);
        /* Full screen app - no browser UI */
        -webkit-user-select: none;
        user-select: none;
    }
    
    #app {
        height: 100vh;
        height: -webkit-fill-available;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
        position: fixed;
    }
    
    .app-bar {
        padding-top: env(safe-area-inset-top);
        height: calc(56px + env(safe-area-inset-top));
        background: var(--primary-color);
        z-index: 1000;
    }
    
    .main-content {
        top: calc(56px + env(safe-area-inset-top));
        bottom: calc(60px + env(safe-area-inset-bottom));
        height: auto;
        width: 100vw;
        max-width: 100vw;
        z-index: 1;
        margin-top: 0;
    }
    
    .bottom-nav-mobile {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(60px + env(safe-area-inset-bottom));
    }
    
    /* Hide browser UI elements in standalone */
    .screen {
        height: 100vh;
        height: -webkit-fill-available;
        width: 100vw;
        max-width: 100vw;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--divider);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Screen Management */
.screen {
    display: none;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.screen.active {
    display: block;
}

/* Login Screen - Full Screen Android-like */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    height: calc(var(--vh, 1vh) * 100);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 10000;
    margin: 0;
    overflow: hidden;
}

.login-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}


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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    transition: border-color 0.3s;
    touch-action: manipulation;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.error-message {
    color: var(--error);
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.error-message.show {
    display: block;
}

/* App Bar - Android Material Design - Full Screen */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 56px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    /* Safe area for notched devices */
    padding-top: env(safe-area-inset-top);
    height: calc(56px + env(safe-area-inset-top));
    /* App-like backdrop blur on scroll (iOS) */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Ensure full width */
    margin: 0;
    border: none;
    /* Ensure header stays on top and doesn't overlap content */
    box-sizing: border-box;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    display: none; /* Hidden by default, shown on mobile */
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.menu-toggle:active {
    background: rgba(255,255,255,0.1);
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: white;
    transition: all 0.3s;
    border-radius: 2px;
}

.app-title {
    flex: 1;
    font-size: 20px;
    font-weight: 500;
    margin-left: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

@media (min-width: 768px) {
    .app-title {
        margin-left: 16px;
        text-align: left;
    }
}

.app-bar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.app-title {
    flex: 1;
    font-size: 20px;
    font-weight: 500;
    margin-left: 0;
    text-align: center;
}

@media (min-width: 768px) {
    .app-title {
        margin-left: 16px;
        text-align: left;
    }
}

.app-bar-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
}

/* Navigation Drawer - App-like */
.nav-drawer {
    position: fixed;
    top: 56px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 56px);
    background: var(--surface);
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Safe area */
    padding-top: env(safe-area-inset-top);
    height: calc(100vh - 56px + env(safe-area-inset-top));
}

.nav-drawer.open {
    left: 0;
}

.nav-header {
    padding: 16px;
    background: var(--primary-color);
    color: white;
}

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

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 16px;
}

.user-role {
    font-size: 14px;
    opacity: 0.9;
}

.nav-menu {
    list-style: none;
    padding: 8px 0;
}

.nav-item {
    width: 100%;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 16px;
    transition: background 0.3s;
    text-decoration: none;
}

.nav-item .material-icons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.nav-item:hover {
    background: var(--divider);
}

.nav-item.active {
    background: rgba(25, 118, 210, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

.nav-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--divider);
}

.drawer-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 998;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Main Content - Full Screen App-like */
.main-content {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom));
    width: 100vw;
    max-width: 100vw;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--background);
    /* Smooth scrolling */
    scroll-behavior: smooth;
    /* Prevent overscroll bounce */
    overscroll-behavior-y: contain;
    /* Ensure no horizontal scroll */
    box-sizing: border-box;
    /* Ensure content is below header */
    z-index: 1;
    /* Prevent any overlap with header */
    margin-top: 0;
    padding-top: 16px;
}

/* Bottom Navigation - Android App-like (Flipkart style) - Full Screen */
.bottom-nav-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    background: var(--surface);
    border-top: 1px solid var(--divider);
    display: none; /* Hidden by default, shown on mobile */
    justify-content: space-around;
    align-items: flex-start;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
    /* Safe area for devices with home indicator */
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(60px + env(safe-area-inset-bottom));
    padding-top: 4px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Ensure full width */
    margin: 0;
    border-left: none;
    border-right: none;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 8px 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    text-decoration: none;
    transition: all 0.2s;
    min-height: 56px;
    position: relative;
    text-align: center;
}

.bottom-nav-item .material-icons {
    font-size: 24px;
    margin-bottom: 2px;
    transition: all 0.2s;
    display: block;
}

.bottom-nav-item span:not(.material-icons) {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    display: block;
    margin-top: 2px;
}

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

.bottom-nav-item.active .material-icons {
    font-size: 26px;
    transform: scale(1.1);
}

.bottom-nav-item:active {
    background-color: rgba(0,0,0,0.05);
    border-radius: 8px;
}

/* Old bottom-nav (keep for compatibility) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--surface);
    border-top: 1px solid var(--divider);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(64px + env(safe-area-inset-bottom));
}

/* Buttons - Android Material Design */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn:active {
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transform: translateY(1px);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

.btn-success:hover {
    background: #2e7d32;
}

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cards - Android Material Design */
.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
    border: none;
}

.card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .card:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--divider);
}

.card-title {
    font-size: 18px;
    font-weight: 500;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

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

.form-group select {
    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 12px center;
    background-size: 12px;
    padding-right: 36px;
}

/* Lists */
.list {
    list-style: none;
}

.list-item {
    background: var(--surface);
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: box-shadow 0.3s;
}

.list-item:hover {
    box-shadow: var(--shadow-elevated);
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.list-item-title {
    font-weight: 500;
    font-size: 16px;
}

.list-item-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

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

.badge-info {
    background: var(--primary-color);
    color: white;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--text-primary);
    color: white;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: var(--shadow-elevated);
    min-width: 300px;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design - Desktop */
@media (min-width: 768px) {
    html, body {
        position: relative;
        overflow: auto;
        height: auto;
        min-height: 100%;
    }
    
    .nav-drawer {
        left: 0;
        box-shadow: none;
    }
    
    .main-content {
        position: relative;
        margin-left: 280px;
        margin-top: calc(56px + env(safe-area-inset-top));
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        padding-bottom: 16px;
        min-height: calc(100vh - 56px);
    }
    
    .drawer-overlay {
        display: none;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .bottom-nav,
    .bottom-nav-mobile {
        display: none;
    }
}

/* Mobile-first Android-like Design - App Experience (Flipkart style) */
/* Force mobile-first vertical layout - ALWAYS full-screen on mobile */
@media (max-width: 767px), (orientation: portrait) {
    /* Full screen on mobile - Vertical Layout - FORCE FULL SCREEN */
    html, body {
        height: 100vh !important;
        height: -webkit-fill-available !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow: hidden !important;
        position: fixed !important;
        margin: 0 !important;
        padding: 0 !important;
        /* Prevent horizontal scrolling */
        overflow-x: hidden !important;
        /* Force portrait orientation */
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
        /* Prevent any browser UI */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none;
    }
    
    #app {
        width: 100vw !important;
        height: 100vh !important;
        height: -webkit-fill-available !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        max-width: 100vw !important;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #main-app {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: -webkit-fill-available !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    .screen {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: -webkit-fill-available !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    /* Hide desktop navigation drawer on mobile */
    .nav-drawer {
        display: none !important;
    }
    
    .drawer-overlay {
        display: none !important;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    /* Show bottom navigation on mobile - Always visible like Flipkart */
    .bottom-nav-mobile {
        display: flex !important;
    }
    
    .login-container {
        padding: 40px 24px;
        border-radius: 16px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }
    
    #login-screen {
        padding: 20px;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
    
    .login-form {
        gap: 20px;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .main-content {
        padding: 12px;
        top: calc(56px + env(safe-area-inset-top));
        bottom: calc(60px + env(safe-area-inset-bottom));
        width: 100vw;
        max-width: 100vw;
        left: 0;
        right: 0;
        /* Ensure vertical scrolling only */
        overflow-x: hidden;
        overflow-y: auto;
        /* Ensure content is below header */
        z-index: 1;
        margin-top: 0;
        padding-top: 12px;
    }
    
    /* Larger touch targets for mobile (Android guidelines) */
    .btn {
        min-height: 48px;
        font-size: 16px;
        border-radius: 24px;
        padding: 12px 32px;
    }
    
    .nav-item {
        min-height: 48px;
        padding: 12px 16px;
    }
    
    .list-item {
        min-height: 72px;
        padding: 16px;
        border-radius: 0;
    }
    
    /* Android-like ripple effect */
    .btn:active,
    .nav-item:active,
    .list-item:active {
        background-color: rgba(0,0,0,0.1);
        transition: background-color 0.1s;
    }
    
    /* Better spacing for mobile */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* Mobile inputs - 16px prevents zoom */
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 48px;
        font-size: 16px; /* 16px prevents zoom on iOS/Android */
        -webkit-text-size-adjust: 100%;
        padding: 14px 16px;
        touch-action: manipulation;
    }
    
    /* Login form inputs */
    #login-form .form-group input {
        font-size: 16px;
        min-height: 52px;
        padding: 16px;
        border-radius: 8px;
        border: 1px solid var(--divider);
        touch-action: manipulation;
    }
    
    #login-form .form-group input:focus {
        border-color: var(--primary-color);
        border-width: 2px;
        outline: none;
    }
    
    /* FAB positioning on mobile */
    .fab {
        bottom: calc(76px + env(safe-area-inset-bottom));
        right: 16px;
    }
    
    /* App-like page transitions */
    .main-content {
        animation: fadeIn 0.3s ease-in;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Hide app bar actions on very small screens */
    .app-bar-actions {
        gap: 4px;
    }
    
    .app-title {
        font-size: 18px;
        margin-left: 0;
        text-align: center;
    }
    
    .app-bar {
        padding: 0 8px;
    }
    
    /* Better list styling for mobile */
    .list {
        margin: 0 -12px;
    }
    
    .card .list {
        margin: 0 -16px -16px -16px;
    }
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: var(--background);
    border-radius: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 500;
    color: var(--primary-color);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.report-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--background);
    border-radius: 4px;
}

.today-log, .start-work {
    padding: 16px;
}

.log-status {
    margin-bottom: 16px;
}

.log-details p {
    margin-bottom: 8px;
}

.card-footer {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Form Styles */
hr {
    margin: 24px 0;
    border: none;
    border-top: 1px solid var(--divider);
}

h4 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-16 {
    margin-top: 16px;
}

.mb-16 {
    margin-bottom: 16px;
}

.flex {
    display: flex;
}

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

.gap-8 {
    gap: 8px;
}

.gap-16 {
    gap: 16px;
}

.hidden {
    display: none;
}

/* Floating Action Button (FAB) - Android style */
.fab {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: all 0.3s;
    text-decoration: none;
}

.fab:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    transform: scale(1.1);
}

.fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.fab .material-icons {
    font-size: 24px;
    color: white;
}

/* Android-like List Items */
.list {
    background: var(--surface);
    border-radius: 0;
    overflow: hidden;
}

.list-item {
    background: var(--surface);
    padding: 16px;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--divider);
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.list-item:active {
    background-color: rgba(0,0,0,0.05);
}

.list-item:last-child {
    border-bottom: none;
}

/* Remove card styling from list container when it has list items */
.card .list {
    margin: 0 -16px -16px -16px;
    border-radius: 0;
}

/* Android-like Input Fields */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 2px solid var(--divider);
    border-radius: 0;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
    border-bottom-width: 2px;
}

.form-group label {
    position: absolute;
    left: 0;
    top: 12px;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
    pointer-events: none;
    transition: all 0.3s;
    transform-origin: left top;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:not([value=""]) + label {
    transform: translateY(-20px) scale(0.75);
    color: var(--primary-color);
}

/* For inputs with placeholder=" " */
.form-group input::placeholder {
    opacity: 0;
    transition: opacity 0.3s;
}

.form-group input:focus::placeholder {
    opacity: 0;
}

/* PWA Standalone mode - additional styles */
.pwa-standalone body,
body.pwa-standalone {
    /* Full-screen app experience */
    height: 100vh;
    height: -webkit-fill-available;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
    position: fixed;
}

.pwa-standalone #app,
#app.pwa-standalone {
    height: 100vh;
    height: -webkit-fill-available;
    width: 100vw;
    max-width: 100vw;
}

/* iOS Safari specific fixes for full-screen */
@supports (-webkit-touch-callout: none) {
    html, body {
        height: -webkit-fill-available;
    }
    
    #login-screen {
        min-height: -webkit-fill-available;
    }
}

/* Mobile: Prevent horizontal overflow */
@media (max-width: 767px) {
    * {
        box-sizing: border-box;
    }
    
    img, video, iframe {
        max-width: 100%;
        height: auto;
    }
    
    /* Ensure all containers respect viewport */
    .card, .list, .form-group, .btn, .nav-item {
        max-width: 100%;
    }
}

