/* style.css - Упрощенные стили приложения */

/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
    line-height: 1.5;
    font-size: 14px;
}

/* ===== ТИПОГРАФИЯ ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 0.75rem;
}

a {
    color: #2196F3;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== ЗАГОЛОВОК ===== */
.header {
    background: #4CAF50;
    color: white;
    padding: 15px 0;
    border-bottom: 1px solid #388E3C;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.logo i {
    font-size: 1.5rem;
}

.current-date {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ===== КОНТЕЙНЕР И СЕТКА ===== */
.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

/* ===== ВКЛАДКИ ===== */
.tabs-nav {
    display: flex;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.tab-link {
    flex: 1;
    padding: 12px 10px;
    text-align: center;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.tab-link:last-child {
    border-right: none;
}

.tab-link:hover {
    background: #f8f9fa;
}

.tab-link.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
    background: #f8f9fa;
}

.tab-link i {
    font-size: 1rem;
}

/* ===== КОНТЕНТ (ШИРОКИЙ) ===== */
.content {
    background: white;
    border-radius: 4px;
    padding: 30px;
    min-height: 500px;
    border: 1px solid #ddd;
}

/* ===== КАРТОЧКИ СТАТИСТИКИ ===== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    color: #333;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #ddd;
    border-top: 3px solid #4CAF50;
}

.stat-card.income {
    border-top-color: #4CAF50;
}

.stat-card.expense {
    border-top-color: #f44336;
}

.stat-card.balance {
    border-top-color: #2196F3;
}

.stat-card h3 {
    font-size: 0.875rem;
    margin-bottom: 8px;
    color: #666;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 5px 0;
}

/* ===== ФОРМЫ ===== */
.form-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.form-section.income-form {
    border-left: 3px solid #4CAF50;
}

.form-section.expense-form {
    border-left: 3px solid #f44336;
}

.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 0.875rem;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="date"],
.form-row select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.875rem;
    background: white;
}

.form-row input:focus,
.form-row select:focus {
    border-color: #4CAF50;
    outline: none;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: #45a049;
}

.btn-primary {
    background: #4CAF50;
}

.btn-secondary {
    background: #757575;
}

.btn-danger {
    background: #f44336;
}

.btn-info {
    background: #2196F3;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ===== ТАБЛИЦЫ ===== */
.table-container {
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 3px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.875rem;
}

table thead {
    background: #f8f9fa;
    color: #333;
}

table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

table tbody tr {
    border-bottom: 1px solid #eee;
}

table tbody tr:hover {
    background: #f9f9f9;
}

table td {
    padding: 10px 12px;
}

/* ===== СООБЩЕНИЯ ===== */
.message {
    padding: 10px 15px;
    border-radius: 3px;
    margin: 10px 0;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.warning-message {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.info-message {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* ===== МОДАЛЬНЫЕ ОКНА (МАЛЕНЬКИЕ) ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 4px;
    width: 400px; /* Меньше чем было */
    max-width: 90%;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

/* ===== СЕТКА КОЛОНОК ===== */
.columns-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ===== КАРТОЧКИ ===== */
.card {
    background: white;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.card-title {
    margin: 0;
    color: #333;
    font-size: 1rem;
}

.card-body {
    padding: 5px 0;
}

.card-footer {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 15px;
}

/* ===== БЭДЖИ ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 10px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-primary {
    background: #d1e7ff;
    color: #0a58ca;
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ КОМПОНЕНТЫ ===== */
.data-card {
    background: white;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-left: 3px solid #4CAF50;
}

.data-card.expense-card {
    border-left-color: #f44336;
}

.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: white;
}

/* ===== УТИЛИТЫ ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 15px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 15px; }
.mb-3 { margin-bottom: 20px; }

.p-1 { padding: 10px; }
.p-2 { padding: 15px; }

.hidden { display: none; }

.border { border: 1px solid #ddd; }
.rounded { border-radius: 3px; }

.bg-light { background: #f8f9fa; }
.bg-white { background: white; }

.text-primary { color: #4CAF50; }
.text-danger { color: #f44336; }
.text-success { color: #4CAF50; }
.text-muted { color: #6c757d; }

.font-weight-bold { font-weight: 600; }

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .header-content {
        max-width: 100%;
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .tabs-nav {
        flex-direction: column;
    }
    
    .tab-link {
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .content {
        padding: 20px;
    }
    
    .form-columns,
    .columns-2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .month-nav {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
        margin: 10px auto;
    }
    
    .content {
        padding: 15px;
    }
    
    .header-content {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
}

/* ===== ПЕЧАТЬ ===== */
@media print {
    .header, 
    .tabs-nav, 
    .btn:not(.print-only),
    .modal,
    .quick-actions {
        display: none !important;
    }
    
    .container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
    
    .content {
        border: none;
        padding: 0;
        min-height: auto;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .stat-card,
    .card,
    .data-card {
        break-inside: avoid;
        border: 1px solid #ddd;
    }
}