/* 
    public/editor/styles.css - Редактор участников
    Оформление: светлая тема, тёмно-синяя шапка, читаемый текст
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f4f7fc;
    padding: 2rem;
}

.editor-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 35px -10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* ========== ШАПКА ========== */
header {
    background: #1e2f41;
    color: white;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    font-weight: 500;
    font-size: 1.6rem;
    margin: 0;
}

/* Элементы управления в шапке */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Кнопка "На главную" */
.back-link {
    background: #f1f5f9;
    color: #1e2f41;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-base);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    display: inline-block;
    border: 1px solid #cbd5e1;
}

.back-link:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    color: #0f2a3a;
    border-color: #94a3b8;
}

/* Кнопка выхода */
#logoutBtn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

#logoutBtn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

/* ========== МЕНЮ ПОЛЬЗОВАТЕЛЯ (АВАТАР С ДРОПДАУНОМ) ========== */
.user-menu {
    position: relative;
}

.user-avatar {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    overflow: hidden;
}

.user-avatar:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: var(--border-radius-base);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.dropdown-user-name {
    display: block;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.dropdown-user-email {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: none;
}

.dropdown-overlay.active {
    display: block;
}

/* Новая тулбарная группа */
.tree-control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
}

.tree-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tree-selector-wrapper label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e2f41;
    min-width: 110px;
}

.tree-selector {
    background: white;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-base);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 220px;
}

.tree-selector option {
    background: white;
    color: #1e293b;
}

.tree-actions {
    display: flex;
    gap: 0.5rem;
}

.tree-actions .button-small {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #e2e8f0;
    color: #1e2f41;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
}

.tree-actions .button-small:hover {
    background: #d1d9e6;
    transform: translateY(-1px);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.icon-btn img {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.05);
    transform: scale(1.05);
}

.btn-icon-sm {
    width: 16px;
    height: 16px;
}

/* Панель действий с деревом (белый блок) */
.tree-actions-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    margin-top: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 0.8rem;
}

.tree-info {
    font-size: 0.85rem;
    color: #64748b;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-left: auto;
}

.btn-icon {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

#saveBtn img {
    filter: brightness(0) invert(1);
}

/* ========== ТУЛБАР ========== */
.toolbar {
    padding: 1rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* ========== ОБЩИЕ СТИЛИ ЭЛЕМЕНТОВ ========== */
select, button, input {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: white;
    font-family: inherit;
}

select option {
    padding: 10px 12px;
    line-height: 1.4;
    min-height: 38px;
}

/* ========== КНОПКИ ========== */
.button-std {
    background: #1e2f41;
    color: white;
    border: none;
    cursor: pointer;
    transition: 0.15s;
}

.button-std:hover:not(:disabled) {
    background: #0f1e2c;
    transform: translateY(-1px);
}

.button-std:disabled, select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Маленькие кнопки */
.small-btn {
    background: #e2e8f0;
    color: #1e2f41;
    border: 1px solid #cbd5e1;
    padding: 0.4rem .8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    cursor: pointer;
    width: max-content;
    display: inline-block;
    transition: 0.15s;
}

.small-btn:hover {
    background: #d1d9e6;
    transform: translateY(-1px);
    color: #1e2f41;
    border-color: #94a3b8;
}

/* Кнопка сохранения */
#saveBtn {
    background: #2c5f8a;
    padding: 0.7rem 2rem;
    font-size: 1rem;
}

#saveBtn:hover {
    background: #1e3f5a;
}

/* Кнопка экспорта */
#exportBtn {
    background: #4a6f8f;
    padding: 0.7rem 2rem;
    font-size: 1rem;
}

#exportBtn:hover {
    background: #3a5a7a;
}

/* Кнопка создания */
.create-btn {
    width: 100%;
    margin-top: 0.8rem;
    background: #2c5f8a;
    color: white;
    padding: 0.6rem;
    font-weight: 500;
}

.create-btn:hover {
    background: #1e3f5a;
}

/* Кнопка удаления */
.delete-btn {
    background: #2c5f8a;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.delete-btn:hover:not(:disabled) {
    background: #1e3f5a;
}

.delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Кнопка создания дерева */
#createTreeBtn {
    background: #2c5f8a;
    color: white;
    border: none;
    transition: all 0.2s;
}

#createTreeBtn:hover {
    background: #1e3f5a;
    transform: translateY(-1px);
}

/* ========== ОСНОВНАЯ ПАНЕЛЬ ========== */
.main-panel {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background: #f9fafb;
    min-height: 500px;
}

/* Список участников */
.members-list {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 1.2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.members-list h3 {
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #0b2b3b;
}

.search-box {
    width: 100%;
    margin-bottom: 0.8rem;
    padding: 0.5rem;
}

#memberSelect {
    width: 100%;
    padding: 0.5rem;
    border-radius: 12px;
    margin-bottom: .8rem;
}

/* Форма редактирования - сообщение о пустом дереве */
.empty-tree-message {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8fafc;
    border-radius: 20px;
    color: #64748b;
    justify-content: center;
}

.empty-tree-message p {
    font-size: 0.9rem;
}

.empty-tree-message strong {
    color: #2c5f8a;
}

/* Форма редактирования */
.edit-form {
    flex: 2;
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.edit-form h3 {
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #0b2b3b;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-header h3 {
    margin-bottom: 0;
}

/* Поля формы */
.form-row {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-row label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #1e2f41;
}

.form-row input, .form-row select {
    padding: 0.6rem;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 0.95rem;
    background: white;
}

.form-row input:focus, .form-row select:focus {
    outline: none;
    border-color: #2c5f8a;
    box-shadow: 0 0 0 2px rgba(44, 95, 138, 0.1);
}

.info-list {
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    min-height: 2.5rem;
    color: #1e2f41;
}

/* чекбокс о смерти */
.checkbox-row {
    margin-bottom: 4px !important;  /* Уменьшаем отступ снизу */
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #6366f1;
}

.checkbox-label span {
    font-weight: 500;
    font-size: 0.95rem;
    color: #1e293b;
}

.checkbox-label:hover span {
    color: #6366f1;
}

#deathDateRow {
    transition: opacity 0.2s ease;
}

/* Обязательное поле */
.required-star {
    color: #dc2626;
}

.validation-message {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

.form-row.required input.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

/* ========== ФОТОГРАФИИ ========== */
#photoContainer {
    display: flex;
    margin-bottom: 1.2rem;
}

.photo-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    cursor: pointer;
}

.member-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-wrapper:hover .photo-overlay {
    opacity: 1;
}

.photo-add-btn, .photo-remove-btn {
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.photo-add-btn:hover, .photo-remove-btn:hover {
    transform: scale(1.05);
    background: #e2e8f0;
}

/* ========== НАСТРОЙКА ДОСТУПА ========== */
.access-settings {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.access-settings h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #1e2f41;
}

.access-settings h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.8rem;
}
/* Режим просмотра — убираем лишние отступы и границы */
.access-settings.viewer-mode {
    margin-top: 0;
    border: none;
    background: transparent;
}

.share-link-info {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
}

.share-link-url {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.share-link-url input {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-family: monospace;
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 8px;
}

.share-link-expiry {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f1f5f9;
    border-radius: 8px;
}

.share-link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-link-empty {
    background: #f1f5f9;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

.share-link-loading {
    text-align: center;
    padding: 1rem;
    color: #64748b;
}

.notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification-toast.success {
    background: #10b981;
}

.notification-toast.error {
    background: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Управление доступом пользователей */
.users-access-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.user-access-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.user-access-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.tree-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 2;
    min-width: 150px;
}

.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.user-email {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

.user-role-select {
    min-width: 140px;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
}

.user-role-select:focus {
    outline: none;
    border-color: #6366f1;
}

.remove-user-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #ef4444;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-user-btn:hover {
    background: #fee2e2;
    transform: scale(1.05);
}

.remove-user-btn img {
    width: 18px;
    height: 18px;
}

.users-empty {
    text-align: center;
    padding: 1.5rem;
    background: #f1f5f9;
    border-radius: 0.75rem;
    color: #64748b;
    font-size: 0.85rem;
}

.users-loading {
    text-align: center;
    padding: 1rem;
    color: #64748b;
    font-size: 0.85rem;
}

/* управление доступом к чужому дереву */
/* Блок информации о доступе */
.access-info-block {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.access-info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.access-info-header span {
    font-size: 1.25rem;
}

.access-info-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e2f41;
}

.access-info-block p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.owner-info-container {
    margin-top: 1rem;
    margin-bottom: .5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.owner-info-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 0.75rem;
}

.owner-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
}

.owner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.owner-details {
    flex: 1;
}

.owner-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.owner-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

/* ========== НИЖНЯЯ ПАНЕЛЬ ========== */
.action-bar {
    padding: 1.5rem 2rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ========== МОДАЛЬНЫЕ ОКНА ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.wide-modal {
    max-width: 600px;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #1e2f41;
}

.modal-content select {
    width: 100%;
    margin: 0.5rem 0 1rem;
    padding: 0.5rem;
}

.search-box-small {
    width: 100%;
    padding: 0.4rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Стили для кнопок закрытия модальных окон */
.modal-content .close-tree-modal,
.modal-content .close-delete-tree,
.modal-content .close-spouse,
.modal-content .close-parents,
.modal-content .close-history {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #64748b;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    padding: 0 0 0 8px;
}

.modal-content .close-tree-modal:hover,
.modal-content .close-delete-tree:hover,
.modal-content .close-spouse:hover,
.modal-content .close-parents:hover,
.modal-content .close-history:hover {
    color: #1e2f41;
}

/* История партнёров */
.history-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.history-row select {
    flex: 2;
    min-width: 150px;
}

.history-row input {
    flex: 1;
    min-width: 150px;
}

.history-row button {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
}

.history-row button:hover {
    background: #b91c1c;
}

/* ========== КОМПОНЕНТ ВВОДА ДАТЫ ========== */
.date-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.date-format-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.date-format-btn {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: all 0.2s;
}

.date-format-btn:hover {
    background: #cbd5e1;
}

.date-format-btn.active {
    background: #1e2f41;
    color: white;
    border-color: #1e2f41;
}

.date-input-fields {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.date-field-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.date-field-group input {
    text-align: center;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.9rem;
    width: auto;
    min-width: 60px;
}

.date-field-group input.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.date-field-group span {
    font-size: 1.2rem;
    font-weight: bold;
    color: #64748b;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 1024px) {
    .main-panel {
        flex-direction: column;
    }
    
    .members-list {
        flex: auto;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-controls {
        justify-content: space-between;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 1rem;
        width: 95%;
    }
    
    .history-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .history-row select,
    .history-row input,
    .history-row button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .form-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: center;
    }
    
    .action-bar .button-std {
        width: 100%;
        text-align: center;
    }
}