:root {
    --rose: #dba29e;
    --rose-deep: #d3816b;
    --rose-pale: #fff0ec;
    --rose-ghost: #fdf8f7;
    --cream: #fefefe;
    --charcoal: #212121;
    --graphite: #444444;
    --silver: #777777;
    --mist: #f4f4f4;
    --white: #ffffff;
    --error: #c44b4b;
    --error-bg: #fdf2f2;
    --success: #3d7a3d;
    --success-bg: #f0f8f0;
    --warning: #9a7b2c;
    --warning-bg: #fdf8ed;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 64px rgba(0,0,0,0.08);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Raleway', -apple-system, sans-serif;
    background: var(--cream);
    color: var(--charcoal);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeDown 0.8s ease;
}

.logo-mark {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose), var(--rose-deep));
    box-shadow: 0 4px 16px rgba(219, 162, 158, 0.4);
}

.header h1 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--charcoal);
}

.header h1 em {
    font-style: italic;
    color: var(--rose);
}

.subtitle {
    margin-top: 0.5rem;
    color: var(--silver);
    font-size: 1.05rem;
    font-weight: 300;
}

/* Auth */
.auth-section {
    animation: fadeUp 0.6s ease 0.2s both;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--mist);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.auth-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--silver);
    margin-bottom: 0.75rem;
}

.input-row {
    display: flex;
    gap: 0.75rem;
}

.input-row input {
    flex: 1;
    padding: 0.85rem 1.2rem;
    border: 1.5px solid var(--mist);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--rose-ghost);
    transition: var(--transition);
    outline: none;
}

.input-row input:focus {
    border-color: var(--rose);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(219, 162, 158, 0.15);
}

.auth-error {
    margin-top: 0.75rem;
    color: var(--error);
    font-size: 0.9rem;
    min-height: 1.4rem;
}

/* Buttons */
.btn-primary {
    padding: 0.85rem 1.8rem;
    background: var(--rose);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--rose-deep);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(211, 129, 107, 0.35);
}

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

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--rose);
    border: 1.5px solid var(--rose);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--rose-ghost);
}

.link-btn {
    background: none;
    border: none;
    color: var(--rose);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-family: inherit;
    font-size: inherit;
}

/* Dropzone */
.upload-section {
    animation: fadeUp 0.5s ease;
}

.dropzone {
    position: relative;
    border: 2px dashed var(--mist);
    border-radius: var(--radius);
    padding: 3.5rem 2rem;
    text-align: center;
    background: var(--white);
    transition: var(--transition);
    cursor: pointer;
    overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--rose);
    background: var(--rose-ghost);
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

.dropzone.dragover .dropzone-content { opacity: 0.3; }
.dropzone.dragover .dropzone-hover { opacity: 1; transform: scale(1); }

.dropzone-content {
    transition: var(--transition);
}

.dropzone-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.95);
    transition: var(--transition);
    background: rgba(74, 103, 65, 0.05);
    border-radius: var(--radius);
}

.dropzone-hover p {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--rose);
}

.drop-icon {
    color: var(--rose);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.drop-text {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--graphite);
    margin-bottom: 0.4rem;
}

.drop-subtext {
    font-size: 0.9rem;
    color: var(--silver);
}

/* File list */
.file-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--white);
    border: 1px solid var(--mist);
    border-radius: var(--radius-sm);
    animation: slideIn 0.3s ease;
    transition: var(--transition);
}

.file-item:hover {
    box-shadow: var(--shadow-sm);
}

.file-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge-cogs { background: #e8f5e9; color: #2e7d32; }
.badge-timeclock { background: #e3f2fd; color: #1565c0; }
.badge-sales { background: #fff8e1; color: #f57f17; }
.badge-unknown { background: #fce4ec; color: #c62828; }

.file-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--graphite);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 0.8rem;
    color: var(--silver);
}

.file-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--silver);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
}

.file-remove:hover {
    background: var(--error-bg);
    color: var(--error);
}

/* Actions */
.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--mist);
}

.file-count {
    font-size: 0.9rem;
    color: var(--silver);
}

.btn-import {
    padding: 1rem 2.5rem;
    font-size: 1rem;
}

.btn-label, .btn-loading { display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-loading.hidden, .btn-label.hidden { display: none; }

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Results */
.results-section {
    animation: fadeUp 0.5s ease;
}

.results-section h2 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.result-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--white);
    border: 1px solid var(--mist);
    border-radius: var(--radius-sm);
    animation: slideIn 0.3s ease;
}

.result-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-success { background: var(--success); }
.status-warning { background: var(--warning); }
.status-error { background: var(--error); }

.result-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.result-filename {
    font-size: 0.9rem;
    font-weight: 500;
}

.result-detail {
    font-size: 0.8rem;
    color: var(--silver);
}

.result-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.results-summary {
    padding: 1.5rem;
    background: var(--rose-ghost);
    border: 1px solid var(--rose-pale);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.8;
}

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 3rem;
    text-align: center;
}

.footer p {
    font-size: 0.8rem;
    color: var(--silver);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Utilities */
.hidden { display: none !important; }

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

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 2rem 1rem; }
    .dropzone { padding: 2.5rem 1.5rem; }
    .input-row { flex-direction: column; }
    .actions { flex-direction: column; gap: 1rem; align-items: stretch; text-align: center; }
    .btn-import { width: 100%; }
    .file-item { padding: 0.8rem 1rem; }
    .result-item { grid-template-columns: auto 1fr; }
    .result-badge { display: none; }
}
