* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f0f2f5;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Шапка с авторизацией */
.header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.auth-section {
    display: flex;
    justify-content: flex-end;
}

.auth-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.phone-input {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-family: inherit;
}

.phone-input:focus {
    outline: none;
    border-color: #0066cc;
}

.btn-login, .btn-logout {
    background: #0066cc;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover, .btn-logout:hover {
    background: #0052a3;
}

.auth-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-info span {
    font-size: 14px;
    color: #495057;
}

/* Вкладки */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0 16px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 16px 12px;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
    background: white;
}

.tab-btn:hover:not(.active) {
    color: #495057;
    background: #f1f3f5;
}

/* Контент вкладок */
.tab-content {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Секции адресов */
.address-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    margin-top: 8px;
}

.divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #e9ecef;
}

/* Группа выбора адреса */
.address-selectors {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.address-single-selector {
    margin-bottom: 16px;
}

.address-single-selector label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.address-single-selector select {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: white;
    cursor: pointer;
}

.selector-group {
    flex: 1;
    min-width: 120px;
}

.selector-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select {
    width: 100%;
    padding: 12px 10px;
    font-size: 15px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-family: inherit;
}

select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

select:disabled {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
}

/* Кнопка добавления адреса */
.btn-add-address {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-bottom: 8px;
}

.btn-add-address:hover:not(:disabled) {
    background: #218838;
}

.btn-add-address:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

/* Кнопка удаления адреса */
.btn-delete-address {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-address:hover {
    background: #c82333;
}

/* Карточка текущего адреса */
.current-address {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 16px 20px;
    margin: 20px 0 28px 0;
    border-left: 4px solid #0066cc;
}

.current-address-label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.current-address-value {
    font-size: 18px;
    font-weight: 500;
    color: #212529;
    word-break: break-word;
}

/* Форма отправки */
.readings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 500;
    color: #495057;
    font-size: 15px;
}

.input-group label span {
    color: #6c757d;
    font-size: 12px;
    font-weight: normal;
    margin-left: 8px;
}

.input-group input {
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #dee2e6;
    border-radius: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.input-group input:disabled {
    background: #f8f9fa;
    color: #adb5bd;
}

.btn-submit {
    background: #0066cc;
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-submit:hover:not(:disabled) {
    background: #0052a3;
    transform: translateY(-1px);
}

.btn-submit:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

/* Сообщения */
.message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    display: none;
}

.message.success {
    background: #d1e7dd;
    color: #0a3622;
    border-left: 4px solid #198754;
}

.message.error {
    background: #f8d7da;
    color: #842029;
    border-left: 4px solid #dc3545;
}

/* История */
.year-filter {
    margin-bottom: 24px;
}

.year-filter label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.year-filter select {
    max-width: 150px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.history-table th,
.history-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.history-table td {
    color: #212529;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Адаптивность */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }
    .tab-content {
        padding: 20px 16px;
    }
    .address-selectors {
        flex-direction: column;
        gap: 12px;
    }
    .selector-group {
        min-width: auto;
    }
    .current-address-value {
        font-size: 16px;
    }
    .history-table {
        font-size: 12px;
    }
    .history-table th,
    .history-table td {
        padding: 10px 6px;
    }
    .auth-form {
        flex-direction: column;
        width: 100%;
    }
    .phone-input {
        width: 100%;
    }
    .btn-login, .btn-logout {
        width: 100%;
    }
    .auth-info {
        width: 100%;
        justify-content: space-between;
    }
    .address-single-selector[style*="flex"] {
        flex-direction: column;
    }
    .btn-delete-address {
        width: 100%;
    }
}
/* Сообщение об успешной отправке в истории */
.history-success-message {
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.success-banner {
    background: linear-gradient(135deg, #d1e7dd 0%, #c3e0d4 100%);
    border-left: 4px solid #198754;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.success-icon {
    font-size: 20px;
    margin-right: 8px;
}

.success-text {
    font-size: 15px;
    font-weight: 500;
    color: #0a3622;
    word-break: break-word;
}

.success-note {
    font-size: 13px;
    color: #2c6e3c;
    border-top: 1px solid rgba(25, 135, 84, 0.3);
    padding-top: 8px;
    margin-top: 4px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
