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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    min-height: 0;
    flex-shrink: 0;
}

.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: block;
}

.password-box {
    background: white;
    border-radius: 20px;
    padding: 40px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.password-box h1 {
    color: #333;
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.password-box p {
    color: #666;
    margin: 0 0 28px 0;
    font-size: 15px;
    font-weight: 400;
}

.password-box input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    margin: 0 0 20px 0;
    transition: all 0.3s;
    font-family: inherit;
    background: #fafafa;
    box-sizing: border-box;
}

.password-box input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.password-box .btn-primary {
    width: 100%;
    padding: 14px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    box-sizing: border-box;
}

.dashboard-container {
    background: white;
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.dashboard-container h1 {
    color: #333;
    margin: 0 0 32px 0;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
}

.dashboard-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #f0f0f0;
}

.dashboard-section:last-of-type {
    border-bottom: none;
    margin-bottom: 24px;
}

.dashboard-section h2 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.todate-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.invoice-form {
    background: white;
    border-radius: 16px;
    padding: 30px 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.invoice-form h1 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
    text-align: center;
}

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

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

select.form-control {
    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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.total-display {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    border: 2px solid #e0e0e0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 16px;
    color: #333;
}

.total-row:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
}

.total-amount {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-top: 5px;
    padding-top: 15px;
    border-top: 2px solid #667eea !important;
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    margin-top: 10px;
}

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

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

.btn-primary:active {
    transform: translateY(0);
}

/* Log Work button - Blue to Cyan gradient */
#logBtn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

#logBtn:hover {
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.4);
}

/* View Invoice button - Purple to Pink gradient */
#viewInvoiceBtn {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
}

#viewInvoiceBtn:hover {
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

/* Send to FIRCO button - Orange to Red gradient */
#sendToFircoBtn {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

#sendToFircoBtn:hover {
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

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

/* Logout buttons - Red */
#logoutBtn, #dashboardLogoutBtn {
    background: #dc3545;
    color: white;
}

#logoutBtn:hover, #dashboardLogoutBtn:hover {
    background: #c82333;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
}

.btn-large {
    padding: 18px;
    font-size: 18px;
    margin-top: 20px;
}

.error-msg {
    color: #e74c3c;
    font-size: 14px;
    margin: 16px 0 0 0;
    min-height: 20px;
    font-weight: 500;
}

/* Dashboard mobile optimizations */
@media (max-width: 480px) {
    .dashboard-container {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .dashboard-container h1 {
        font-size: 26px;
        margin-bottom: 24px;
    }
    
    .dashboard-section {
        margin-bottom: 24px;
        padding-bottom: 20px;
    }
    
    .dashboard-section h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }
}

/* Mobile optimizations for login */
@media (max-width: 480px) {
    body {
        padding: 16px 12px;
        align-items: flex-start;
        padding-top: 24px;
        padding-bottom: 24px;
    }
    
    .container {
        max-width: 100%;
        margin: 0;
    }
    
    .password-box {
        padding: 32px 20px;
        border-radius: 16px;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .password-box h1 {
        font-size: 26px;
        margin: 0 0 10px 0;
    }
    
    .password-box p {
        font-size: 14px;
        margin: 0 0 24px 0;
    }
    
    .password-box input[type="password"] {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        margin: 0 0 18px 0;
    }
    
    .password-box .btn-primary {
        padding: 14px;
        font-size: 16px;
        margin: 0;
    }
    
    .error-msg {
        margin: 14px 0 0 0;
    }
}

/* Tablet optimizations */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 20px;
    }
    
    .password-box {
        padding: 40px 32px;
    }
    
    .password-box h1 {
        font-size: 30px;
        margin: 0 0 10px 0;
    }
    
    .password-box p {
        margin: 0 0 28px 0;
    }
}

.work-entries-section {
    margin: 25px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.btn-add {
    width: auto;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    margin: 0;
    font-size: 14px;
}

.btn-add:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.work-entry {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.work-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.work-entry-title {
    font-weight: 600;
    color: #667eea;
    font-size: 16px;
}

.btn-remove {
    width: auto;
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    margin: 0;
    font-size: 12px;
    border-radius: 6px;
}

.btn-remove:hover {
    background: #c82333;
}

.work-entry .form-group {
    margin-bottom: 15px;
}

textarea.form-control {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.properties-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.properties-header {
    margin-bottom: 15px;
}

.properties-header h3 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.properties-container {
    margin-bottom: 15px;
}

.property-item {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.property-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.property-number {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.btn-remove-property {
    width: auto;
    padding: 4px 10px;
    background: #dc3545;
    color: white;
    margin: 0;
    font-size: 18px;
    border-radius: 6px;
    line-height: 1;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-property:hover {
    background: #c82333;
    transform: scale(1.05);
}

.property-fields {
    display: grid;
    gap: 15px;
}

.btn-add-property {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    margin: 0;
    font-size: 14px;
    border-radius: 8px;
}

.btn-add-property:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.required {
    color: #dc3545;
    font-weight: bold;
}

.property-hours-group {
    animation: slideDown 0.3s ease-out;
}

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

/* Tablet and Desktop */
@media (min-width: 768px) {
    body {
        padding: 24px;
    }
    
    .container {
        max-width: 500px;
    }

    .password-box {
        padding: 48px 40px;
        border-radius: 24px;
    }
    
    .password-box h1 {
        font-size: 34px;
        margin: 0 0 12px 0;
    }
    
    .password-box p {
        font-size: 16px;
        margin: 0 0 32px 0;
    }

    .invoice-form {
        padding: 40px 35px;
    }

    .invoice-form h1 {
        font-size: 28px;
    }
}

/* Large Desktop */
@media (min-width: 1024px) {
    .container {
        max-width: 700px;
    }
}

