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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.password-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.password-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section h1 {
    color: #4a5568;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.logo-section h2 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.logo-section p {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#password-input {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

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

#login-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.error-message {
    color: #e53e3e;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.main-dashboard {
    min-height: 100vh;
    background: #f7fafc;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.company-name {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 500;
}

#logout-btn {
    padding: 0.5rem 1.5rem;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

#logout-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

.upload-section {
    padding: 2rem;
    background: white;
    margin: 1rem 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

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

.upload-area h3 {
    color: #2d3748;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: #718096;
    margin-bottom: 1.5rem;
}

#file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

#browse-btn {
    padding: 0.8rem 2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

#browse-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.download-sample-btn {
    padding: 0.8rem 2rem;
    background: #38a169;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-sample-btn:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    color: #22543d;
    display: none;
}

.controls-section {
    padding: 1.5rem 2rem;
    background: white;
    margin: 0 2rem 1rem 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.controls-container {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-controls {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    min-width: 300px;
}

#search-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

#search-btn {
    padding: 0.8rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#search-btn:hover {
    background: #5a67d8;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls select {
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-controls select:focus {
    outline: none;
    border-color: #667eea;
}

#exclude-input {
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 200px;
}

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

#exclude-btn {
    padding: 0.8rem 1.5rem;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

#exclude-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

#export-btn, #toggle-view-btn {
    padding: 0.8rem 1.5rem;
    background: #38a169;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

#export-btn:hover, #toggle-view-btn:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

#toggle-view-btn {
    background: #805ad5;
}

#toggle-view-btn:hover {
    background: #6b46c1;
}

.stats-section {
    padding: 1.5rem 2rem;
    margin: 0 2rem 1rem 2rem;
}

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

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.3s ease;
}

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

.stat-card h3 {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card span {
    color: #2d3748;
    font-size: 2rem;
    font-weight: 700;
}

.results-section {
    flex: 1;
    padding: 1.5rem 2rem;
    margin: 0 2rem 2rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.charts-section {
    padding: 1.5rem 2rem;
    margin: 0 2rem 2rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f7fafc;
}

.results-header h3 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
}

.pagination-info {
    color: #718096;
    font-size: 0.9rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

#results-table th {
    background: #f7fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

#results-table th:hover {
    background: #edf2f7;
}

.sort-arrow {
    margin-left: 0.5rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

#results-table th.sorted .sort-arrow {
    opacity: 1;
    color: #667eea;
}

#results-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

#results-table tr:hover {
    background: #f8fafc;
}

.suspicious-row {
    background: rgba(245, 101, 101, 0.05);
    border-left: 4px solid #f56565;
}

.suspicious-row:hover {
    background: rgba(245, 101, 101, 0.1);
}

.suspicion-type {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suspicion-high-volume {
    background: #fed7d7;
    color: #c53030;
}

.suspicion-multiple-sources {
    background: #feebc8;
    color: #c05621;
}

.suspicion-cli-anomaly {
    background: #e6fffa;
    color: #234e52;
}

.suspicion-cli-manipulation {
    background: #e9d8fd;
    color: #553c9a;
}

.suspicion-inter-customer {
    background: #fefcbf;
    color: #744210;
}

.suspicion-client-pattern {
    background: #fef5e7;
    color: #c05621;
}

.suspicion-time-pattern {
    background: #e6fffa;
    color: #234e52;
}

.details-cell {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.4;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

#prev-page, #next-page {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#prev-page:hover, #next-page:hover {
    background: #5a67d8;
}

#prev-page:disabled, #next-page:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

#page-info {
    color: #4a5568;
    font-weight: 500;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.chart-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.chart-card canvas {
    max-height: 300px;
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .controls-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-controls {
        min-width: auto;
    }
    
    .filter-controls {
        justify-content: center;
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .password-container {
        padding: 2rem;
    }
    
    .upload-area {
        padding: 2rem;
    }
    
    #results-table {
        font-size: 0.85rem;
    }
    
    #results-table th,
    #results-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .main-dashboard {
        margin: 0;
    }
    
    .upload-section,
    .controls-section,
    .results-section,
    .stats-section,
    .charts-section {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .dashboard-header {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-card span {
        font-size: 1.5rem;
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

* {
    transition: all 0.3s ease;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

