.apsd-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 20px 0;
    color: #333;
}

.apsd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.apsd-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
}

.apsd-period-selector {
    display: flex;
    background: #f1f3f5;
    border-radius: 8px;
    padding: 4px;
}

.apsd-period-selector button {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apsd-period-selector button:hover {
    color: #1a1a1a;
}

.apsd-period-selector button.active {
    background: #ffffff;
    color: #0056b3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.apsd-chart-wrapper {
    position: relative;
    height: 350px;
    margin-bottom: 32px;
    background: #fafbfa;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e9ecef;
}

.apsd-chart-loader {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666;
    border-radius: 8px;
    z-index: 10;
}

.apsd-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.apsd-list-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.apsd-badge-selected {
    background: #0056b3;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.apsd-reset-btn {
    background: #f8dbdb;
    color: #c92a2a;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.apsd-reset-btn:hover {
    background: #fdbdbd;
}

.apsd-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.apsd-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.apsd-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 5;
    user-select: none;
}

.apsd-table th.sortable {
    cursor: pointer;
    transition: background 0.2s;
}

.apsd-table th.sortable:hover {
    background: #e9ecef;
}

.sort-icon {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.3;
}

.apsd-table th.asc .sort-icon {
    border-bottom: 5px solid #0056b3;
    opacity: 1;
}

.apsd-table th.desc .sort-icon {
    border-top: 5px solid #0056b3;
    opacity: 1;
}

.apsd-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    color: #333;
}

.apsd-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.apsd-table tbody tr:hover {
    background: #f1f8ff;
}

.apsd-table tbody tr.active-row {
    background: #e7f5ff;
}

.apsd-table tbody tr.active-row td {
    font-weight: 500;
    color: #0056b3;
}
