:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.auth-title { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.auth-subtitle { color: var(--gray); text-align: center; margin-bottom: 30px; }

.form-group { margin-bottom: 20px; }

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    width: 100%;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-secondary { background: var(--gray-light); color: var(--dark); }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}
.message.show { display: block; }
.message.success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.message.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.error-message { 
    padding: 12px 16px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    background: #fee2e2; 
    color: #991b1b; 
    border: 1px solid #fecaca; 
}
.success-message { 
    padding: 12px 16px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    background: #d1fae5; 
    color: #065f46; 
    border: 1px solid #a7f3d0; 
}

.auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.auth-header p { color: var(--gray); }
.auth-form .form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--dark); }
.auth-footer { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray-light); }
.auth-footer p { color: var(--gray); font-size: 14px; }

.auth-links { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray-light); }
.auth-links p { color: var(--gray); font-size: 14px; margin-bottom: 8px; }

.dashboard-container { min-height: 100vh; background: var(--light); }

.dashboard-header {
    background: var(--white);
    padding: 20px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 { font-size: 24px; }
.header-actions { display: flex; gap: 12px; }
.dashboard-content { padding: 30px; max-width: 1400px; margin: 0 auto; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    font-size: 16px;
}

.stat-icon { font-size: 36px; }
.stat-info .stat-label { color: var(--gray); font-size: 13px; text-transform: uppercase; }
.stat-info .stat-value { font-size: 16px; font-weight: 700; }

.table-container { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-light); display: flex; justify-content: space-between; align-items: center; }
.table-header h2 { font-size: 18px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--gray-light); }
.data-table th { background: var(--light); font-weight: 600; font-size: 13px; text-transform: uppercase; }
.data-table tr:hover { background: var(--light); }

.action-buttons { display: flex; gap: 8px; }

.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, #0ea5e9 100%);
    color: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}
.welcome-card h2 { font-size: 28px; margin-bottom: 8px; }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content.wide { max-width: 1000px; }

.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-light); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--gray); cursor: pointer; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-light); display: flex; justify-content: flex-end; gap: 12px; }

.filter-bar {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid var(--primary);
    flex-wrap: nowrap;
    align-items: center;
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--white);
    flex-shrink: 0;
    padding: 8px 10px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--gray-light);
}

.filter-group label { font-size: 13px; color: var(--primary); font-weight: 600; white-space: nowrap; }

.filter-select, .filter-input {
    padding: 6px 5px;
    border: none;
    border-radius: 16px;
    font-size: 13px;
    min-width: 120px;
    background: var(--light);
}

.filter-input[type="date"] {
    min-width: 130px;
}

.filter-select:focus, .filter-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }

.sort-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.sort-btn:hover { transform: translateY(-2px); }

.clear-filter-btn {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.file-input { width: 100%; padding: 12px; border: 2px dashed var(--gray-light); border-radius: 8px; }
.file-info { margin-top: 8px; font-size: 13px; color: var(--gray); }
.column-info { margin-top: 12px; padding: 12px; background: var(--light); border-radius: 6px; font-size: 13px; }

.loading { text-align: center; padding: 40px; color: var(--gray); }
.spinner { display: inline-block; width: 40px; height: 40px; border: 3px solid var(--gray-light); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.no-data { text-align: center; padding: 40px; color: var(--gray); }

.excel-table-wrapper { overflow-x: auto; }
.excel-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.excel-table th, .excel-table td { padding: 10px 14px; text-align: left; border: 1px solid var(--gray-light); white-space: nowrap; }
.excel-table th { background: var(--primary); color: var(--white); font-weight: 600; }
.excel-table tr:nth-child(even) { background: var(--light); }
.excel-table tr:hover { background: #e0e7ff; }
.data-info { padding: 12px 16px; text-align: right; font-size: 13px; color: var(--gray); }

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--gray-light);
    background: var(--light);
    flex-wrap: wrap;
    gap: 10px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-light);
    background: var(--white);
    color: var(--dark);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    padding: 0 8px;
    color: var(--gray);
}

.page-info {
    padding: 0 12px;
    color: var(--gray);
    font-size: 14px;
}

@media (max-width: 768px) {
    .dashboard-header { flex-direction: column; gap: 16px; }
    .header-actions { width: 100%; justify-content: center; }
    .filter-bar { flex-direction: column; }
    .filter-group { width: 100%; }
    .filter-select, .filter-input { flex: 1; min-width: 0; }
}

