:root {
    --primary: #4F46E5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e0e7ff 100%);
    --card-bg: rgba(255, 255, 255, 0.98);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
}

/* Helpers */
.hidden { display: none !important; }
.mt-20 { margin-top: 20px; }
.fade-in { animation: fadeIn 0.4s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.center { justify-content: center; text-align: center; }

/* Navbar */
.navbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { 
    font-size: 1.3rem; 
    font-weight: 700; 
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.version {
    font-size: 0.7rem;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.nav-user { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    font-weight: 500; 
}
.btn-icon { 
    background: none; 
    border: none; 
    font-size: 1.2rem; 
    cursor: pointer; 
    color: var(--secondary);
    transition: 0.2s;
}
.btn-icon:hover { color: var(--primary); }

/* Layout */
.main-wrapper { max-width: 100%; overflow-x: hidden; }
.container { max-width: 1600px; margin: 30px auto; padding: 0 20px; }

/* Cards & Panels */
.auth-box { 
    max-width: 420px; 
    margin: 60px auto; 
    background: white; 
    padding: 40px; 
    border-radius: 20px; 
    box-shadow: var(--shadow-lg); 
}
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h1 { margin: 0 0 10px 0; color: #1f2937; }
.auth-header p { color: #6b7280; margin: 0; }

.panel { 
    background: var(--card-bg); 
    border-radius: 20px; 
    box-shadow: var(--shadow); 
    border: var(--glass-border); 
    padding: 30px; 
    min-height: 500px; 
}
.panel-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
}
.panel-header h2 { margin: 0; display: flex; align-items: center; gap: 10px; }

.card { 
    background: white; 
    padding: 25px; 
    border-radius: 12px; 
    box-shadow: var(--shadow-sm); 
    border: 1px solid #f3f4f6;
}
.card h3 { margin: 0 0 20px 0; color: #374151; font-size: 1.1rem; }

/* Dashboard Grid */
.dashboard-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; 
    margin-top: 40px; 
    padding: 20px; 
}
.dash-card { 
    background: white; 
    border: 2px solid #eef2ff; 
    border-radius: 20px; 
    padding: 40px 25px; 
    text-align: center; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(79, 70, 229, 0.03) 100%);
    opacity: 0;
    transition: 0.3s;
}
.dash-card:hover::before { opacity: 1; }
.dash-card:hover { 
    transform: translateY(-8px); 
    border-color: var(--primary); 
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.15); 
}
.icon-box { 
    width: 90px; 
    height: 90px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 40px; 
    margin: 0 auto 20px;
    position: relative;
    z-index: 1;
}
.icon-box.blue { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); color: var(--primary); }
.icon-box.green { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); color: var(--success); }
.dash-card h3 { margin: 10px 0; color: #1f2937; font-size: 1.3rem; position: relative; z-index: 1; }
.dash-card p { color: #6b7280; margin: 0; font-size: 14px; line-height: 1.6; position: relative; z-index: 1; }

/* Forms */
.input-group { position: relative; margin-bottom: 20px; }
.input-icon { position: absolute; left: 15px; top: 14px; color: #9ca3af; z-index: 1; }
.input-group input { 
    width: 100%; 
    padding: 12px 12px 12px 40px; 
    border: 2px solid #e5e7eb; 
    border-radius: 10px; 
    outline: none; 
    transition: all 0.3s; 
    font-size: 14px; 
    font-family: inherit;
}
.input-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }

.voen-input-container { 
    max-width: 450px; 
    margin: 20px auto; 
    text-align: left; 
}
.voen-input-container label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    font-size: 14px; 
    color: #374151; 
}

.inline-form { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}
.inline-form input { 
    flex: 1; 
    padding: 10px 15px; 
    border: 2px solid #e5e7eb; 
    border-radius: 8px; 
    outline: none;
    font-family: inherit;
}
.inline-form input:focus { border-color: var(--primary); }

/* Buttons */
.btn { 
    padding: 12px 24px; 
    border-radius: 10px; 
    border: none; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    font-family: inherit;
    font-size: 14px;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-block { width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-primary { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
    color: white; 
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover:not(:disabled) { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}
.btn-success { 
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%); 
    color: white; 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-success:hover:not(:disabled) { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}
.btn-outline { 
    background: white; 
    border: 2px solid #e5e7eb; 
    color: #374151; 
}
.btn-outline:hover { 
    background: #f9fafb; 
    border-color: var(--primary);
    color: var(--primary);
}
.btn-back { 
    margin-bottom: 20px; 
    background: none; 
    border: none; 
    cursor: pointer; 
    font-size: 15px; 
    color: #6b7280; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: 0.2s;
    font-weight: 500;
}
.btn-back:hover { 
    background: #f3f4f6;
    color: var(--primary); 
}

/* Upload Area */
.upload-area { 
    border: 3px dashed #c7d2fe; 
    border-radius: 20px; 
    padding: 60px 30px; 
    text-align: center; 
    background: linear-gradient(135deg, #fdfeff 0%, #f5f7ff 100%); 
    transition: 0.3s; 
}
.upload-area:hover { 
    border-color: var(--primary); 
    background: linear-gradient(135deg, #fdfeff 0%, #eef2ff 100%); 
}
.icon-circle { 
    width: 100px; 
    height: 100px; 
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); 
    color: var(--primary); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 40px; 
    margin: 0 auto 25px; 
}
.upload-content h3 { 
    margin: 10px 0; 
    color: #1f2937; 
    font-size: 1.5rem;
}
.upload-content p { 
    color: #6b7280; 
    margin: 0 0 20px 0; 
}
.file-tag { 
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); 
    color: #047857; 
    padding: 12px 24px; 
    border-radius: 25px; 
    display: inline-flex; 
    align-items: center; 
    gap: 10px; 
    margin-top: 20px; 
    font-weight: 600; 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Sheet Preview Stage */
.stage-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
}
.stage-header h2 {
    margin: 0 0 10px 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.6rem;
}
.stage-header p {
    color: #6b7280;
    margin: 0;
    font-size: 1rem;
}

.sheet-workspace {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: 700px;
    margin-bottom: 20px;
}

/* Sheet Selection Sidebar */
.sheet-selection-sidebar {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    padding: 16px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #374151;
    font-weight: 600;
}

.checkbox-label-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label-inline input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.sheets-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.sheet-group-header {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 8px 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sheet-group-header i {
    font-size: 12px;
    color: var(--primary);
}

.sheet-item {
    background: white;
    border: 2px solid #f3f4f6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sheet-item:hover {
    border-color: #e0e7ff;
    background: #fafbff;
}

.sheet-item.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.sheet-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    color: white;
}

.sheet-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sheet-item-content {
    flex: 1;
    min-width: 0;
}

.sheet-item-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sheet-item-info {
    font-size: 11px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-footer {
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.selected-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
    font-weight: 600;
    font-size: 13px;
}

/* Sheet Preview Main */
.sheet-preview-main {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.preview-toolbar {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-title i {
    color: var(--success);
    font-size: 1.4rem;
}

.preview-title h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
}

.preview-controls {
    display: flex;
    gap: 10px;
}

.btn-tool {
    padding: 8px 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-tool:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f5f7ff;
}

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

.sheet-preview-content {
    flex: 1;
    overflow: auto;
    position: relative;
}

.empty-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
}

.empty-preview i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #d1d5db;
}

.empty-preview p {
    margin: 0;
    font-size: 1rem;
}

/* Sheet Table */
.sheet-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.sheet-table thead th {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    border-bottom: 2px solid #e5e7eb;
}

.sheet-table tbody td {
    padding: 10px;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
    color: #4b5563;
}

.sheet-table tbody tr:hover {
    background: #f9fafb;
}

.sheet-table tbody tr:nth-child(even) {
    background: #fafbff;
}

.sheet-table tbody tr:nth-child(even):hover {
    background: #f3f4f6;
}

/* Totals Row */
.totals-row {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 9;
    border-bottom: 3px solid var(--primary) !important;
}

.totals-row td {
    color: var(--primary) !important;
    padding: 14px 10px !important;
}

.totals-row .label-cell {
    color: #1f2937 !important;
    font-weight: 700;
}

.number-cell {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* Review Section */
.info-banner { 
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); 
    color: #1e40af; 
    padding: 16px; 
    border-radius: 12px; 
    display: flex; 
    gap: 15px; 
    align-items: center; 
    margin-bottom: 25px; 
    border-left: 4px solid #3b82f6; 
}
.info-banner i { font-size: 1.5rem; }

.tabs { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    justify-content: center; 
}
.tab-btn { 
    padding: 12px 28px; 
    border: none; 
    background: white; 
    border-radius: 25px; 
    cursor: pointer; 
    font-weight: 600; 
    color: var(--secondary); 
    box-shadow: var(--shadow-sm); 
    transition: all 0.3s; 
    display: flex;
    align-items: center;
    gap: 8px;
}
.tab-btn.active { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
    color: white; 
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); 
    transform: translateY(-2px);
}

/* Review Grid & Columns */
.review-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
    height: 600px; 
}
.review-col { 
    background: white; 
    border-radius: 12px; 
    border: 1px solid #e5e7eb; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    box-shadow: var(--shadow-sm);
}

/* Column Specifics */
.col-valid .col-head { 
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); 
    color: #065f46; 
    border-bottom: 3px solid var(--success); 
}
.col-ignore .col-head { 
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); 
    color: #991b1b; 
    border-bottom: 3px solid var(--danger); 
}
.col-geri .col-head { 
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); 
    color: #92400e; 
    border-bottom: 3px solid var(--warning); 
}

.col-head { 
    padding: 14px 16px; 
    font-weight: 700; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 14px;
}
.badge { 
    background: rgba(255,255,255,0.7); 
    padding: 3px 10px; 
    border-radius: 12px; 
    font-size: 12px; 
    font-weight: 700;
}

/* Search inside Column */
.col-search { 
    padding: 10px; 
    border-bottom: 1px solid #f0f0f0; 
    position: relative; 
}
.col-search input { 
    width: 100%; 
    border: 2px solid #e5e7eb; 
    border-radius: 8px; 
    padding: 8px 8px 8px 30px; 
    font-size: 12px; 
    outline: none; 
    font-family: inherit;
}
.col-search input:focus { border-color: var(--primary); }
.col-search i { 
    position: absolute; 
    left: 20px; 
    top: 50%; 
    transform: translateY(-50%); 
    font-size: 11px; 
    color: #9ca3af; 
}

.list-container { 
    flex: 1; 
    overflow-y: auto; 
    padding: 10px; 
    background: #fafbfc; 
}
.review-item { 
    background: white; 
    padding: 10px 12px; 
    border-radius: 8px; 
    margin-bottom: 8px; 
    border: 1px solid #e5e7eb; 
    font-size: 13px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 10px; 
    transition: all 0.2s; 
}
.review-item:hover { 
    transform: translateX(3px); 
    border-color: var(--primary); 
    box-shadow: var(--shadow-sm);
}
.item-text { 
    word-break: break-word; 
    flex: 1; 
    line-height: 1.4;
}
.actions { 
    display: flex; 
    gap: 4px; 
}
.act-btn { 
    width: 26px; 
    height: 26px; 
    border: none; 
    border-radius: 6px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    font-size: 11px; 
    color: white; 
    transition: all 0.2s; 
}
.act-btn:hover { 
    transform: scale(1.15); 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.act-btn.ignore { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.act-btn.valid { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.act-btn.geri { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.action-bar { 
    margin-top: 25px; 
    display: flex; 
    justify-content: flex-end; 
    gap: 15px; 
    border-top: 2px solid #f3f4f6; 
    padding-top: 20px; 
}
.action-bar.center { justify-content: center; }

/* --- RESULTS SECTION (Advanced) --- */
.results-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    border-bottom: 2px solid #e0e7ff; 
    padding-bottom: 15px; 
}
.results-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.5rem;
}
.view-switcher { 
    background: #f3f4f6; 
    padding: 4px; 
    border-radius: 10px; 
    display: flex; 
    gap: 4px; 
}
.view-btn { 
    border: none; 
    background: none; 
    padding: 8px 16px; 
    border-radius: 8px; 
    font-size: 13px; 
    cursor: pointer; 
    color: #6b7280; 
    font-weight: 600; 
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.view-btn.active { 
    background: white; 
    color: var(--primary); 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

/* GRID VIEW */
.results-grid-view { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); 
    grid-auto-rows: minmax(400px, auto);
    gap: 20px; 
    width: 100%;
}

/* TAB VIEW */
.results-tab-view { display: block; }
.results-tab-view .result-card { height: 650px; }
.result-tabs-nav { 
    margin-bottom: 15px; 
    display: flex; 
    gap: 8px; 
    border-bottom: 2px solid #e5e7eb; 
    padding-bottom: 5px;
}
.res-tab-btn { 
    border: none; 
    background: none; 
    padding: 10px 20px; 
    cursor: pointer; 
    font-weight: 600; 
    color: #6b7280; 
    border-bottom: 3px solid transparent; 
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.res-tab-btn.active { 
    color: var(--primary); 
    border-bottom-color: var(--primary); 
}

/* RESULT CARD */
.result-card { 
    background: white; 
    border-radius: 12px; 
    border: 1px solid #e5e7eb; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    box-shadow: var(--shadow-sm); 
    min-width: 0; 
    transition: 0.3s;
}
.result-card:hover {
    box-shadow: var(--shadow);
}

.result-head { 
    padding: 14px 18px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-weight: 600; 
    font-size: 15px;
}
.result-head .title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-sm { 
    padding: 6px 12px; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    color: white; 
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Color Themes */
.border-blue { border-top: 4px solid #3b82f6; } 
.bg-blue-light { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); color: #1e40af; } 
.btn-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.border-green { border-top: 4px solid #10b981; } 
.bg-green-light { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); color: #047857; } 
.btn-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }

.border-orange { border-top: 4px solid #f59e0b; } 
.bg-orange-light { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); color: #b45309; } 
.btn-orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.border-purple { border-top: 4px solid #8b5cf6; } 
.bg-purple-light { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); color: #6d28d9; } 
.btn-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }

/* Table Styling */
.result-body { 
    flex: 1; 
    overflow: auto; 
    position: relative; 
}
.preview-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 12px; 
}
.preview-table th { 
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%); 
    position: sticky; 
    top: 0; 
    z-index: 10; 
    padding: 12px 10px; 
    text-align: left; 
    color: white; 
    font-weight: 600; 
    border-bottom: 2px solid #e5e7eb; 
    white-space: nowrap; 
}
.preview-table td { 
    padding: 10px; 
    border-bottom: 1px solid #f3f4f6; 
    white-space: nowrap; 
    color: #4b5563; 
}
.preview-table tr:nth-child(even) { background: #fafbff; }
.preview-table tr:hover { background: #f0fdf4; }

/* Result Totals Row */
.preview-table .totals-row {
    position: sticky;
    top: 0;
    z-index: 9;
}

/* Loader */
.loading-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(255,255,255,0.95); 
    z-index: 1000; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
}
.loader { 
    border: 6px solid #f3f3f3; 
    border-top: 6px solid var(--primary); 
    border-radius: 50%; 
    width: 60px; 
    height: 60px; 
    animation: spin 1s linear infinite; 
}
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}
#loadingText {
    margin-top: 20px;
    color: #374151;
    font-weight: 600;
}
.loader-sm { 
    width: 35px; 
    height: 35px; 
    border: 4px solid #f3f3f3; 
    border-top-color: var(--secondary); 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
    margin: 25px auto; 
}

/* User List */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.user-row span {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    font-weight: 500;
}
.btn-danger {
    background: var(--danger);
    color: white;
}

/* Message Boxes */
.msg-box {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    font-weight: 500;
}
.msg-box.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}
.msg-box.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sheet-workspace {
        grid-template-columns: 250px 1fr;
    }
    .results-grid-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .review-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    .review-col {
        height: 300px;
    }
    .sheet-workspace {
        grid-template-columns: 1fr;
        height: auto;
    }
    .sheet-selection-sidebar {
        height: 300px;
    }
    .sheet-preview-main {
        height: 400px;
    }
}
/* Red color theme for Hesabat */
.bg-red-light { background: #fef2f2; }
.border-red { border-left-color: #ef4444 !important; }
.btn-red { background: #ef4444; color: white; border: none; }
.btn-red:hover { background: #dc2626; }
.res-tab-btn.border-red.active { border-bottom-color: #ef4444; color: #ef4444; }
/* ── Balance badge in navbar ── */
.balance-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-right: 6px;
}
.balance-badge i { font-size: 12px; }

/* ── Admin user list balance badge ── */
.user-balance-badge {
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 10px;
}
.empty-list {
    color: #9ca3af;
    font-size: 13px;
    padding: 10px 0;
    text-align: center;
}

/* ── Payment modal overlay ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}
.modal-box {
    background: white;
    border-radius: 16px;
    padding: 28px 32px 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    position: relative;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-header h3 i { color: #4F46E5; }
.modal-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 6px;
    transition: background 0.15s;
}
.modal-close-btn:hover { background: #f3f4f6; color: #1f2937; }
.modal-desc {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
    display: flex;
    gap: 7px;
    align-items: flex-start;
}
.modal-desc i { color: #4F46E5; margin-top: 2px; flex-shrink: 0; }

/* Quantity controls */
.qty-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.qty-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}
.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.qty-btn:hover { border-color: #4F46E5; background: #eef2ff; color: #4F46E5; }
.qty-input {
    width: 64px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-input:focus { outline: none; border-color: #4F46E5; }

/* Price display */
.price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
}
.price-hint { font-size: 13px; color: #6b7280; }
.price-total { font-size: 15px; color: #1f2937; }
.price-total strong { color: #4F46E5; font-size: 18px; }

/* Waiting area */
.waiting-area {
    text-align: center;
    padding: 16px 0 8px;
}
.waiting-area .loader {
    margin: 0 auto 16px;
}
.waiting-area h4 {
    margin: 0 0 8px;
    color: #1f2937;
    font-size: 17px;
}
.waiting-area p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.btn-block { width: 100%; }
.mt-10 { margin-top: 10px; }
