/* Обновленные стили с учетом требований */
* {
    box-sizing: border-box;
}

:root {
    --bg-color: #ffffff;
    --text-color: #003366; /* Темно-голубой */
    --accent-color: #0056b3;
    --secondary-bg: #f8f9fa;
    --border-color: #e1e4e8;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex; /* Центрирование всего на экране */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden; /* Fix horizontal scroll */
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    box-sizing: border-box; /* Ensure padding doesn't increase width */
}

/* Форма входа */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: #ffffff; /* Белый фон карточки */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); /* Мягкая тень */
    border: 1px solid var(--border-color);
    text-align: center;
}

h2 {
    margin-top: 0;
    color: var(--accent-color);
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"], input[type="password"], input[type="date"], input[type="time"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--accent-color);
}

/* Input с префиксом +7 */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.phone-prefix {
    background: #f1f3f5;
    padding: 12px;
    border-right: 1px solid #ccc;
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

.phone-input-wrapper input {
    border: none;
    border-radius: 0;
    flex: 1;
}

/* Password Wrapper with Eye */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 45px; /* Space for eye button */
}

.eye-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 5px 10px;
    color: #888;
    z-index: 2;
    width: auto !important; /* Override .btn global width if needed */
    box-shadow: none !important;
}

.eye-btn:hover {
    color: var(--accent-color);
    background: none !important;
    transform: translateY(-50%) !important;
}

.btn {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0, 86, 179, 0.2);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0, 86, 179, 0.3);
    background: linear-gradient(135deg, #0062cc 0%, #0056b3 100%);
}

.btn:active {
    transform: translateY(0);
}

/* Login Tabs */
.login-tabs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    background: #f1f3f5;
    padding: 5px;
    border-radius: 8px;
}

.login-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 5px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    color: #666;
    transition: all 0.2s;
    font-weight: 500;
}

.login-tab.active {
    background: white;
    color: var(--accent-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: bold;
}

.login-tab:hover:not(.active) {
    background: rgba(255,255,255,0.5);
    color: #333;
}

/* Адаптивность для табов */
@media (max-width: 400px) {
    .login-tabs {
        flex-wrap: wrap;
    }
    .login-tab {
        flex: 1 1 45%; /* По 2 в ряд */
        margin-bottom: 5px;
    }
}

.dashboard {
    display: none; /* Скрыто по умолчанию */
}

.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-color);
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    border-bottom-color: var(--accent-color);
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Пароль метр */
.password-strength {
    height: 5px;
    background: #eee;
    margin-top: 5px;
    border-radius: 3px;
    transition: width 0.3s, background 0.3s;
}

.strength-weak { width: 33%; background: var(--danger-color); }
.strength-medium { width: 66%; background: var(--warning-color); }
.strength-strong { width: 100%; background: var(--success-color); }

/* Адаптивность */
@media (max-width: 600px) {
    .login-container {
        margin: 10px;
        width: auto;
        padding: 20px; /* Уменьшаем отступы внутри формы */
    }
    
    input[type="text"], input[type="password"], input[type="date"], input[type="time"], select, textarea {
        font-size: 14px; /* Чуть уменьшаем шрифт полей */
        padding: 10px;
    }

    .btn {
        font-size: 14px;
        padding: 12px;
    }

    .phone-prefix {
        padding: 10px;
        font-size: 14px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        text-align: left;
        border-bottom: 1px solid #eee;
    }
}


/* Мобильные стили (Cards View) */
@media (max-width: 768px) {
    .container {
        padding: 10px; /* Reduce padding on mobile */
    }
    
    .card {
        padding: 15px; /* Reduce card padding */
    }

    /* Общие стили для таблиц -> Карточки */
    .transaction-table, .transaction-table tbody, .transaction-table tr, .transaction-table td {
        display: block;
        width: 100%;
    }

    .transaction-table thead {
        display: none; /* Скрываем заголовки таблицы */
    }

    .transaction-table tr {
        margin-bottom: 15px;
        background: #fff;
        border: 1px solid #e1e4e8;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        padding: 10px;
    }

    .transaction-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start; /* Выравнивание по верху для длинного текста */
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
        text-align: right;
        font-size: 14px; /* Уменьшенный шрифт в таблице */
    }

    .transaction-table td::before {
        content: attr(data-label); /* Берем заголовок из атрибута */
        font-weight: 600;
        color: #555;
        text-align: left;
        margin-right: 10px;
        flex: 0 0 40%; /* Фиксированная ширина для заголовка (40%) */
        word-wrap: break-word;
    }
    
    .transaction-table td > * {
        flex: 1;
        text-align: right;
        word-break: break-word; /* Перенос длинных слов/чисел */
    }

    /* Модальные окна на весь экран */
    .modal-content {
        width: 95%;
        max-width: 100%;
        margin: 10px auto;
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Кнопки управления */
    .finance-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .finance-controls .btn, .finance-controls .btn-outline {
        width: 100% !important;
        margin-bottom: 10px;
    }

    /* Инпуты */
    .filter-group {
        flex-direction: column;
    }
    
    
    .filter-input {
        width: 100%;
    }
}

/* Кнопки посещаемости */
.attendance-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    color: #ccc;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.attendance-btn.present {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    transform: scale(1.1);
}
