:root {
    --primary: #a546e5;
    --primary-hover: #4338CA;
    --secondary: #E5E7EB;
    --secondary-hover: #D1D5DB;
    --danger: #EF4444;
    --danger-hover: #DC2626;
    --success: #10B981;
    --bg-main: #F3F4F6;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.text-danger {
    color: var(--danger) !important;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.sidebar-nav {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}

.nav-link {
    padding: 12px 24px;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: var(--bg-main);
    text-decoration: none;
}

.main-content {
    flex: 1;
    padding: 32px;
    overflow-x: auto;
}

/* Auth */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    position: absolute;
    top: 0;
    left: 0;
}

.login-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.login-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.btn-icon:hover {
    background: #FEE2E2;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 0.875rem;
}

.alert-danger {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #F87171;
}

.alert-success {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #34D399;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.dashboard-header p {
    color: var(--text-muted);
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    transition: all 0.2s;
    color: inherit;
}

.file-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.file-icon {
    background: #EEF2FF;
    color: var(--primary);
    padding: 12px;
    border-radius: var(--radius);
    margin-right: 16px;
}

.file-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
}

.view-btn {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

/* Edit CSV */
.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.back-link {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.back-link:hover {
    color: var(--primary);
}

.edit-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.edit-actions {
    display: flex;
    gap: 12px;
}

.table-responsive {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
    box-shadow: var(--shadow);
}

.csv-table {
    width: 100%;
    border-collapse: collapse;
}

.csv-table td {
    padding: 8px;
    border: 1px solid var(--border);
    min-width: 120px;
}

.csv-table .row-actions {
    min-width: auto;
    width: 40px;
    text-align: center;
    background: #F9FAFB;
}

.table-input {
    width: 100%;
    border: 1px solid transparent;
    padding: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.table-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #F9FAFB;
}

.table-input:hover {
    border-color: var(--border);
}