* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

/* Server Link Setup */
#link-input-container {
    background: #16213e;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    z-index: 100;
}

#link-input-container h3 {
    margin-bottom: 16px;
    color: #00ffff;
}

#link-input-container input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #533483;
    background: #1a1a2e;
    color: #eee;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    transition: border 0.2s;
}

#link-input-container input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.3);
}

#link-input-container button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

#link-input-container button:hover {
    background: linear-gradient(135deg, #6d28d9, #1d4ed8);
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.4);
}

/* Main Container */
#main-container {
    width: 100%;
    max-width: 900px;
    animation: fadeIn 0.3s ease;
}

/* Top Bar */
#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0f3460, #1a1040);
    padding: 14px 20px;
    border-radius: 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(124, 58, 237, 0.15);
}

#top-bar h3 {
    color: #00ffff;
    font-size: 18px;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
}

#top-bar-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Selects */
#report-type, #chart-type, #sort-order {
    padding: 8px 12px;
    background: #1a1a2e;
    color: #eee;
    border: 1px solid #533483;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

#report-type:focus, #chart-type:focus, #sort-order:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.3);
}

#report-type option, #chart-type option, #sort-order option {
    background: #1a1a2e;
    color: #eee;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #533483;
    color: #eee;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #7c3aed;
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.3);
}

/* Summary Bar */
#summary-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.summary-item {
    flex: 1;
    background: #16213e;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(124, 58, 237, 0.15);
}

.summary-label {
    color: #888;
    font-size: 14px;
}

.summary-value {
    color: #00ffff;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.2);
}

/* Chart Card */
#chart-card {
    background: #16213e;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 8px 40px rgba(124, 58, 237, 0.12), 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(124, 58, 237, 0.15);
    position: relative;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#report-chart {
    max-height: 400px;
}

/* Breakdown Card */
#breakdown-card {
    background: #16213e;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(124, 58, 237, 0.15);
    animation: fadeIn 0.4s ease;
}

#breakdown-card h4 {
    padding: 14px 20px;
    color: #00ffff;
    font-size: 15px;
    background: linear-gradient(135deg, #0f3460, #1a1040);
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #7c3aed, #00ffff) 1;
}

#breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

#breakdown-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(15, 52, 96, 0.3);
}

#breakdown-table td {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
    transition: background 0.2s;
}

#breakdown-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.08);
}

#breakdown-table tbody tr:last-child td {
    border-bottom: none;
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.breakdown-label {
    color: #eee;
    font-weight: 500;
}

.breakdown-amount {
    color: #00ffff;
    font-weight: bold;
}

.breakdown-count {
    color: #888;
}

.breakdown-percent {
    color: #a78bfa;
    font-weight: bold;
}

/* Empty Message */
#empty-msg {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

#empty-msg strong {
    color: #00ffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7c3aed, #533483);
    border-radius: 3px;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    #top-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    #top-bar-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    #summary-bar {
        flex-direction: column;
    }

    .summary-item {
        padding: 12px 14px;
    }

    .summary-value {
        font-size: 16px;
    }

    #chart-card {
        padding: 12px;
        min-height: 220px;
    }

    /* Breakdown Table → Card Layout */
    #breakdown-card {
        background: transparent;
        box-shadow: none;
        border: none;
    }

    #breakdown-card h4 {
        border-radius: 10px;
        margin-bottom: 10px;
    }

    #breakdown-table thead {
        display: none;
    }

    #breakdown-table tbody tr {
        display: block;
        background: #16213e;
        border: 1px solid rgba(124, 58, 237, 0.15);
        border-radius: 12px;
        margin-bottom: 10px;
        padding: 14px 16px;
    }

    #breakdown-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border-bottom: 1px solid rgba(124, 58, 237, 0.06);
        font-size: 13px;
    }

    #breakdown-table td:last-child {
        border-bottom: none;
    }

    #breakdown-table td::before {
        content: attr(data-label);
        font-size: 11px;
        color: #888;
        font-weight: 600;
        text-transform: uppercase;
    }
}
