/* ═══════════════════════════════════════════════════════════
   Legacy Intelligent System — Main Stylesheet
   Color Theme: Corporate Blue (#1a3a6b) and Teal (#0d9488)
   ═══════════════════════════════════════════════════════════ */

:root {
    --lis-blue:        #1a3a6b;
    --lis-blue-light:  #2a52a0;
    --lis-teal:        #0d9488;
    --lis-teal-light:  #14b8a6;
    --lis-hero-bg:     #dbeafe;   /* light blue */
    --lis-card-border: #e2e8f0;
    --lis-text-dark:   #1e293b;
    --lis-text-muted:  #64748b;
}

/* ─── Global ─── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--lis-text-dark);
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Navbar ─── */
.lis-navbar {
    background-color: var(--lis-blue) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Logo wrapper — white rounded pill with shadow so logo pops on dark navbar */
.lis-logo-wrap {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.2s ease;
}

.lis-logo-wrap:hover {
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.45);
}

.lis-logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
    display: block;
}

.lis-nav-link {
    color: rgba(255, 255, 255, 0.92) !important;
    border-radius: 6px;
    padding: 0.45rem 0.9rem !important;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.lis-nav-link:hover,
.lis-nav-link.active {
    background-color: var(--lis-teal) !important;
    color: #ffffff !important;
}

/* ─── Hero Section ─── */
.lis-hero {
    background-color: var(--lis-hero-bg);
    border-bottom: 1px solid #bfdbfe;
    min-height: 320px;
}

.lis-hero-logo {
    max-height: 100px;
    max-width: 280px;
    object-fit: contain;
}

.lis-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--lis-blue);
}

.lis-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--lis-text-muted);
    max-width: 680px;
    line-height: 1.6;
}

/* ─── App Cards / Tiles ─── */
.lis-apps-section {
    background-color: #f8fafc;
}

.lis-app-card {
    background: #ffffff;
    border: 1px solid var(--lis-card-border);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                border-color 0.25s ease, background-color 0.25s ease;
    cursor: pointer;
}

.lis-app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.18);
    border-color: var(--lis-teal);
    background-color: #f0fdfa;
}

.lis-app-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--lis-blue), var(--lis-teal));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lis-app-icon .bi {
    font-size: 1.5rem;
    color: #ffffff;
}

.lis-app-card-title {
    color: var(--lis-blue);
    font-size: 1.05rem;
}

.lis-app-card-text {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ─── App Launch Button ─── */
.lis-btn-app {
    background-color: var(--lis-blue);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.25s ease, transform 0.15s ease;
}

.lis-btn-app:hover {
    background-color: var(--lis-teal);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ─── General Form Pages ─── */
.lis-page-header {
    background: linear-gradient(135deg, var(--lis-blue), var(--lis-blue-light));
    color: #ffffff;
    padding: 2.5rem 0;
}

.lis-page-header h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
}

.lis-page-header p {
    opacity: 0.85;
    font-size: 1rem;
}

.lis-form-card {
    background: #ffffff;
    border: 1px solid var(--lis-card-border);
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    padding: 2rem;
}

.lis-section-label {
    color: var(--lis-blue);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--lis-teal);
    padding-bottom: 0.4rem;
    margin-bottom: 1rem;
}

.lis-btn-primary {
    background-color: var(--lis-blue);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.25s ease;
}

.lis-btn-primary:hover {
    background-color: var(--lis-teal);
    color: #ffffff;
}

.lis-btn-download {
    background-color: var(--lis-teal);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    transition: background-color 0.25s ease;
}

.lis-btn-download:hover {
    background-color: var(--lis-blue);
    color: #ffffff;
}

/* ─── Loading Overlay ─── */
#lis-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 58, 107, 0.82);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

#lis-loading-overlay.active {
    display: flex;
}

.lis-spinner {
    width: 56px;
    height: 56px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--lis-teal-light);
    border-radius: 50%;
    animation: lis-spin 0.9s linear infinite;
    margin-bottom: 1.25rem;
}

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

.lis-loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    max-width: 320px;
    line-height: 1.5;
}

/* ─── Results Page ─── */
.lis-results-card {
    background: #ffffff;
    border: 1px solid var(--lis-card-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.lis-results-card table {
    width: 100%;
    min-width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
    table-layout: auto;
}

.lis-results-card th,
.lis-results-card th * {
    background-color: var(--lis-blue) !important;
    color: #ffffff !important;
    font-weight: 700;
    padding: 0.65rem 0.9rem;
    border: 1px solid #1e3a8a;
    letter-spacing: 0.3px;
}

.lis-alert-red    { background-color: #fee2e2; color: #991b1b; }
.lis-alert-yellow { background-color: #fef9c3; color: #854d0e; }
.lis-alert-green  { background-color: #dcfce7; color: #166534; }

/* ─── Footer ─── */
.lis-footer {
    background-color: var(--lis-blue);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* ─── Responsive Utilities ─── */
@media (max-width: 576px) {
    .lis-hero {
        min-height: 260px;
        padding: 2rem 1rem;
    }
    .lis-form-card {
        padding: 1.25rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   Report Body — Styles for Markdown-rendered HTML output
   Applied inside .lis-report-body container
   ═══════════════════════════════════════════════════════════ */

.lis-report-body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.97rem;
    color: var(--lis-text-dark);
    line-height: 1.75;
}

/* Headings */
.lis-report-body h1 {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--lis-blue);
    border-bottom: 3px solid var(--lis-teal);
    padding-bottom: 0.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.lis-report-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--lis-teal);
    border-left: 4px solid var(--lis-teal);
    padding-left: 0.75rem;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.lis-report-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--lis-blue);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.lis-report-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--lis-text-dark);
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
}

/* Paragraphs */
.lis-report-body p {
    margin-bottom: 0.85rem;
}

/* Bold */
.lis-report-body strong {
    color: var(--lis-blue);
    font-weight: 700;
}

/* Horizontal rule */
.lis-report-body hr {
    border: none;
    border-top: 2px solid var(--lis-teal);
    margin: 1.75rem 0;
    opacity: 0.4;
}

/* Bullet and numbered lists */
.lis-report-body ul,
.lis-report-body ol {
    padding-left: 1.5rem;
    margin-bottom: 0.85rem;
}

.lis-report-body li {
    margin-bottom: 0.35rem;
}

/* Tables — full-width wrapper for horizontal scroll on small screens */
.lis-report-body .table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 1.25rem 0;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

.lis-report-body table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
}

/* ── Table header rows ── */
/* Covers <thead tr> and any <tr> that contains <th> cells (markdown may omit thead) */
.lis-report-body thead tr,
.lis-report-body tr:has(th) {
    background-color: var(--lis-blue) !important;
}

/* ── All <th> cells — always white bold text on blue, no exceptions ── */
.lis-report-body th,
.lis-report-body th * {
    background-color: var(--lis-blue) !important;
    color: #ffffff !important;
    padding: 0.65rem 0.9rem;
    font-weight: 700;
    text-align: left;
    border: 1px solid #1e3a8a;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ── tbody data rows — alternating colors apply only to <td> cells ── */
.lis-report-body tbody tr:nth-child(even) td {
    background-color: #eff6ff;
}

.lis-report-body tbody tr:nth-child(odd) td {
    background-color: #ffffff;
}

.lis-report-body tbody tr:hover td {
    background-color: #dbeafe;
    transition: background-color 0.15s ease;
}

.lis-report-body tbody td {
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    vertical-align: top;
    color: var(--lis-text-dark);
}

/* Code blocks (if any) */
.lis-report-body code {
    background-color: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88rem;
    color: #0f172a;
}

.lis-report-body pre {
    background-color: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.88rem;
}

/* Print-friendly adjustments */
@media print {
    .lis-report-body h1 { font-size: 1.4rem; }
    .lis-report-body h2 { font-size: 1.15rem; }
    .lis-report-body table { font-size: 0.82rem; }
}

/* ─── Proposal Page Sections ─── */
.lis-proposal-page {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

/* ─── Cover Page ─── */
.lis-cover-page {
    background: linear-gradient(160deg, #f0f7ff 0%, #ffffff 100%);
    padding: 3rem 2rem;
}

.lis-cover-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lis-cover-logo {
    max-height: 140px;
    max-width: 340px;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

.lis-cover-divider {
    border: none;
    border-top: 3px solid var(--lis-teal);
    width: 120px;
    opacity: 1;
}

.lis-cover-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    color: var(--lis-blue);
    letter-spacing: -0.3px;
}

.lis-cover-fields {
    display: inline-block;
    text-align: left;
    margin-top: 1.5rem;
}

.lis-cover-field-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    font-size: 1.05rem;
}

.lis-cover-label {
    font-weight: 700;
    color: var(--lis-blue);
    min-width: 140px;
}

.lis-cover-value {
    color: #475569;
    font-size: 1.05rem;
}

/* ─── Service Team Table ─── */
.lis-service-table thead th,
.lis-service-table thead th * {
    background-color: var(--lis-blue) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* ─── TOC Placeholder ─── */
.lis-toc-placeholder {
    background-color: #f8fafc;
    border-color: #cbd5e1 !important;
    color: #64748b;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ─── Service Team Two-Column Table ─── */
.lis-service-team-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
}

.lis-service-team-table td {
    padding: 0.5rem 0.85rem;
    border: 1px solid #cbd5e1;
    vertical-align: middle;
    font-size: 0.97rem;
}

.lis-service-team-table .lis-st-label {
    font-weight: 700;
    color: var(--lis-blue);
    width: 45%;
    background-color: #f8fafc;
}

/* ─── Conclusion / Closing Section ─── */
/* Targets the h1#conclusion heading and its following paragraphs inside .lis-report-body */
.lis-report-body h1:has(+ p),
.lis-conclusion-section {
    /* Handled inline via the section wrapper below */
}

/* Style the Conclusion section as a visually distinct call-to-action panel */
.lis-report-body h1[id="conclusion"],
.lis-report-body h1[id="conclusion"] ~ p {
    /* Fallback: handled by the wrapper approach */
}

/* Conclusion card — injected by JS to wrap the Conclusion section */
.lis-conclusion-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f5f3 100%);
    border: 2px solid var(--lis-teal);
    border-radius: 12px;
    padding: 2rem 2.25rem;
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.12);
}

.lis-conclusion-card h1 {
    border-bottom: 3px solid var(--lis-teal);
    padding-bottom: 0.4rem;
    margin-top: 0 !important;
    color: var(--lis-blue);
}

.lis-conclusion-card p {
    font-size: 1.02rem;
    line-height: 1.85;
    color: var(--lis-text-dark);
}

.lis-conclusion-card strong {
    color: var(--lis-teal) !important;
}
