:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 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);
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
    line-height: 1.5;
}

.app-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.app-header {
    text-align: center;
    animation: fadeInDown 0.6s ease-out;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: transparent;
    background: linear-gradient(to right, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.controls-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.control-row .control-group {
    flex: 1 1 100%;
}
@media (min-width: 640px) {
    .control-row .control-group {
        flex: 1;
    }
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

label {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
}

.text-sm {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

input[type="file"],
input[type="date"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

input[type="file"]:hover,
input[type="date"]:hover {
    border-color: var(--primary-color);
}

input[type="file"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.primary-btn {
    position: relative;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.results-section {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s ease-out;
}

.hidden {
    display: none !important;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.pill {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.9rem;
}

.pill strong {
    font-size: 1.1rem;
    font-weight: 600;
}

.summary-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.secondary-btn {
    background: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.primary-btn.loading {
    color: transparent;
    pointer-events: none;
}

.primary-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fff;
}

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

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f1f5f9;
}

tbody tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
