:root {
    --primary-color: #EC5931;
    --primary-hover: #d94a2b;
    --error-color: #ff4444;
    
    --light-background: #f4f4f4;
    --light-surface: #ffffff;
    --light-text-primary: #333333;
    --light-text-secondary: #666666;
    --light-border: #dddddd;
    --light-disabled: #cccccc;
    --light-modal-bg: #f8f8f8;
    --light-list-bg: #eeeeee;
    
    --dark-background: #121212;
    --dark-surface: #1e1e1e;
    --dark-text-primary: #ffffff;
    --dark-text-secondary: #b0b0b0;
    --dark-border: #333333;
    --dark-disabled: #555555;
    --dark-modal-bg: #2a2a2a;
    --dark-list-bg: #252525;
    
    --background: var(--dark-background);
    --surface: var(--dark-surface);
    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --border: var(--dark-border);
    --disabled: var(--dark-disabled);
    --modal-bg: var(--dark-modal-bg);
    --list-bg: var(--dark-list-bg);
}
body.light-theme {
    --background: var(--light-background);
    --surface: var(--light-surface);
    --text-primary: var(--light-text-primary);
    --text-secondary: var(--light-text-secondary);
    --border: var(--light-border);
    --disabled: var(--light-disabled);
    --modal-bg: var(--light-modal-bg);
    --list-bg: var(--light-list-bg);
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--background);
    color: var(--text-primary);
    position: relative;
    transition: background-color 0.3s, color 0.3s;
}
.theme-toggle {
    top: 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-primary);
    z-index: 1000;
    margin-bottom: 20px;
}
.container {
    text-align: center;
    max-width: 300px;
    width: 100%;
    margin-bottom: 20px;
}
.logo {
    width: 200px;
    height: auto;
    margin-bottom: 20px;
    filter: brightness(0.9);
}
input[type="number"] {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    background-color: var(--surface);
    color: var(--text-primary);
}
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}
input[type="text"] {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    background-color: var(--surface);
    color: var(--text-primary);
}
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}
input[type="password"] {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    background-color: var(--surface);
    color: var(--text-primary);
}
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
}
.slider-container {
    width: 100%;
    position: relative;
}
input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--surface);
    border-radius: 5px;
    outline: none;
    margin: 12px 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
}
.thumb-value {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
}
.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-bottom: 10px;
    visibility: hidden;
}
.error-message.visible {
    visibility: visible;
}
button {
    width: 100%; 
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}
button:hover {
    background-color: var(--primary-hover);
}
button:disabled {
    background-color: var(--disabled);
    cursor: not-allowed;
}
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding-bottom: 60px;
}
footer {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    background-color: var(--surface);
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    left: 0;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background-color: var(--modal-bg);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 300px;
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.modal-content h2 {
    margin-top: 0;
    color: var(--text-primary);
}
.modal-content select {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    background-color: var(--surface);
    color: var(--text-primary);
}
.modal-content button {
    width: 48%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin: 0 1%;
}
.modal-content button.confirm {
    background-color: var(--primary-color);
    color: white;
}
.modal-content button.cancel {
    background-color: var(--disabled);
    color: var(--text-primary);
}
.modal-content .button-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
}
.loading-spinner {
    border: 5px solid var(--surface);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
.loading-text {
    color: var(--text-primary);
    font-size: 18px;
    margin-top: 10px;
}
.list {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 10px;
    background-color: var(--list-bg);
    border-radius: 5px;
    padding: 10px;
    border: 1px solid var(--border);
}
.list-title {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--text-primary);
}
.list-item {
    padding: 8px;
    margin-bottom: 8px;
    background-color: var(--surface);
    border-radius: 4px;
    font-size: 14px;
    border-left: 3px solid var(--primary-color);
}
.list-item {
    padding: 8px;
    margin-bottom: 8px;
    background-color: var(--surface);
    border-radius: 4px;
    font-size: 14px;
    border-left: 3px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
}
.list-item:active {
    transform: scale(0.98);
    background-color: var(--primary-hover);
}
.list-item:hover {
    background-color: var(--modal-bg);
}
@keyframes clickAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}
.list-item.clicked {
    animation: clickAnimation 0.3s ease;
}
.list-item:last-child {
    margin-bottom: 0;
}
.list-time {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 3px;
}
.list-number {
    font-weight: bold;
}
.list-value {
    color: var(--primary-color);
}
.clear-list {
    margin-top: 10px;
    background-color: var(--list-bg);
    color: var(--text-secondary);
    font-size: 12px;
    border: none;
    cursor: pointer;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.menu-button {
    width: 100%;
    padding: 10px;
    background-color: #2b7df7;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.menu-button:hover {
    background-color: #1a5dc8;
}

.menu-button:active {
    transform: scale(0.98);
}

.menu-button img {
    width: 24px;
    height: 24px;
}
.total-sum {
    margin-top: 20px;
    padding: 10px;
    background-color: var(--surface);
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
    border-top: 2px solid var(--primary-color);
    font-weight: bold;
}

.total-sum-value {
    color: var(--primary-color);
    font-size: 18px;
}
.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 4px;
}
.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    background-color: var(--surface);
    position: relative;
    transition: all 0.2s ease;
}
.checkbox-container input[type="checkbox"]:checked {
    background-color: var(--primary-color);
}
.checkbox-container input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
}
.checkbox-container input[type="checkbox"]:hover {
    border-color: var(--primary-hover);
}
.checkbox-container input[type="checkbox"]:checked:hover {
    background-color: var(--primary-hover);
}
.checkbox-container label {
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
}
.qr-scanner-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.qr-scanner-container {
    width: 90%;
    max-width: 500px;
    height: 85%;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}
#qr-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.qr-scanner-close {
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
}
.qr-scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.qr-scanner-frame {
    width: 70%;
    height: 50%;
    border-radius: 10px;
    box-shadow: 0 0 0 10000px rgba(0, 0, 0, 0.7);
}
.qr-scanner-status {
    color: white;
    margin-top: 15px;
    font-size: 16px;
    text-align: center;
}

select[multiple] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    background-color: var(--surface);
    color: var(--text-primary);
    min-height: 10px;
    resize: none;
}

select[multiple]:focus {
    outline: none;
    border-color: var(--primary-color);
}

select[multiple] option {
    padding: 8px 12px;
    margin: 2px 0;
    background-color: var(--surface);
    color: var(--text-primary);
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

select[multiple] option:hover {
    background-color: var(--modal-bg);
}

select[multiple] option:checked {
    background-color: var(--primary-color);
    color: white;
}

select[multiple]::-webkit-scrollbar {
    width: 8px;
}

select[multiple]::-webkit-scrollbar-track {
    background: var(--list-bg);
    border-radius: 4px;
}

select[multiple]::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

select[multiple]::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

select[multiple] {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--list-bg);
}

select[multiple] option:first-child {
    margin-top: 0;
}

select[multiple] option:last-child {
    margin-bottom: 0;
}

select[multiple]:disabled {
    background-color: var(--disabled);
    color: var(--text-secondary);
    cursor: not-allowed;
}

select[multiple]:disabled option {
    cursor: not-allowed;
}

textarea {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    background-color: var(--surface);
    color: var(--text-primary);
    min-height: 80px;
    resize: none;
    font-family: Arial, sans-serif;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea:hover {
    border-color: var(--primary-hover);
}

textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: var(--list-bg);
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

textarea {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--list-bg);
}

textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

textarea:disabled {
    background-color: var(--disabled);
    color: var(--text-secondary);
    cursor: not-allowed;
    border-color: var(--border);
}

textarea:disabled::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

textarea.small {
    min-height: 60px;
    font-size: 14px;
}

textarea.medium {
    min-height: 100px;
}

textarea.large {
    min-height: 150px;
}

textarea:focus {
    box-shadow: 0 0 0 2px rgba(236, 89, 49, 0.1);
}