/* ============================================================
   NET-DENET — Style System
   Mali Belge İşleme Platformu
   ============================================================ */

/* ----- Custom Properties ----- */
:root {
    /* Background layers */
    --bg-primary: #0f1724;
    --bg-secondary: #141d2e;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2b3d;
    --bg-input: #141d2e;
    --bg-elevated: #222f42;

    /* Accent colors */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-muted: rgba(59, 130, 246, 0.15);
    --accent-glow: rgba(59, 130, 246, 0.25);

    /* Status colors */
    --color-success: #22c55e;
    --color-success-bg: rgba(34, 197, 94, 0.12);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    --color-error: #ef4444;
    --color-error-bg: rgba(239, 68, 68, 0.12);
    --color-info: #3b82f6;
    --color-info-bg: rgba(59, 130, 246, 0.12);
    --color-processing: #6366f1;
    --color-processing-bg: rgba(99, 102, 241, 0.12);

    /* Card accent colors */
    --card-blue: #3b82f6;
    --card-emerald: #10b981;
    --card-amber: #f59e0b;
    --card-rose: #f43f5e;

    /* Text */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    /* Borders */
    --border: #1e293b;
    --border-light: #334155;
    --border-focus: #3b82f6;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Layout */
    --navbar-height: 64px;
    --content-max-width: 1200px;
    --sidebar-width: 260px;
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background-color: var(--accent);
    color: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

.text-accent { color: var(--accent); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--navbar-height);
    background: rgba(15, 23, 36, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.navbar-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.navbar-brand:hover {
    color: var(--text-primary);
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    color: #fff;
}

.brand-text {
    letter-spacing: -0.5px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-left: var(--space-lg);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-muted);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-left: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Mobile toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.navbar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all var(--transition-fast);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    padding: calc(var(--navbar-height) + var(--space-xl)) var(--space-lg) var(--space-2xl);
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
}

.main-content--no-nav {
    padding-top: 0;
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-container {
    position: fixed;
    top: calc(var(--navbar-height) + var(--space-md));
    right: var(--space-lg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 420px;
    width: 100%;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid;
    backdrop-filter: blur(12px);
    animation: slideInRight 0.35s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.flash-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.flash-icon {
    flex-shrink: 0;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0 0 var(--space-md);
    line-height: 1;
    transition: opacity var(--transition-fast);
}

.flash-close:hover {
    opacity: 1;
}

.flash-success {
    background: var(--color-success-bg);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--color-success);
}

.flash-error {
    background: var(--color-error-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--color-error);
}

.flash-warning {
    background: var(--color-warning-bg);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--color-warning);
}

.flash-info {
    background: var(--color-info-bg);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--color-info);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-glow);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline:hover:not(:disabled) {
    background: var(--accent-muted);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--color-error);
    color: #fff;
    border-color: var(--color-error);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.btn-block {
    width: 100%;
}

.btn-spinner {
    animation: spin 1s linear infinite;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: all var(--transition-fast);
}

.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-secondary);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    position: relative;
    z-index: 1;
    animation: fadeIn 0.5s ease;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: var(--radius-md);
    color: #fff;
    margin-bottom: var(--space-md);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: var(--space-xs);
}

.login-error {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--color-error);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
    animation: shake 0.4s ease;
}

.login-form {
    margin-bottom: var(--space-lg);
}

.login-footer {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.login-footer p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent);
    font-weight: 500;
}

.login-bg-pattern {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, var(--accent-muted) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.welcome-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.header-stats {
    display: flex;
    gap: var(--space-sm);
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stat-dot--processing {
    background: var(--color-processing);
    box-shadow: 0 0 6px var(--color-processing);
    animation: pulse 2s infinite;
}

.stat-dot--done {
    background: var(--color-success);
}

.section {
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-header .section-title {
    margin-bottom: 0;
}

/* Job Type Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.job-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.job-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.job-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.job-card:hover .job-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.job-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.job-card-icon--blue {
    background: rgba(59, 130, 246, 0.12);
    color: var(--card-blue);
}

.job-card-icon--emerald {
    background: rgba(16, 185, 129, 0.12);
    color: var(--card-emerald);
}

.job-card-icon--amber {
    background: rgba(245, 158, 11, 0.12);
    color: var(--card-amber);
}

.job-card-icon--rose {
    background: rgba(244, 63, 94, 0.12);
    color: var(--card-rose);
}

.job-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.job-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
}

.job-card-arrow {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-8px);
    transition: all var(--transition-base);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead {
    background: var(--bg-secondary);
}

.table th {
    padding: 0.875rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 0.875rem 1.25rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.01);
}

.table tbody tr:nth-child(even):hover {
    background: var(--bg-card-hover);
}

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

.table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    gap: var(--space-md);
}

.table-empty p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.table-empty-row:hover {
    background: transparent !important;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-pending {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-pending .badge-dot {
    background: var(--color-warning);
}

.badge-processing {
    background: var(--color-processing-bg);
    color: var(--color-processing);
}

.badge-processing .badge-dot {
    background: var(--color-processing);
    animation: pulse 1.5s infinite;
}

.badge-done {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-done .badge-dot {
    background: var(--color-success);
}

.badge-error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.badge-error .badge-dot {
    background: var(--color-error);
}

/* ============================================================
   UPLOAD PAGE
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb-link {
    color: var(--text-secondary);
}

.breadcrumb-link:hover {
    color: var(--accent);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

.upload-header {
    margin-bottom: var(--space-2xl);
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.upload-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.upload-subtitle strong {
    color: var(--text-primary);
    font-weight: 500;
}

.upload-content {
    max-width: 720px;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-card);
    position: relative;
}

.dropzone:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
}

.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-muted);
    border-style: solid;
    box-shadow: var(--shadow-glow);
}

.dropzone.dragover .dropzone-icon {
    transform: scale(1.1) translateY(-4px);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.dropzone-icon {
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    transition: transform var(--transition-base);
}

.dropzone-text {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dropzone-subtext {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.dropzone-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* File list */
.file-list-container {
    margin-top: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.file-list-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

.file-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.2s ease;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-item-icon--xlsx {
    background: rgba(16, 185, 129, 0.12);
    color: var(--card-emerald);
}

.file-item-icon--csv {
    background: rgba(59, 130, 246, 0.12);
    color: var(--card-blue);
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    display: flex;
    transition: all var(--transition-fast);
}

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

.file-list-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Upload Progress */
.upload-progress {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.progress-percent {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    height: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

.progress-detail {
    margin-top: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Upload Status */
.upload-status {
    margin-top: var(--space-lg);
    padding: var(--space-2xl);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.status-icon {
    margin-bottom: var(--space-md);
}

.status-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.status-message {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
}

.status-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

/* Upload actions */
.upload-actions {
    margin-top: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================================
   JOBS PAGE
   ============================================================ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.page-header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.jobs-filters {
    display: flex;
    align-items: flex-end;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-spacer {
    flex: 1;
}

.filter-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding-bottom: var(--space-sm);
}

.error-link {
    color: var(--color-error);
    cursor: pointer;
    font-size: 0.75rem;
    text-decoration: underline;
    background: none;
    border: none;
    font-family: inherit;
}

.error-link:hover {
    color: #f87171;
}

/* Load More */
.load-more-container {
    text-align: center;
    padding: var(--space-xl) 0;
}

/* Auto Refresh Bar */
.auto-refresh-bar {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
}

.auto-refresh-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-lg);
}

.auto-refresh-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--space-lg);
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.error-detail {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.8125rem;
    color: var(--color-error);
    background: var(--color-error-bg);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    border-top: 1px solid var(--border);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
}

.footer-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.footer p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-sub {
    margin-top: var(--space-xs);
    font-size: 0.75rem !important;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease both;
}

.animate-slide-up {
    animation: slideUp 0.5s ease both;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .navbar-links {
        display: none;
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: var(--space-sm);
        z-index: 999;
    }

    .navbar-links.open {
        display: flex;
    }

    .nav-link {
        padding: var(--space-md);
    }

    .user-name {
        display: none;
    }

    .logout-text {
        display: none;
    }

    .navbar-toggle {
        display: flex;
    }

    .main-content {
        padding: calc(var(--navbar-height) + var(--space-md)) var(--space-md) var(--space-xl);
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
    }

    .header-stats {
        width: 100%;
    }

    .stat-pill {
        flex: 1;
        justify-content: center;
    }

    .page-header {
        flex-direction: column;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
    }

    .jobs-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-spacer {
        display: none;
    }

    .upload-actions {
        flex-direction: column-reverse;
        gap: var(--space-sm);
    }

    .upload-actions .btn {
        width: 100%;
    }

    .table th, .table td {
        padding: 0.75rem;
    }

    .flash-container {
        right: var(--space-sm);
        left: var(--space-sm);
        max-width: none;
        top: calc(var(--navbar-height) + var(--space-sm));
    }

    .login-card {
        padding: var(--space-xl);
    }

    .auto-refresh-content {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .job-card {
        padding: var(--space-lg);
    }

    .dropzone {
        padding: var(--space-xl) var(--space-md);
    }

    .file-item {
        padding: var(--space-sm) var(--space-md);
    }

    .welcome-text h1 {
        font-size: 1.25rem;
    }
}

/* High resolution screens */
@media (min-width: 1400px) {
    :root {
        --content-max-width: 1320px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
