* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    padding: 16px;
}

.header {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-content > span {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    color: #666;
}

.btn-logout {
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn-clear-remember {
    padding: 6px 12px;
    border: 1px solid #faad14;
    border-radius: 6px;
    background: white;
    color: #faad14;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-remember:hover {
    background: #fff7e6;
    border-color: #d48806;
    color: #d48806;
}

.date-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.date-picker-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.date-input-wrapper {
    flex: 1;
}

.date-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    text-align: center;
    background: white;
    color: #333;
    transition: all 0.3s ease;
}

.date-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.date-separator {
    font-size: 20px;
    color: #666;
    font-weight: 500;
}

.quick-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;
}

.btn {
    padding: 8px 16px;
    border: 2px solid #1890ff;
    border-radius: 20px;
    background: white;
    color: #1890ff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn:hover {
    background: #1890ff;
    color: white;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
}

.data-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

.total-amount {
    color: #1890ff;
    font-size: 22px;
    font-weight: 700;
    margin-left: 8px;
}

.weight-list {
    margin-top: 8px;
}

.weight-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.weight-label {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.weight-value {
    font-size: 15px;
    font-weight: 600;
    color: #1890ff;
}

.section-divider {
    height: 1px;
    background: #eee;
    margin: 20px 0;
}

.customer-sales-container {
    margin-top: 8px;
}

.customer-group {
    margin-bottom: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.customer-header:hover {
    background: #f0f0f0;
}

.customer-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.customer-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-total-weight {
    font-size: 16px;
    font-weight: 600;
    color: #1890ff;
}

.expand-icon {
    font-size: 12px;
    color: #999;
    transition: transform 0.2s ease;
}

.customer-header:hover .expand-icon {
    color: #1890ff;
}

.customer-details {
    padding: 8px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid #f5f5f5;
    gap: 8px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-date {
    font-size: 12px;
    color: #999;
    min-width: 65px;
    text-align: left;
    flex-shrink: 0;
}

.detail-product {
    flex: 1;
    font-size: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-weight {
    font-size: 12px;
    color: #666;
    min-width: 75px;
    text-align: right;
    flex-shrink: 0;
    margin-left: auto;
}

.detail-price {
    font-size: 12px;
    color: #1890ff;
    font-weight: 500;
    min-width: 65px;
    text-align: right;
    flex-shrink: 0;
}

.expand-hint {
    background: #f5f8ff;
    cursor: pointer;
}

.expand-hint:hover {
    background: #e6f0ff;
}

.hint-text {
    font-size: 13px;
    color: #1890ff;
    text-align: center;
    width: 100%;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    padding: 16px;
    color: #ff4d4f;
    text-align: center;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: #333;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-control {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    margin-bottom: 0;
}

.error-message {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    padding: 12px;
    color: #ff4d4f;
    font-size: 14px;
    text-align: center;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 480px) {
    .app-container {
        padding: 12px;
    }
    
    .date-section, .data-section {
        padding: 14px;
    }
    
    .quick-buttons {
        flex-wrap: wrap;
    }
}
