/* ============================================================================
   BUDGET SYSTEM - COMPLETE STYLESHEET
   Modern, clean design for budget tracking
   ============================================================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    color: #667eea;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-size: 14px;
    color: #666;
}

.btn-logout {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
}

/* Navigation */
.nav {
    background: white;
    padding: 0 30px;
    display: flex;
    gap: 0;
    border-bottom: 2px solid #f3f4f6;
}

.nav a {
    padding: 15px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav a:hover {
    color: #667eea;
    background: #f9fafb;
}

.nav a.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Cards */
.card {
    background: white;
    padding: 30px;
    margin-top: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card:last-child {
    border-radius: 0 0 12px 12px;
}

.card h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}

/* Period Navigation */
.period-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.period-info {
    text-align: center;
}

.period-info h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.period-info p {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.btn-nav {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-nav:hover {
    background: #5568d3;
}

/* Summary Cards */
.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 8px;
    color: white;
}

.summary-card.income {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.summary-card.expenses {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.summary-card.pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.summary-card.balance.positive {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.summary-card.balance.negative {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.summary-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.summary-card h3 {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 10px;
}

.summary-card .amount {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.summary-card small {
    font-size: 12px;
    opacity: 0.8;
}

.adjustment {
    display: block;
    margin-top: 8px;
    font-size: 11px;
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    background: #667eea;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn:hover {
    background: #5568d3;
}

.btn-primary {
    background: #667eea;
}

.btn-success {
    background: #10b981;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: #f59e0b;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-admin {
    background: #8b5cf6;
}

.btn-admin:hover {
    background: #7c3aed;
}

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

.btn-approve {
    background: #10b981;
}

.btn-approve:hover {
    background: #059669;
}

.btn-reject {
    background: #ef4444;
}

.btn-reject:hover {
    background: #dc2626;
}

.btn-delete {
    background: #ef4444;
}

.btn-delete:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 11px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th {
    background: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #e5e7eb;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

tbody tr:hover {
    background: #f9fafb;
}

/* Status Badges */
.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Forecast Grid */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.forecast-card {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.forecast-card.active {
    background: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.forecast-card h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.period-dates {
    font-size: 11px;
    color: #666;
    margin-bottom: 12px;
}

.forecast-amounts {
    margin: 10px 0;
}

.income-small,
.expenses-small,
.balance-small {
    font-size: 13px;
    margin: 4px 0;
}

.income-small {
    color: #10b981;
}

.expenses-small {
    color: #f59e0b;
}

.balance-small.positive {
    color: #10b981;
    font-weight: 600;
}

.balance-small.negative {
    color: #ef4444;
    font-weight: 600;
}

/* Empty State */
.empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-card h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
}

.login-help {
    margin-top: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.login-help p {
    margin-bottom: 10px;
    font-size: 13px;
    color: #555;
}

.login-help ul {
    list-style: none;
    font-size: 13px;
    color: #666;
}

.login-help li {
    padding: 5px 0;
}

.login-help code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.note {
    font-size: 12px;
    color: #ef4444;
    margin-top: 10px;
}

/* Footer */
footer {
    background: white;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 13px;
    border-radius: 0 0 12px 12px;
    margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .summary {
        grid-template-columns: 1fr;
    }

    .forecast-grid {
        grid-template-columns: 1fr;
    }

    .period-nav {
        flex-direction: column;
        gap: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}
