/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Enhanced Quick Actions */
.quick-actions {
    margin: 2.5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #666;
    font-size: 1rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.action-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border: 2px solid #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2e7d32, #4caf50);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-card:hover {
    border-color: #2e7d32;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.15);
}

.action-card:hover::before {
    opacity: 1;
}

.action-icon {
    position: relative;
    margin-right: 1rem;
    flex-shrink: 0;
}

.action-icon span {
    font-size: 2.5rem;
}

.icon-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ffeb3b;
    color: #333;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid white;
}

.action-content {
    flex: 1;
}

.action-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #333;
}

.action-content p {
    margin: 0 0 0.75rem 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.action-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta-item {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #666;
}

.action-arrow {
    color: #2e7d32;
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.action-card:hover .action-arrow {
    transform: translateX(3px);
}

/* Export Section */
.export-section {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.export-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.export-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.export-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.export-content {
    flex: 1;
}

.export-content h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.export-content p {
    margin: 0 0 0.75rem 0;
    color: #666;
    font-size: 0.9rem;
}

.export-stats {
    display: flex;
    gap: 1rem;
}

.stat {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.export-actions {
    flex-shrink: 0;
}

/* Stats Overview */
.stats-overview {
    margin: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #2e7d32;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-trend {
    color: #999;
    font-size: 0.8rem;
}

/* Data Preview */
.data-preview {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin: 2rem 0;
}

.preview-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #2e7d32;
    border-bottom-color: #2e7d32;
    font-weight: 600;
}

.tab-btn:hover {
    color: #2e7d32;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-header h4 {
    margin: 0;
    color: #333;
}

.table-responsive {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.status-paid {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-pending {
    background: #fff3e0;
    color: #ef6c00;
}

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-inactive {
    background: #f5f5f5;
    color: #666;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #2e7d32;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn:hover {
    background: #1b5e20;
    color: white;
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: #2e7d32;
}

.btn-success {
    background: #4caf50;
}

/* Welcome Header */
.welcome-header {
    text-align: center;
    margin: 2rem 0 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: white;
    border-radius: 12px;
}

.welcome-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.welcome-header p {
    margin: 0 0 1rem 0;
    opacity: 0.9;
}

.current-date {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Stats Grid for Dashboard */
.stats-grid-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #2e7d32;
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
}

.stat-info .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 0.25rem;
}

.stat-info .stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.stat-info .stat-trend {
    color: #999;
    font-size: 0.8rem;
}

/* Recent Activity */
.recent-activity {
    margin: 3rem 0;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.activity-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.activity-card h4 {
    margin: 0 0 1rem 0;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-desc {
    color: #555;
    font-size: 0.9rem;
}

.activity-time {
    color: #888;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
}

/* Page Header */
.page-header {
    text-align: center;
    margin: 2rem 0 3rem 0;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Stock Section */
.stock-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stock-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #2e7d32;
}

.stock-type {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.stock-amount {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.butir {
    color: #2e7d32;
    font-weight: 500;
}

.baki {
    color: #666;
    font-size: 0.9rem;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: #666;
    grid-column: 1 / -1;
}

.no-data p {
    margin: 0;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #2e7d32, #388e3c);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
}

.brand-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: #2e7d32;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer p {
    margin: 0.5rem 0;
}

.footer-info {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2e7d32;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Container */
.error-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 2rem auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .export-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid-dashboard {
        grid-template-columns: 1fr;
    }
    
    .preview-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .tab-btn {
        border-bottom: 1px solid #e0e0e0;
        border-radius: 0;
        text-align: left;
        width: 100%;
    }
    
    .tab-btn.active {
        border-bottom: 3px solid #2e7d32;
    }
    
    .export-card {
        flex-direction: column;
        text-align: center;
    }
    
    .export-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .export-actions {
        margin-top: 1rem;
    }
    
    .activity-grid {
        grid-template-columns: 1fr;
    }
    
    .stock-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-icon {
        margin-right: 0;
        font-size: 1.25rem;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .welcome-header {
        padding: 1.5rem;
    }
    
    .welcome-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .welcome-header {
        padding: 1rem;
        margin: 1rem 0 2rem 0;
    }
    
    .welcome-header h1 {
        font-size: 1.3rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stock-grid {
        grid-template-columns: 1fr;
    }
    
    .action-card {
        padding: 1rem;
    }
    
    .export-card {
        padding: 1rem;
    }
    
    .data-preview {
        padding: 1rem;
    }
    
    .section-header h3 {
        font-size: 1.3rem;
    }
}