:root {
    --primary: #3B82F6;
    --primary-light: #EFF6FF;
    --primary-dark: #1D4ED8;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-900: #0F172A;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-popover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
}

button, input[type='button'], input[type='submit'] {
    cursor: pointer;
}

button:disabled, input[type='button']:disabled, input[type='submit']:disabled {
    cursor: not-allowed;
}

/* Filter Chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-chip:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.filter-chip.active {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.filter-chip svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    fill: currentColor;
    opacity: 0.7;
}

.filter-chip.active svg {
    opacity: 1;
}

.filter-chip .arrow {
    margin-left: 6px;
    margin-right: 0;
    width: 12px;
    height: 12px;
    opacity: 0.5;
}

.clear-filters {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    margin-left: auto;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.clear-filters:hover {
    background: var(--primary-light);
}

/* Popovers */
.popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-popover);
    border: 1px solid var(--gray-200);
    z-index: 1000;
    min-width: 280px;
    padding: 8px;
    margin-top: 8px;
    animation: popoverFade 0.2s ease-out;
}

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

.popover.show {
    display: block;
}

.popover-header {
    padding: 12px 12px 8px;
    font-size: 10px;
    font-weight: 800;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.popover-content {
    padding: 8px;
}

.search-box {
    position: relative;
    margin-bottom: 12px;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    color: var(--gray-900);
    transition: all 0.2s;
}

.search-box input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--gray-400);
}

.options-list {
    max-height: 240px;
    overflow-y: auto;
}

.option-item {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.1s;
}

.option-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.option-item.selected {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
}

/* Fancy Date Range Grid */
.fancy-date-grid {
    display: grid;
    gap: 12px;
}

.fancy-date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fancy-date-field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    padding-left: 4px;
}

.fancy-date-field input {
    width: 100%;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    color: var(--gray-900);
}

.fancy-date-field input:focus {
    background: white;
    border-color: var(--primary);
    outline: none;
}

/* Modal Overlay Styles (for legacy modals) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    padding: 32px;
    box-shadow: var(--shadow-popover);
}
