/* ========== ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ СТРАНИЦ ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ========== ЛОГОТИП ========== */
.logo {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.logo span:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo span:last-child {
    color: #4f46e5;
}

/* Или вариант с эмодзи */
.logo-icon {
    font-size: 36px;
    margin-right: 8px;
}

/* ========== КАРТОЧКИ (ОБЩИЙ СТИЛЬ) ========== */
.card {
    background: white;
    border-radius: 28px;
    padding: 40px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    margin: 20px auto;
}

.card-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: #1f2937;
}

.card-subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 32px;
    font-size: 14px;
}

/* ========== ФОРМЫ ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fafbfc;
}

.form-group input:hover,
.form-group select:hover {
    border-color: #cbd5e1;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ========== РАДИО И ЧЕКБОКСЫ ========== */
.radio-group {
    display: flex;
    gap: 24px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
}

.radio-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #4f46e5;
}

.radio-option span {
    font-size: 14px;
    color: #1f2937;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    padding: 4px 0;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #4f46e5;
}

.checkbox-label span {
    font-size: 13px;
    color: #4b5563;
}

.checkbox-label a {
    color: #4f46e5;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ========== КНОПКИ ========== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* ========== ССЫЛКИ ========== */
.link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
}

.link a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.link a:hover {
    text-decoration: underline;
}

/* ========== СООБЩЕНИЯ ========== */
.message {
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: none;
    font-size: 14px;
    text-align: center;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
    border-left: 4px solid #10b981;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
    border-left: 4px solid #ef4444;
}

/* ========== ПОДСКАЗКИ ========== */
.hint {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
    line-height: 1.4;
}

/* ========== РАЗДЕЛИТЕЛИ ========== */
hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* ========== ТАБЛИЦЫ ========== */
.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 14px 16px;
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

tr:hover {
    background: #f9fafb;
}

/* ========== СТАТУСЫ ========== */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-paid {
    background: #d1fae5;
    color: #059669;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-hold {
    background: #fef3c7;
    color: #d97706;
}

.status-released {
    background: #dbeafe;
    color: #1e40af;
}

.status-draft {
    background: #e5e7eb;
    color: #6b7280;
}

/* ========== СУММЫ ========== */
.amount-positive {
    color: #10b981;
    font-weight: 500;
}

.amount-negative {
    color: #ef4444;
    font-weight: 500;
}

/* ========== QR-КОД ========== */
.qr-box {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 24px;
    margin-bottom: 16px;
}

.qr-img {
    width: 180px;
    height: 180px;
    margin: 0 auto 12px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}

.qr-code-text {
    font-family: monospace;
    font-size: 14px;
    background: #f3f4f6;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

/* ========== КАЛЕНДАРЬ (DATE INPUT) ========== */
input[type="date"] {
    background: white;
    border: 1.5px solid #4f46e5;
    padding: 12px;
    font-size: 14px;
    color: #1f2937;
    border-radius: 12px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background: #4f46e5;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    filter: invert(1);
}

/* ========== МОБИЛЬНЫЕ УСТРОЙСТВА ========== */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .card, .register-card, .login-container, .oferta-container {
        padding: 20px;
        margin: 8px;
        border-radius: 20px;
    }
    
    .nav {
        gap: 4px;
    }
    
    .nav-btn {
        font-size: 11px;
        padding: 8px 4px;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* Таблицы на мобильных */
    .table-wrapper {
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    table {
        min-width: 550px;
        font-size: 12px;
    }
    
    th, td {
        white-space: nowrap;
        padding: 8px 10px;
    }
    
    th {
        font-size: 12px;
    }
    
    /* Кнопки */
    .btn-primary, .btn-secondary {
        padding: 12px;
        font-size: 14px;
    }
    
    /* QR-код */
    .qr-img {
        width: 140px;
        height: 140px;
    }
    
    .qr-img img {
        width: 120px !important;
        height: 120px !important;
    }
    
    /* Фильтры (календарь) */
    .filter-bar {
        flex-direction: column;
        background: #f9fafb;
        padding: 12px;
        border-radius: 16px;
        gap: 12px;
    }
    
    .filter-bar input, .filter-bar button {
        width: 100%;
    }
    
    input[type="date"] {
        font-size: 16px;
        padding: 12px;
    }
    
    /* Модальные окна */
    .modal-content {
        width: 95%;
        padding: 16px;
    }
    
    .content {
        padding: 12px;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 480px) {
    .nav-btn {
        font-size: 10px;
        padding: 6px 2px;
    }
    
    th, td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .btn-details, .btn-pay {
        padding: 4px 6px;
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .user-name {
        font-size: 11px;
    }
    
    #dashboardStatus {
        font-size: 11px;
    }
    
    .form-group label {
        font-size: 11px;
    }
    
    .form-group input, .form-group select {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .btn-primary, .btn-secondary {
        font-size: 12px;
        padding: 8px;
    }
    
    .nav-btn {
        font-size: 9px;
        padding: 6px 2px;
    }
}
/* Фикс статуса Самозанятый на мобильных */
@media (max-width: 768px) {
    #dashboardStatus {
        font-size: 11px !important;
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.2 !important;
        max-width: 100% !important;
        display: block !important;
    }
    
    /* Уменьшаем саму карточку */
    .stat-card {
        padding: 8px 6px !important;
    }
    
    /* Уменьшаем заголовок карточки */
    .stat-label {
        font-size: 10px !important;
    }
}