/* Стили для всех страниц */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* УНИФИЦИРОВАННЫЙ ШРИФТ ДЛЯ ВСЕХ УСТРОЙСТВ */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.5;
    padding: 5px;
    min-height: 100vh;
    max-width: 1024px;
    margin: 0 auto;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

/* ==================== УНИФИЦИРОВАННАЯ СИСТЕМА КНОПОК ==================== */

/* БАЗОВЫЙ КЛАСС ДЛЯ ВСЕХ КНОПОК */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px;
    border: 2px solid #600500;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    text-decoration: none;
    min-height: 64px;
    letter-spacing: 0.3px;
    box-shadow: -1px 5px 8px rgba(255, 117, 39, 0.50);
    touch-action: manipulation;
}

/* ЭФФЕКТ НАЖАТИЯ ДЛЯ ВСЕХ КНОПОК */
.btn:active {
    transform: scale(0.97) translateY(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

/* ИКОНКИ В КНОПКАХ */
.btn-icon {
    font-size: 22px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.btn-text {
    font-size: 17px;
    letter-spacing: 0.9px;
    position: relative;
    z-index: 2;
}

/* ЦВЕТОВЫЕ МОДИФИКАТОРЫ */
.btn--blue {
    background: linear-gradient(3deg, #77000000, #77000000);
    border-bottom: 5px solid #600500;
    color: #600500;
    font-weight: 700;
}

/* КНОПКА Зрегестрироватся */
.btn--green {
    background: linear-gradient(5deg, #77000000, #77000000);
    border-bottom: 5px solid #600500;
}

/*--------------------------------------------------------*/
.btn--purple {
    background: linear-gradient(145deg, #9b59b6, #8e44ad);
    border-bottom: 5px solid #600500;
}

.btn--teal {
    background: linear-gradient(145deg, #ffffff, #ffffff);
    border-bottom: 5px solid #600500;
    color: #600500;
    font-weight: 700;
    letter-spacing: 2px;
    box-shadow: none;
}

.btn--red {
    background: linear-gradient(145deg, #ffffff, #ffffff);
    border-bottom: 5px solid #600500;
    color: #600500;
    font-weight: 700;
    letter-spacing: 2px;
    box-shadow: none;
}

.btn--orange {
    background: linear-gradient(145deg, #e67e22, #d35400);
    border-bottom: 4px solid #600500;
}

.btn--gray {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    color: #6c757d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* НОВЫЙ ЦВЕТ - СТАЛЬНОЙ ДЛЯ "ДОБАВИТЬ ЗАПИСЬ" */
.btn--steel {
    background: linear-gradient(145deg, #4a5568, #2d3748);
    border-bottom: 4px solid #1a202c;
}

.btn--steel:hover {
    background: linear-gradient(145deg, #2d3748, #4a5568);
}

.btn--gray .btn-text {
    color: #495057;
    font-weight: 700;
}

/* РАЗМЕРНЫЕ МОДИФИКАТОРЫ */
.btn--sm {
    padding: 14px 20px;
    font-size: 15px;
    min-height: 56px;
    border-radius: 14px;
}

.btn--md {
    padding: 18px 24px;
    font-size: 17px;
    min-height: 64px;
    border-radius: 16px;
}

.btn--lg {
    padding: 20px 28px;
    font-size: 18px;
    min-height: 70px;
    border-radius: 18px;
}

/* ДОПОЛНИТЕЛЬНЫЕ МОДИФИКАТОРЫ */
.btn--full {
    width: 100%;
}

.btn--flex {
    flex: 1;
}

/* СПЕЦИАЛЬНЫЕ КНОПКИ */
.btn-back {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.add-button::before {
    content: '+';
    font-size: 30px;
    font-weight: 800;
    margin-right: 10px;
}

/* Кнопка "Добавить новую запись" */
.add-button {
    font-size: 20px;
    font-weight: 800;
    color: #002d72 !important;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(224, 247, 255, 0.9) 50%, 
        rgba(255, 255, 255, 0.95) 100%) !important;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 132, 243, 0.5) !important;
    border-bottom: 5px solid #008eff !important;
    box-shadow: 
        0 6px 20px rgba(33, 150, 243, 0.5),
        0 0 30px rgba(33, 150, 243, 0.3),
        inset 0 1px 0 rgba(142, 65, 0, 1),
        0 0 0 2px rgba(142, 65, 0, 1) inset !important;
    text-shadow: 0 5px 5px rgb(0, 35, 255, 0.5);
    letter-spacing: 1px;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* ЛЕГКИЙ ЭФФЕКТ ПРИ НАВЕДЕНИИ */
.add-button:hover {
    box-shadow: 
        0 8px 25px rgba(33, 150, 243, 0.6),
        0 0 35px rgba(33, 150, 243, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.95) !important;
}

/* КНОПКИ СТАТУСА В ФОРМАХ */
.status-button {
    flex: 1;
    padding: 16px;
    background: linear-gradient(145deg, #ffffff, #f7fafc);
    border: 2px solid #e2e8f0;
    color: #4a5568;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    min-height: 56px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-button:active {
    transform: scale(0.96);
}

.status-button.active {
    background: linear-gradient(145deg, #3498db, #2980b9);
    border-bottom: 4px solid #1f639b;
    color: white;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    transform: translateY(-1px);
}

/* ГРУППЫ КНОПОК */
.record-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin: 30px 0 144px;
}

/* ==================== КАРТОЧКИ ЗАПИСЕЙ С ЛЕВОЙ ПОДСВЕТКОЙ ==================== */

.record-card {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.00) 0%,
        rgba(248, 249, 250, 0.00) 50%,
        rgba(255, 255, 255, 0.00) 100%);
    border-radius: 21px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 2px solid rgba(96, 5, 0, 1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Карточка с статусом "planned" - оранжевая левая граница */
.record-card[data-status="planned"] {
    border-left: 5px solid #f39c12;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    background-color: rgba(250, 180, 0, 0.21);
}

/* Карточка с статусом "unpaid" - красная левая граница */
.record-card[data-status="unpaid"] {
    border-left: 5px solid #ff1800;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    background-color: rgba(225, 0, 0, 0.21);
}

/* Карточка с статусом "paid" - зеленая левая граница */
.record-card[data-status="paid"] {
    border-left: 5px solid #30c300;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    background-color: rgba(0, 180, 0, 0.13);
}

/* Эффект при наведении - только для десктопов */
@media (hover: hover) and (pointer: fine) {
    .record-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    }
}

.record-card:active {
    transform: scale(0.995);
}

.record-card.expanded {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
    border-color: rgba(0,0,0,0.1) !important;
    margin-bottom: 8px;
    transform: translateY(-1px);
}

.record-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    position: relative;
    z-index: 2;
}

.record-number {
    background: linear-gradient(145deg, #f5f5f5, #e8e8e8);
    color: #600500;
    padding: 3px 0px;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid #600500;
    flex-shrink: 0;
    margin-top: 2px;
    min-width: 50px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.record-contragent {
    font-weight: 600;
    font-size: 17px;
    color: #2c3e50;
    flex-grow: 1;
    text-align: left;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

.record-row-2 {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    gap: 10px;
}

.record-row-3 {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 130px;
    position: relative;
    z-index: 2;
}

.detail-label {
    font-size: 12px;
    color: #666;
    line-height: 1.2;
    white-space: nowrap;
    font-weight: 500;
}

.detail-value {
    font-size: 16px;
    font-weight: 700;
    color: #000756;
    line-height: 1.2;
}

.detail-value.bold {
    font-weight: 700;
    color: darkgreen;
}

.record-info {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
    position: relative;
    z-index: 2;
}

.record-card.expanded .record-info {
    max-height: 1000px;
    margin-top: 18px;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 13px;
}

.info-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.info-label::before {
    content: '📄';
    font-size: 14px;
}

.info-content {
    font-size: 16px;
    color: black;
    line-height: 1.3;
    background: #ffffff;
    padding: 8px;
    border-radius: 13px;
    border: 3px inset #906d3f;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    margin-top: 6px;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    position: relative;
    z-index: 2;
}

.info-content::-webkit-scrollbar {
    width: 6px;
}

.info-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.info-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.info-content.empty {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-left: 4px solid #6c757d;
}

.expand-icon {
    position: absolute;
    right: 16px;
    top: 16px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #600500;
    font-size: 16px;
    z-index: 3;
    background: rgba(255,255,255,0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #600500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.record-card.expanded .expand-icon {
    transform: rotate(180deg);
    background: linear-gradient(145deg, #600500, #600500);
    color: white;
    border: 2px solid #ffffff;
}

/* Стили для истекших план.дат с красной левой границей */
.record-card.expired-plan {
    border-left: 5px solid #b826ff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    background-color: rgb(158 0 255 / 21%);
}

.record-card.expired-plan .record-number {
    background: linear-gradient(145deg, #e74c3c, #c0392b) !important;
    color: white !important;
    border: 2px solid transparent !important;
    border-image: linear-gradient(45deg, #e74c3c, #ff3333) 1 !important;
}

.expired-date {
    color: #ff0000 !important;
    font-weight: 700 !important;
}

/* ==================== СТАТИСТИЧЕСКИЕ КНОПКИ ==================== */

.stats-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.stat-button {
    background: white;
    border: 1px solid #600500;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.stat-button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 12px 0 0 12px;
}

.stat-button::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    z-index: 0;
    opacity: 0.08;
}

.stat-button[data-stat="total"]::before,
.stat-button[data-stat="total"]::after {
    background: #3498db;
}

.stat-button[data-stat="paid"]::before,
.stat-button[data-stat="paid"]::after {
    background: #30c300;
}

.stat-button[data-stat="unpaid"]::before,
.stat-button[data-stat="unpaid"]::after {
    background: #ff1800;
}

.stat-button[data-stat="planned"]::before,
.stat-button[data-stat="planned"]::after {
    background: #f39c12;
}

.stat-button:active {
    transform: scale(0.98);
}

.stat-button.active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.stat-button[data-stat="total"].active {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2), 0 6px 20px rgba(52, 152, 219, 0.15);
}

.stat-button[data-stat="paid"].active {
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2), 0 6px 20px rgba(46, 204, 113, 0.15);
}

.stat-button[data-stat="unpaid"].active {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2), 0 6px 20px rgba(231, 76, 60, 0.15);
}

.stat-button[data-stat="planned"].active {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2), 0 6px 20px rgba(243, 156, 18, 0.15);
}

.stat-button.active::after {
    opacity: 0.12;
}

.stat-line-1 {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    z-index: 1;
    position: relative;
    font-weight: 500;
    line-height: 1.3;
}

.stat-line-2 {
    font-size: 21px;
    font-weight: 700;
    color: #000756;
    z-index: 1;
    position: relative;
}

.stats-buttons a.stat-button {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ==================== ФОРМЫ АВТОРИЗАЦИИ/РЕГИСТРАЦИИ ==================== */

.auth-container {
    max-width: 377px;
    margin: 34px auto;
    padding: 13px;
}

.auth-box {
    background: #fff4bf30;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(63,25,0,1);
    border: 1px solid #e0e0e0;
    border: 2px solid #8e4100;
}

.auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.auth-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #642800;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    color: #333;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #c75000;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.auth-switch {
    text-align: center;
    margin-top: 21px;
    color: #666;
    font-size: 14px;
}

.auth-switch a {
    color: #470027;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    margin-top: 13px;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ==================== АДМИН-ПАНЕЛЬ ==================== */

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px;
}

.admin-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-title {
    font-size: 24px;
    font-weight: 700;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.users-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border-collapse: collapse;
}

.users-table th {
    background: #f8f9fa;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
}

.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.users-table tr:hover {
    background: #f8f9fa;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.subscription-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.subscription-free {
    background: #f1c40f;
    color: #333;
}

.subscription-light {
    background: #2ecc71;
    color: white;
}

.subscription-medium {
    background: #3498db;
    color: white;
}

.subscription-pro {
    background: #9b59b6;
    color: white;
}

.admin-footer {
    text-align: center;
    color: #666;
    padding: 20px;
    font-size: 14px;
}

/* ==================== МОДАЛЬНЫЕ ОКНА ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    padding: 20px;
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: modalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    color: #333;
    background: rgba(0,0,0,0.05);
}

.modal-body {
    padding: 24px;
}

.subscription-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.subscription-option {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.subscription-option:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.subscription-option.active {
    border-color: #3498db;
    background: #e3f2fd;
}

.subscription-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.subscription-limit {
    font-size: 14px;
    color: #666;
}

/* ==================== ЛИЧНЫЙ КАБИНЕТ ==================== */

#userPage {
    padding-bottom: 20px;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.05) 100%);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    position: relative;
    z-index: 1;
}

.header-text {
    text-align: left;
    flex: 1;
    padding-right: 70px;
}

.subscription-info {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #ecf0f1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subscription-info::before {
    content: '★';
    color: #f1c40f;
}

.user-info {
    font-size: 14px;
    line-height: 1.4;
    color: #bdc3c7;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-container {
    margin-bottom: 16px;
}

.search-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    background: white;
    color: #333;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-input::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 24px 0 16px 0;
    position: relative;
    text-align: center;
    font-size: 21px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* ==================== ФОРМЫ ==================== */

.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    color: #333;
    resize: vertical;
    min-height: 100px;
    transition: all 0.3s;
}

.form-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.status-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin: 30px 0 144px;
}

/* ==================== СООБЩЕНИЯ ==================== */

.message {
    padding: 12px 16px;
    border-radius: 13px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.message.success {
    background: #d4edda;
    color: #00410f;
    border: 2px solid #00ff29;
}

.message.error {
    background: #9e00ff1a;
    color: #ff0000;
    border: 3px solid #b826ff;
}

/* ==================== ФОТОГРАФИИ ==================== */

.photos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.photo-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: transform 0.3s;
}

.photo-thumbnail:hover {
    transform: scale(1.05);
}

.delete-photo-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.photo-container {
    position: relative;
    width: 80px;
    height: 80px;
}

/* ==================== РАЗНОЕ ==================== */

input[type="file"] {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
}

input[type="file"]:focus {
    outline: none;
    border-color: #3498db;
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    z-index: 2;
}

.toggle-password:hover {
    color: #3498db;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 25px 0;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pagination-link {
    display: inline-block;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    min-width: 40px;
    text-align: center;
}

.pagination-link:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-1px);
}

.pagination-link.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: 600;
}

.pagination-info {
    margin-left: 15px;
    font-size: 13px;
    color: #666;
    text-align: center;
    width: 100%;
    margin-top: 10px;
}

/* ==================== АНИМАЦИИ ==================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==================== АДАПТИВНОСТЬ ==================== */

@media (min-width: 768px) {
    .stats-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-bottom: 24px;
    }
    
    .stat-button {
        min-height: 100px;
        padding: 16px;
        border-radius: 16px;
    }
    
    .stat-line-1 {
        font-size: 15px;
    }
    
    .stat-line-2 {
        font-size: 22px;
    }
    
    .search-container,
    .add-button {
        margin-bottom: 24px;
    }
    
    .record-card {
        padding: 20px;
        border-radius: 21px;
    }
    
    .record-contragent {
        font-size: 16px;
    }
    
    .subscription-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 5px;
        padding: 10px;
    }
    
    .pagination-link {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 35px;
    }
    
    .pagination-info {
        font-size: 12px;
    }
}

@media (max-width: 380px) {
    .header {
        padding: 14px;
    }
    
    .header-text {
        padding-right: 60px;
    }
    
    .subscription-info {
        font-size: 15px;
    }
    
    .user-info {
        font-size: 12px;
    }
    
    .stat-button {
        padding: 10px;
        min-height: 75px;
    }
    
    .stat-line-1 {
        font-size: 13px;
    }
    
    .stat-line-2 {
        font-size: 21px;
    }
    
    .search-input {
        padding: 14px 14px 14px 42px;
        font-size: 15px;
    }
    
    .record-card {
        padding: 14px;
    }
    
    .record-contragent {
        font-size: 14px;
    }
    
    .detail-item {
        min-width: 120px;
    }
    
    .detail-label {
        font-size: 11px;
    }
    
    .detail-value {
        font-size: 13px;
    }
    
    .expand-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

@media (max-width: 320px) {
    body {
        padding: 3px;
    }
    
    .header {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .stats-buttons {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .stat-button {
        min-height: 70px;
        padding: 8px;
    }
    
    .search-input {
        padding: 12px 12px 12px 40px;
        font-size: 14px;
    }
    
    .record-card {
        padding: 12px;
    }
    
    .record-row-2,
    .record-row-3 {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .detail-item {
        min-width: 100%;
        justify-content: space-between;
    }
    
    .record-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .status-buttons {
        flex-direction: column;
    }
    
    .form-buttons {
        flex-direction: column;
    }
}

/* ОПТИМИЗАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ */
@media (max-width: 768px) {
    /* Убираем сложные анимации на мобильных устройствах */
    .record-card,
    .add-button,
    .stat-button {
        animation: none !important;
        transition: none !important;
    }
    
    /* Упрощаем тени на мобильных устройствах */
    .record-card[data-status="planned"],
    .record-card[data-status="unpaid"],
    .record-card[data-status="paid"],
    .record-card.expired-plan {
        box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    }
    
    /* Убираем backdrop-filter на мобильных устройствах для производительности */
    .add-button {
        backdrop-filter: none !important;
    }
    
    /* Уменьшаем сложность градиентов на мобильных устройствах */
    .add-button {
        background: rgba(211, 238, 255, 0.95) !important;
    }
    
    /* Упрощаем transform-эффекты на мобильных устройствах */
    .record-card:active {
        transform: scale(0.98);
    }
    
    .record-card.expanded {
        transform: translateY(0);
    }
}

/* ВЫКЛЮЧАЕМ ВСЕ АНИМАЦИИ ПРИ ПРЕДПОЧТЕНИИ ПОЛЬЗОВАТЕЛЯ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== ИСПРАВЛЕНИЕ ПРОЗРАЧНОСТИ КАРТОЧЕК ==================== */
/* ВАРИАНТ 4: Добавление непрозрачного фона в конец CSS */

/* Исправление для карточек - делаем фон непрозрачным */
.record-card {
    background: white !important;
}

.record-card[data-status="planned"] {
    background-color: #fff9e6 !important;
}

.record-card[data-status="unpaid"] {
    background-color: #ffe6e6 !important;
}

.record-card[data-status="paid"] {
    background-color: #e6ffe6 !important;
}

.record-card.expired-plan {
    background-color: #f3e6ff !important;
}

/* Также для контента внутри карточек */
.info-content {
    background: #ffffff !important;
}

/* Для кнопок статистики */
.stat-button {
    background: white !important;
}

/* Для auth-box (формы авторизации) */
.auth-box {
    background: #fffbef !important;
}

/* Для модальных окон */
.modal-content {
    background: white !important;
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

/* Для таблицы пользователей */
.users-table {
    background: white !important;
}

.users-table th {
    background: #f8f9fa !important;
}

/* Для пагинации */
.pagination {
    background: white !important;
}

.pagination-link {
    background: #f8f9fa !important;
}

/* Для кнопок статуса в формах */
.status-button {
    background: linear-gradient(145deg, #ffffff, #f7fafc) !important;
}

.status-button.active {
    background: linear-gradient(145deg, #3498db, #2980b9) !important;
}