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

html {
    background: #1a1a2e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    background-attachment: fixed;
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    color: #8892b0;
    font-size: 1.1rem;
}

.upload-section {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-section:hover {
    border-color: #64ffda;
    background: rgba(100, 255, 218, 0.05);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.upload-icon {
    font-size: 3rem;
}

#csvFile {
    display: none;
}

.upload-hint {
    font-size: 0.85rem;
    color: #8892b0;
    margin-top: 0.5rem;
}

.uploaded-files {
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.uploaded-files.hidden {
    display: none;
}

.uploaded-files h3 {
    margin-bottom: 1rem;
    color: #64ffda;
}

.uploaded-files ul {
    list-style: none;
    margin-bottom: 1rem;
}

.uploaded-files li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uploaded-files li:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
}

.file-stats {
    font-size: 0.85rem;
    color: #8892b0;
}

.results {
    margin-top: 2rem;
}

.results.hidden {
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card h3 {
    font-size: 1rem;
    color: #8892b0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .amount {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: #8892b0;
    font-size: 0.9rem;
}

.stat-card.outgoing .amount {
    color: #ff6b6b;
}

.stat-card.incoming .amount {
    color: #64ffda;
}

.stat-card.vouchers .amount {
    color: #ffd93d;
}

.stat-card.pnp .amount {
    color: #00a651; /* PnP green */
}

.stat-card.clicks .amount {
    color: #0066b2; /* Clicks blue */
}

.stat-card.engen .amount {
    color: #ff6600; /* Engen orange */
}

.section-title {
    margin: 2rem 0 1rem;
    font-size: 1.4rem;
}

.ebucks-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.category-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-section h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.pnp-section { border-left: 4px solid #00a651; }
.clicks-section { border-left: 4px solid #0066b2; }
.engen-section { border-left: 4px solid #ff6600; }
.voucher-section { border-left: 4px solid #ffd93d; }

.collapsible-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.collapse-count {
    color: #8892b0;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.collapse-icon {
    color: #64ffda;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.collapsible-header.active .collapse-icon {
    transform: rotate(-180deg);
}

.collapsible-content {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.4s ease;
    margin-top: 1rem;
}

.collapsible-content.collapsed {
    max-height: 0;
    margin-top: 0;
}

.incoming-section { border-left: 4px solid #64ffda; }
.transactions-section { border-left: 4px solid #ff6b6b; }

.filter-badge {
    display: inline-block;
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: 600;
}

.date-filter {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.date-filter h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.date-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.date-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-group label {
    font-size: 0.85rem;
    color: #8892b0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.date-group input[type="date"] {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.date-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.btn-filter,
.btn-reset {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter {
    background: #64ffda;
    color: #1a1a2e;
}

.btn-filter:hover {
    background: #4cd9b7;
    transform: translateY(-2px);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

thead {
    background: rgba(255, 255, 255, 0.05);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    font-weight: 600;
    color: #8892b0;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

td {
    font-size: 0.95rem;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.amount-negative {
    color: #ff6b6b;
}

.amount-positive {
    color: #64ffda;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .stat-card .amount {
        font-size: 1.5rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}
