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

body { font-family: 'Inter', sans-serif; background: #f8fafc; color: #1e293b; }

/* ── Welcome Screen ── */
#welcome-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; }
.welcome-bg { position: fixed; inset: 0; background: linear-gradient(135deg, #1e3a5f 0%, #2d5a9e 50%, #1a237e 100%); z-index: 0; }

.welcome-container { position: relative; z-index: 1; width: 100%; max-width: 480px; padding: 24px; }
.welcome-card { background: white; border-radius: 20px; padding: 40px; box-shadow: 0 25px 50px rgba(0,0,0,0.25); }

.logo-area { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.logo-icon { width: 52px; height: 52px; background: linear-gradient(135deg, #1e3a5f, #2d5a9e); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.logo-icon.sm { width: 34px; height: 34px; border-radius: 8px; font-size: 11px; }
.brand-name { font-size: 20px; font-weight: 800; color: #1e293b; }
.brand-tagline { font-size: 13px; color: #64748b; margin-top: 2px; }

.welcome-hero { background: linear-gradient(135deg, #f0f4ff, #e8f4fd); border-radius: 14px; padding: 24px; margin-bottom: 28px; border: 1px solid #c7d7f4; }
.welcome-hero h2 { font-size: 20px; font-weight: 700; color: #1e3a5f; margin-bottom: 10px; }
.welcome-hero p { font-size: 14px; color: #374151; line-height: 1.6; }

.login-title { font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-group input { width: 100%; padding: 11px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 14px; font-family: inherit; transition: border-color 0.2s; outline: none; }
.form-group input:focus { border-color: #2d5a9e; box-shadow: 0 0 0 3px rgba(45,90,158,0.12); }

#login-btn { width: 100%; padding: 13px; background: linear-gradient(135deg, #1e3a5f, #2d5a9e); color: white; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity 0.2s, transform 0.1s; margin-top: 8px; }
#login-btn:hover { opacity: 0.92; transform: translateY(-1px); }
#login-btn:active { transform: translateY(0); }
#login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-hint { font-size: 12px; color: #94a3b8; text-align: center; margin-top: 14px; }
.login-hint a { color: #2d5a9e; text-decoration: none; }
.login-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }

/* ── Top Nav ── */
.topnav { position: fixed; top: 0; left: 0; right: 0; height: 58px; background: white; border-bottom: 1px solid #e2e8f0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.topnav-inner { max-width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.topnav-logo { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #1e293b; }
.topnav-right { display: flex; align-items: center; gap: 12px; }
.user-greeting { font-size: 13px; color: #64748b; }
.crm-link { font-size: 13px; color: #2d5a9e; font-weight: 500; text-decoration: none; padding: 6px 12px; border: 1px solid #c7d7f4; border-radius: 8px; }
.crm-link:hover { background: #f0f4ff; }
.logout-btn { font-size: 13px; color: #64748b; background: none; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-family: inherit; }
.logout-btn:hover { background: #f8fafc; }

/* ── Manual Layout ── */
.manual-layout { display: flex; padding-top: 58px; min-height: 100vh; }

.sidebar { width: 240px; flex-shrink: 0; position: fixed; top: 58px; left: 0; bottom: 0; background: white; border-right: 1px solid #e2e8f0; overflow-y: auto; padding: 20px 0; }
.sidebar-section-label { font-size: 10px; font-weight: 700; color: #94a3b8; letter-spacing: 0.08em; padding: 0 20px 8px; text-transform: uppercase; }
.sidebar nav ul { list-style: none; }
.sidebar nav ul li a { display: block; padding: 9px 20px; font-size: 13px; color: #475569; text-decoration: none; border-left: 3px solid transparent; transition: all 0.15s; cursor: pointer; }
.sidebar nav ul li a:hover { background: #f8fafc; color: #1e293b; }
.sidebar nav ul li a.active { background: #f0f4ff; color: #1e3a5f; border-left-color: #2d5a9e; font-weight: 600; }

.manual-content { margin-left: 240px; flex: 1; padding: 40px 60px; max-width: calc(100% - 240px); }

/* ── Sections ── */
.section { margin-bottom: 64px; padding-bottom: 64px; border-bottom: 1px solid #f1f5f9; }
.section:last-child { border-bottom: none; }

.section-badge { display: inline-block; padding: 3px 10px; background: #f0f4ff; color: #2d5a9e; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 10px; }

.section h2 { font-size: 28px; font-weight: 800; color: #1e293b; margin-bottom: 16px; line-height: 1.3; }
.section h3 { font-size: 18px; font-weight: 700; color: #1e293b; margin: 28px 0 14px; }
.section-intro { font-size: 16px; color: #475569; line-height: 1.7; margin-bottom: 24px; }

/* ── Welcome Message ── */
.welcome-message { font-size: 15px; color: #374151; line-height: 1.8; }
.welcome-message p { margin-bottom: 16px; }
.highlight-box { background: #fefce8; border: 1px solid #fde68a; border-radius: 10px; padding: 14px 18px; font-size: 14px; color: #78350f; margin-top: 20px; }

/* ── Role Cards ── */
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px 0; }
.role-card { border-radius: 14px; padding: 24px; }
.role-card.blue { background: #eff6ff; border: 1px solid #bfdbfe; }
.role-card.indigo { background: #eef2ff; border: 1px solid #c7d2fe; }
.role-card.green { background: #f0fdf4; border: 1px solid #bbf7d0; }
.role-card-icon { font-size: 28px; margin-bottom: 12px; }
.role-card h4 { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.role-card p { font-size: 13px; color: #475569; line-height: 1.6; }

/* ── Flow Diagram ── */
.flow-diagram { display: flex; align-items: center; gap: 8px; margin: 28px 0; flex-wrap: wrap; }
.flow-step { background: white; border: 2px solid #e2e8f0; border-radius: 12px; padding: 16px 20px; text-align: center; flex: 1; min-width: 100px; }
.flow-step.highlight { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-color: #86efac; }
.flow-num { width: 32px; height: 32px; background: #1e3a5f; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; margin: 0 auto 8px; }
.flow-step.highlight .flow-num { background: #16a34a; }
.flow-text { font-size: 12px; color: #475569; line-height: 1.4; }
.flow-arrow { font-size: 20px; color: #94a3b8; flex-shrink: 0; }

/* ── Steps ── */
.steps { display: flex; flex-direction: column; gap: 28px; margin: 20px 0; }
.step { display: flex; gap: 20px; }
.step-num { width: 36px; height: 36px; background: linear-gradient(135deg, #1e3a5f, #2d5a9e); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.step-body { flex: 1; }
.step-body h4 { font-size: 16px; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.step-body p { font-size: 14px; color: #475569; line-height: 1.6; }

/* ── Screenshot Boxes ── */
.screenshot-box { background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 14px; overflow: hidden; margin: 16px 0; }
.screenshot-box.large { margin: 20px 0; }
.screenshot-label { background: #1e293b; color: #94a3b8; font-size: 11px; font-weight: 500; padding: 8px 14px; letter-spacing: 0.04em; display: flex; align-items: center; gap: 6px; }
.screenshot-label::before { content: '●'; color: #ef4444; }
.screenshot-label::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-left: -2px; box-shadow: -12px 0 0 #f59e0b; }
.screenshot-box img { display: block; width: 100%; height: auto; }
.screenshot-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: #94a3b8; font-size: 13px; background: #f1f5f9; }
.screenshot-placeholder span:first-child { font-size: 36px; }

/* ── Info / Callout Boxes ── */
.info-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 12px 16px; font-size: 13px; color: #1d4ed8; margin: 12px 0; line-height: 1.6; }
.callout { border-radius: 10px; padding: 14px 18px; font-size: 14px; margin: 20px 0; line-height: 1.6; }
.callout.warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.callout.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.tip-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 20px; margin: 24px 0; }
.tip-box h4 { font-size: 14px; font-weight: 700; color: #166534; margin-bottom: 8px; }
.tip-box p, .tip-box ul { font-size: 14px; color: #166534; line-height: 1.7; }
.tip-box ul { padding-left: 20px; }
.tip-box ul li { margin-bottom: 4px; }

/* ── Metric Cards ── */
.metric-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 20px 0; }
.metric-card { display: flex; gap: 16px; background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px; }
.metric-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.metric-icon.blue { background: #eff6ff; }
.metric-icon.purple { background: #faf5ff; }
.metric-icon.green { background: #f0fdf4; }
.metric-icon.orange { background: #fff7ed; }
.metric-icon.indigo { background: #eef2ff; }
.metric-icon.yellow { background: #fefce8; }
.metric-card h4 { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.metric-card p { font-size: 13px; color: #64748b; line-height: 1.5; }

/* ── Field Grid ── */
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 16px 0; }
.field-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; }
.field-name { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.field-desc { font-size: 12px; color: #64748b; line-height: 1.6; }

/* ── Source Grid ── */
.source-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 14px 0; }
.source-card { border-radius: 12px; padding: 18px; }
.source-card.indigo { background: #eef2ff; border: 1px solid #c7d2fe; }
.source-card.purple { background: #faf5ff; border: 1px solid #e9d5ff; }
.source-card h5 { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.source-card p { font-size: 13px; color: #475569; line-height: 1.6; }

/* ── Rates Box ── */
.rates-box { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 14px 0; }
.rate-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; }
.rate-item strong { display: block; font-size: 13px; color: #1e293b; margin-bottom: 4px; }
.rate-item span { display: block; font-size: 12px; color: #2d5a9e; font-family: monospace; margin-bottom: 6px; }
.rate-item em { display: block; font-size: 12px; color: #64748b; font-style: normal; }

/* ── Table Guide ── */
.table-guide { margin: 20px 0; }
.table-guide h4 { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 12px; }
.table-guide table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-guide th { background: #f1f5f9; text-align: left; padding: 10px 14px; color: #475569; font-weight: 600; border-bottom: 1px solid #e2e8f0; }
.table-guide td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; color: #374151; }
.table-guide td:first-child { font-weight: 600; color: #1e293b; }
.table-guide tr:last-child td { border-bottom: none; }

/* ── Metric Explanation ── */
.metric-explanation { background: white; border: 1px solid #e2e8f0; border-radius: 14px; padding: 24px; margin: 20px 0; }
.metric-explanation h3 { font-size: 17px; font-weight: 700; color: #1e293b; margin-bottom: 12px; margin-top: 0; }
.formula { background: #1e293b; color: #7dd3fc; font-family: monospace; font-size: 14px; padding: 12px 18px; border-radius: 8px; margin: 12px 0; }
.benchmark-grid { display: flex; gap: 12px; margin: 14px 0; }
.benchmark { flex: 1; border-radius: 10px; padding: 14px; text-align: center; }
.benchmark.red { background: #fef2f2; border: 1px solid #fecaca; }
.benchmark.yellow { background: #fffbeb; border: 1px solid #fde68a; }
.benchmark.green { background: #f0fdf4; border: 1px solid #bbf7d0; }
.benchmark strong { display: block; font-size: 16px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.benchmark span { font-size: 12px; color: #64748b; }

/* ── Source Insight ── */
.source-insight { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 16px 0; }
.source-insight-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; }
.source-insight-item strong { display: block; font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.source-insight-item p { font-size: 13px; color: #64748b; line-height: 1.5; }

/* ── Comp Cards ── */
.comp-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 20px 0; }
.comp-card { border-radius: 14px; padding: 24px; }
.comp-card.green { background: #f0fdf4; border: 1px solid #86efac; }
.comp-card.indigo { background: #eef2ff; border: 1px solid #a5b4fc; }
.comp-card h4 { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.comp-card p { font-size: 14px; color: #374151; line-height: 1.6; margin-bottom: 14px; }
.comp-example { background: white; border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #374151; border: 1px solid rgba(0,0,0,0.07); }
.comp-example strong { color: #166534; }

/* ── Requirements ── */
.requirements-list { padding-left: 20px; margin: 14px 0; }
.requirements-list li { font-size: 14px; color: #374151; line-height: 1.8; }
.requirements-list li strong { color: #1e293b; }

/* ── Tips Grid ── */
.tips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 20px 0; }
.tip-card { background: white; border: 1px solid #e2e8f0; border-radius: 14px; padding: 22px; }
.tip-icon { font-size: 28px; margin-bottom: 12px; }
.tip-card h4 { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.tip-card p { font-size: 13px; color: #64748b; line-height: 1.6; }

/* ── Contact ── */
.contact-cards { display: flex; gap: 20px; margin: 24px 0; }
.contact-card { flex: 1; background: white; border: 1px solid #e2e8f0; border-radius: 14px; padding: 24px; text-align: center; }
.contact-icon { font-size: 32px; margin-bottom: 12px; }
.contact-card h4 { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.contact-card a { font-size: 14px; color: #2d5a9e; text-decoration: none; }

.final-message { background: linear-gradient(135deg, #1e3a5f, #2d5a9e); color: white; border-radius: 16px; padding: 32px; text-align: center; margin-top: 32px; }
.final-message h3 { font-size: 24px; font-weight: 800; margin-bottom: 14px; }
.final-message p { font-size: 15px; line-height: 1.8; opacity: 0.92; }

.link { color: #2d5a9e; text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .manual-content { margin-left: 0; padding: 20px; max-width: 100%; }
  .role-cards, .metric-cards, .field-grid, .source-grid, .rates-box, .source-insight, .comp-cards, .tips-grid { grid-template-columns: 1fr; }
  .benchmark-grid { flex-direction: column; }
  .flow-diagram { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
}
