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

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

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 400;
}

/* Overview Section */
.overview-section {
    margin-bottom: 40px;
}

.overview-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.overview-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.overview-header p {
    color: #718096;
    font-size: 1rem;
}

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

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 5px solid;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card.completed {
    border-left-color: #48bb78;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.stat-card.in-progress {
    border-left-color: #4299e1;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.stat-card.not-paid {
    border-left-color: #f56565;
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.stat-card.total {
    border-left-color: #805ad5;
    background: linear-gradient(135deg, #805ad5 0%, #6b46c1 100%);
    color: white;
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 20px;
    opacity: 0.9;
}

.stat-content h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-content p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-amount {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.quick-stat-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.quick-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.quick-stat-label {
    display: block;
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

/* Form Styles */
.form-section {
    margin-bottom: 40px;
}

.form-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 25px;
    text-align: center;
}

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

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

.form-group label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4299e1;
    background: white;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

/* Table Styles */
.table-section {
    margin-bottom: 40px;
}

.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f7fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.table-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
}

.table-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: #f7fafc;
    color: #4a5568;
    font-size: 0.9rem;
}

.table-wrapper {
    overflow-x: auto;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th {
    background: #f7fafc;
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.invoice-table tbody tr:hover {
    background: #f8fafc;
    transform: translateX(2px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.status-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.status-completed {
    background: #c6f6d5;
    color: #276749;
}

.status-in-progress {
    background: #bee3f8;
    color: #2a69ac;
}

.status-not-paid {
    background: #fed7d7;
    color: #c53030;
}

.amount-cell {
    font-weight: 600;
    color: #2d3748;
}

.delete-btn {
    background: #fed7d7;
    color: #c53030;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #feb2b2;
    transform: scale(1.05);
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-status-btn {
    background: #e6fffa;
    color: #319795;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.edit-status-btn:hover {
    background: #b2f5ea;
    transform: scale(1.05);
}

.status-select {
    padding: 4px 8px;
    border: 2px solid #4299e1;
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    color: #2d3748;
    min-width: 120px;
}

.empty-state td {
    text-align: center;
    padding: 60px 20px;
}

.empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.empty-message p {
    color: #718096;
    font-size: 1.1rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: #f56565;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.modal-body {
    padding: 20px 30px;
}

.modal-body p {
    font-size: 1rem;
    color: #4a5568;
    margin-bottom: 15px;
    line-height: 1.6;
}

.invoice-details {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
}

.invoice-details p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.invoice-details strong {
    color: #2d3748;
}

.modal-actions {
    padding: 15px 30px 25px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

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

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Reminders Section */
.reminders-section {
    margin-bottom: 40px;
}

.reminders-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.reminders-container h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 25px;
    text-align: center;
}

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

.reminder-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.reminder-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.reminder-card.urgent {
    border-left-color: #f56565;
    background: linear-gradient(to right, #fff5f5, #fff);
}

.reminder-card.upcoming {
    border-left-color: #4299e1;
    background: linear-gradient(to right, #ebf8ff, #fff);
}

.reminder-card.scheduled {
    border-left-color: #48bb78;
    background: linear-gradient(to right, #f0fff4, #fff);
}

.reminder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.reminder-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.reminder-date {
    font-size: 0.9rem;
    color: #718096;
}

.reminder-content {
    margin-bottom: 15px;
}

.reminder-actions {
    display: flex;
    gap: 10px;
}

.reminder-btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reminder-sent {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 8px;
    font-style: italic;
}

.send-reminder {
    background: #4299e1;
    color: white;
    border: none;
}

.send-reminder:hover {
    background: #3182ce;
    transform: scale(1.05);
}

.send-reminder:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.mark-paid {
    background: #48bb78;
    color: white;
    border: none;
}

.mark-paid:hover {
    background: #38a169;
}

/* Enhanced Form Styles */
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f7fafc;
    resize: vertical;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: #4299e1;
    background: white;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Payment Status Indicator */
.payment-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.payment-overdue {
    background: #fed7d7;
    color: #c53030;
}

.payment-due-soon {
    background: #fefcbf;
    color: #975a16;
}

.payment-upcoming {
    background: #e6fffa;
    color: #2c7a7b;
}

/* Currency Specific Styles */
.amount-idr {
    color: #2C5282;
    background: #EBF8FF;
    padding: 4px 8px;
    border-radius: 6px;
    border-left: 3px solid #4299E1;
}

.amount-usd {
    color: #276749;
    background: #F0FFF4;
    padding: 4px 8px;
    border-radius: 6px;
    border-left: 3px solid #48BB78;
}

/* Split Currency Stats */
.currency-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 15px;
    background: #F7FAFC;
    border-radius: 8px;
    margin-top: 10px;
}

.currency-stat-item {
    text-align: center;
    padding: 10px;
    border-radius: 6px;
}

.currency-stat-item.idr {
    background: #EBF8FF;
    border: 1px solid #BEE3F8;
}

.currency-stat-item.usd {
    background: #F0FFF4;
    border: 1px solid #C6F6D5;
}

.currency-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.currency-label.idr {
    color: #2C5282;
}

.currency-label.usd {
    color: #276749;
}

.currency-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .table-actions {
        justify-content: space-between;
    }
    
    .invoice-table th,
    .invoice-table td {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        font-size: 2rem;
        margin-right: 15px;
    }
    
    .stat-content h3 {
        font-size: 1.8rem;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .reminders-grid {
        grid-template-columns: 1fr;
    }
    
    .reminder-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px 15px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .table-header {
        padding: 20px;
    }
    
    .invoice-table {
        font-size: 0.85rem;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}