:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #22c55e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.main-wrapper {
    display: flex;
    height: 100%;
}

.sidebar {
    width: 300px;
    background-color: #fff;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.history-list {
    flex: 1;
}

.empty-history {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.history-item .status-icon {
    font-size: 1rem;
}

.history-item .progress-bar {
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.history-item .progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.history-item .status-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Adjust existing container to not be centered with margin auto */
.container form {
    width: 100%;
    max-width: 500px;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

header {
    margin-bottom: 2rem;
    text-align: center;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

input[type="date"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    background-color: #fff;
    transition: border-color 0.2s;
}

input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.upload-area .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.upload-area .or {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.5rem 0;
}

button#fileSelectBtn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 0.875rem;
}

button#fileSelectBtn:hover {
    text-decoration: underline;
}

.file-list {
    margin-bottom: 1.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.file-item .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 1rem;
}

.file-item .remove {
    color: var(--error-color);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.message-area {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    padding: 0.75rem;
    border-radius: 8px;
    display: none;
}

.message-area.error {
    display: block;
    background-color: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fee2e2;
}

.message-area.success {
    display: block;
    background-color: #f0fdf4;
    color: var(--success-color);
    border: 1px solid #dcfce7;
}

button[type="submit"] {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: var(--primary-hover);
}

button[type="submit"]:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/* Batch Grouping Styles */
.batch-group {
    margin-bottom: 1rem;
}

.batch-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    background-color: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    user-select: none;
}

.batch-header:hover {
    background-color: #e2e8f0;
}

.batch-header .arrow {
    margin-right: 0.5rem;
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.batch-header.collapsed .arrow {
    transform: rotate(-90deg);
}

.batch-content {
    padding-left: 0.5rem;
    display: block;
}

.batch-content.collapsed {
    display: none;
}

/* Batch Status Colors */
.batch-header.batch-completed {
    background-color: #dcfce7;
    /* Light Green */
    color: #166534;
}

.batch-header.batch-uploading {
    background-color: #fef9c3;
    /* Light Yellow */
    color: #854d0e;
}

.batch-header.batch-error {
    background-color: #fee2e2;
    /* Light Red */
    color: #991b1b;
}

/* Updated History Item Styles */
.history-item {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 0.75rem;
    /* Slightly reduced padding */
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.history-item .filename {
    font-weight: 500;
    font-size: 0.75rem;
    /* Smaller text */
    color: var(--text-secondary);
    /* Grayish color */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}