* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: sans-serif;
    background-color: #f4f6f8;
    color: #222;
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

/* ШАПКА */
.app-header {
    background-color: #2563eb;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.app-header h1 {
    font-size: 20px;
    border: none; 
    color: white;
}

.header-buttons button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.drinks-grid {
    flex: 1; 
    padding: 15px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px; 
    
    align-content: start; 
}

.drink-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100px;
}

.drink-card:active {
    transform: scale(0.95); 
    background-color: #f0f9ff;
}

.drink-card .name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.drink-card .count {
    font-size: 28px;
    color: #2563eb;
    font-weight: bold;
}

.app-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.danger-btn {
    width: 100%;
    padding: 15px;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); 
    justify-content: center;
    align-items: center;
    z-index: 100; 
}

.modal-overlay.active {
    display: flex; 
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh; 
    overflow-y: auto; 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    text-align: center;
    color: #2563eb;
    margin-bottom: 15px;
    border: none;
}

/* Форма ввода */
.add-drink-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-drink-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}

.add-drink-form button {
    padding: 10px 15px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.settings-list {
    list-style: none; 
    padding: 0;
    margin: 0 0 20px 0;
}

.settings-list li {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 10px;
    background: #f4f6f8;
    margin-bottom: 8px;
    border-radius: 6px;
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
}

.close-modal-btn {
    width: 100%;
    padding: 12px;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.drink-info {
    flex: 1; 
    margin-left: 10px;
}

.total-bar {
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

.total-label {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
}

.total-value {
    font-size: 28px;
    font-weight: bold;
    color: #2563eb;
}

.drink-info {
    flex: 1; 
    margin-left: 10px;
}

.total-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.order-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 5px;
}

.move-btn {
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.move-btn:hover {
    background: #cbd5e1;
}

.history-list {
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 20px;
}

/* Одна смена (один день) */
.shift-item {
    background: #f4f6f8;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.shift-item h3 {
    color: #2563eb;
    margin: 0 0 10px 0;
    font-size: 18px;
    border: none;
}

.shift-drinks {
    margin: 10px 0;
}

.shift-drink {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #e2e8f0;
}

.shift-drink:last-child {
    border-bottom: none;
}

.shift-total {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 2px solid #2563eb;
    font-weight: bold;
    color: #2563eb;
    font-size: 18px;
}

/* Режим вычитания */
#subtractModeBtn.active {
    background-color: #ef4444;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

body.subtract-mode .drink-card {
    border: 2px dashed #ef4444;
    background-color: #fef2f2;
}

/* Стили для экрана входа */
#loginScreen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f4f6f8;
}

#loginScreen div {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
}

#loginScreen h2 {
    text-align: center;
    color: #2563eb;
    margin-bottom: 20px;
}

#loginScreen label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#loginScreen input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 15px;
}

#loginScreen button {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

#logoutBtn {
    background: #ef4444 !important;
}

#usersBtn {
    background: #10b981 !important;
}