:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #4da3ff;
    --background-color: #f4f6f9;
    --white: #ffffff;
    --text-color: #333333;
    --gray-light: #e9ecef;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-lg: 16px;
    --success-color: #28a745;
    --error-color: #dc3545;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

#app-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    padding-top: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    width: 100%;
    max-width: 480px;
    background: var(--white);
    padding: 20px;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    position: relative;
}

/* Branding */
.branding {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gray-light);
}

.branding .logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.branding h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 10px 0 0 0;
    font-weight: 700;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    animation: slideInDown 0.5s ease-out;
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
    animation: slideInUp 0.5s ease-out;
}

/* Error Message */
.error-message {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: shake 0.5s ease-in-out;
}

.error-message.hidden {
    display: none;
}

@media (min-width: 481px) {
    body {
        padding: 20px;
        align-items: center;
    }

    .container {
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        min-height: auto;
    }
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--text-color);
    text-align: center;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.required {
    color: var(--error-color);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ced4da;
    border-radius: var(--radius);
    font-size: 18px;
    transition: all 0.3s ease;
    background: var(--white);
}

.date-input-large {
    font-size: 22px !important;
    padding: 18px !important;
}

.phone-input {
    font-size: 24px !important;
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
    padding: 20px !important;
    border: 3px solid var(--primary-color) !important;
    border-radius: var(--radius-lg) !important;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    box-shadow: var(--shadow);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    transform: scale(1.02);
}

.phone-input:focus {
    border-color: var(--primary-dark) !important;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3) !important;
}

.btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

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

.btn-large {
    padding: 18px;
    font-size: 20px;
    border-radius: var(--radius-lg);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 2px solid var(--primary-light);
}

.customer-card {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
}

.customer-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.detail-label {
    font-weight: 600;
    color: var(--text-color);
}

.detail-value {
    color: var(--primary-dark);
    font-weight: 500;
}

.card p {
    margin: 5px 0;
}

.hidden {
    display: none !important;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

/* Toggle Button Groups */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.btn-toggle {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #ced4da;
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle:hover {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.05);
}

.btn-toggle.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

/* Employee Selection Buttons */
.employee-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.employee-buttons .btn-employee {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid #ced4da;
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.employee-buttons .btn-employee:hover {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.05);
}

.employee-buttons .btn-employee.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.employee-loading {
    color: #6c757d;
    font-style: italic;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ced4da;
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
    resize: vertical;
    min-height: 80px;
}

textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Product Selection */
.product-options {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-product-option {
    margin-top: 0 !important;
    text-align: left;
    padding: 14px 18px;
}

.loading-text, .error-text {
    padding: 20px;
    text-align: center;
    color: #666;
}

.error-text {
    color: var(--error-color);
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
