* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ececec 0%, #fff 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.controls {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: #232c77;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e6ed;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.filter-btn:hover, .filter-btn.active {
    background: #232c77;
    color: white;
    border-color: #232c77;
    transform: translateY(-2px);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2rem;
    color: #232c77;
    margin-bottom: 10px;
}

.stat-card h3 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-card p {
    color: #7f8c8d;
}

.table-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.table-title {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    padding-bottom: 15px;
    border-bottom: 3px solid #232c77;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background: white;
}

th {
    background: linear-gradient(135deg, #232c77, #232c77);
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #e0e6ed;
    vertical-align: top;
    font-size: 13px;
}

tr:hover {
    background: #f8f9ff;
}

.branch-header {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    color: white !important;
    font-weight: bold;
    text-align: center;
    font-size: 16px;
}

.event-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.event-type.kpo {
    background: #e8f5e8;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.event-type.dpo {
    background: #fff3cd;
    color: #f39c12;
    border: 1px solid #f39c12;
}

.event-type.ot {
    background: #f8d7da;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.quarter-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin: 2px;
}

.quarter-1 { background: #e3f2fd; color: #1976d2; }
.quarter-2 { background: #e8f5e8; color: #388e3c; }
.quarter-3 { background: #fff3e0; color: #f57c00; }
.quarter-4 { background: #fce4ec; color: #c2185b; }
.quarter-year { background: #f3e5f5; color: #7b1fa2; }

.footnote {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 12px;
    color: #6c757d;
    border-left: 4px solid #232c77;
}

.mobile-card {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #232c77;
}

.mobile-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.mobile-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.mobile-card-info div {
    font-size: 12px;
}

.mobile-card-info strong {
    color: #232c77;
}

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #232c77, #232c77);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 18px;
}

.export-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: auto;
    }

    .filter-group {
        justify-content: center;
    }

    .table-wrapper {
        display: none;
    }

    .mobile-card {
        display: block;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .mobile-card-info {
        grid-template-columns: 1fr;
    }

    .filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}