* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.4em;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.1);
}

.nav-links a.logout {
    background: #e74c3c;
}

.nav-links a.logout:hover {
    background: #c0392b;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.login-box p {
    color: #7f8c8d;
    margin-bottom: 30px;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.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-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small, .btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-toggle {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-toggle:hover {
    background: #2980b9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Dashboard */
h1 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 2em;
}

h2, h3 {
    color: #34495e;
    margin-bottom: 15px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.metric-card.primary { border-left-color: #667eea; }
.metric-card.success { border-left-color: #27ae60; }
.metric-card.warning { border-left-color: #f39c12; }
.metric-card.info { border-left-color: #3498db; }

.metric-card h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-card .amount {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.metric-card .subtext {
    font-size: 13px;
    color: #95a5a6;
}

.details-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-box {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Tables */
.simple-table {
    width: 100%;
    border-collapse: collapse;
}

.simple-table td {
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.simple-table td:last-child {
    text-align: right;
    font-weight: 500;
}

.simple-table .total-row {
    border-top: 2px solid #34495e;
    font-size: 1.1em;
}

.simple-table .total-row.highlight {
    background: #fff9e6;
}

.data-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table thead {
    background: #2c3e50;
    color: white;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr.inactive {
    opacity: 0.5;
}

/* Amount Styling */
.amount {
    font-weight: 600;
    color: #27ae60;
}

.amount.negative {
    color: #e74c3c;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-paid {
    background: #d4edda;
    color: #155724;
}

.badge-overdue {
    background: #f8d7da;
    color: #721c24;
}

/* Sections */
.add-section,
.list-section,
.recent-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.action-hint {
    margin-top: 20px;
    padding: 15px;
    background: #d4edda;
    border-left: 4px solid #28a745;
    border-radius: 4px;
}

.action-hint.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.action-hint p {
    margin-bottom: 10px;
}

.status-select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

/* Consultant Balances */
.consultants-owed-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.consultants-owed-section h2 {
    margin-bottom: 20px;
}

.consultant-balances {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.consultant-balance-card {
    background: #f8f9fa;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 20px;
}

.consultant-balance-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.balance-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.balance-row.total {
    border-top: 2px solid #2c3e50;
    border-bottom: none;
    padding-top: 12px;
    margin-top: 5px;
}

.balance-row .amount.owed {
    color: #e74c3c;
    font-size: 1.2em;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 600;
    color: #7f8c8d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #2c3e50;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Executive Summary Hero Section */
.executive-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 12px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.hero-metric {
    text-align: center;
    margin-bottom: 30px;
}

.hero-label {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.hero-amount {
    font-size: 72px;
    font-weight: bold;
    margin: 15px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-status {
    font-size: 20px;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    margin-top: 10px;
}

.status-healthy {
    background: rgba(46, 204, 113, 0.3);
    border: 2px solid #2ecc71;
}

.status-warning {
    background: rgba(241, 196, 15, 0.3);
    border: 2px solid #f1c40f;
}

.status-critical {
    background: rgba(231, 76, 60, 0.3);
    border: 2px solid #e74c3c;
}

.hero-secondary {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.secondary-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    flex: 1;
    min-width: 150px;
}

.secondary-label {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.secondary-value {
    font-size: 24px;
    font-weight: bold;
}

/* Action Items Panel */
.action-items-panel {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.action-items-panel h2 {
    margin-bottom: 20px;
}

.action-items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    background: #f8f9fa;
}

.action-item.urgent {
    border-left-color: #e74c3c;
    background: #fee;
}

.action-item.warning {
    border-left-color: #f39c12;
    background: #fef5e7;
}

.action-item.success {
    border-left-color: #27ae60;
    background: #eafaf1;
}

.action-item.info {
    border-left-color: #3498db;
    background: #ebf5fb;
}

.action-icon {
    font-size: 24px;
    margin-right: 15px;
}

.action-text {
    flex: 1;
    font-size: 15px;
}

.action-link {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.action-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* Quick Metrics Grid */
.quick-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.quick-metric-card {
    background: white;
    padding: 30px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-top: 4px solid #3498db;
}

.quick-metric-card.green {
    border-top-color: #27ae60;
}

.quick-metric-card.blue {
    border-top-color: #3498db;
}

.quick-metric-card.orange {
    border-top-color: #f39c12;
}

.quick-metric-card.purple {
    border-top-color: #9b59b6;
}

.qm-value {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.qm-label {
    font-size: 14px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tooltips */
.tooltip-icon {
    cursor: help;
    color: #3498db;
    margin-left: 5px;
    font-size: 14px;
}

/* Planning View */
.planning-summary {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    text-align: center;
}

.planning-metric {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.planning-metric span {
    font-size: 18px;
    color: #7f8c8d;
}

.planning-metric strong {
    font-size: 48px;
    color: #2c3e50;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 10px;
    }

    .metrics-grid,
    .details-section {
        grid-template-columns: 1fr;
    }

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

    .hero-amount {
        font-size: 48px;
    }

    .hero-secondary {
        flex-direction: column;
    }

    .dashboard-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 120px;
    }
}
