/* ===== Procomm Solar Ranking ===== */
:root {
    --sr-primary: #0b6fb8;
    --sr-primary-dark: #08568f;
    --sr-sun: #f59e0b;
    --sr-ink: #0f172a;
    --sr-muted: #64748b;
    --sr-border: #e2e8f0;
    --sr-soft: #f8fafc;
    --bs-primary: #0b6fb8;
    --bs-primary-rgb: 11, 111, 184;
    --bs-link-color: #0b6fb8;
    --bs-link-color-rgb: 11, 111, 184;
    --bs-link-hover-color: #08568f;
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
body { background: #f1f5f9; color: var(--sr-ink); font-size: .95rem; }
.btn-primary { --bs-btn-bg: var(--sr-primary); --bs-btn-border-color: var(--sr-primary); --bs-btn-hover-bg: var(--sr-primary-dark); --bs-btn-hover-border-color: var(--sr-primary-dark); --bs-btn-active-bg: var(--sr-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--sr-primary); --bs-btn-border-color: var(--sr-primary); --bs-btn-hover-bg: var(--sr-primary); --bs-btn-hover-border-color: var(--sr-primary); }

/* Navigation */
.app-nav { background: #0f172a; }
.app-nav .navbar-brand { color: #fff; line-height: 1.1; }
.app-nav .navbar-brand small { color: #94a3b8; font-size: .7rem; font-weight: 500; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; font-size: 1.25rem; }
.app-nav .nav-link { color: #cbd5e1; border-radius: 8px; padding: .45rem .75rem !important; font-weight: 500; }
.app-nav .nav-link:hover, .app-nav .nav-link.active, .app-nav .nav-link.show { color: #fff; background: rgba(255,255,255,.08); }
.app-nav .navbar-toggler { color: #fff; border-color: rgba(255,255,255,.25); font-size: 1.4rem; }

/* Cards and panels */
.panel { background: #fff; border: 1px solid var(--sr-border); border-radius: 14px; }
.panel-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--sr-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.panel-body { padding: 1.25rem; }
.page-title { font-weight: 800; letter-spacing: -.01em; }
.stat { background: #fff; border: 1px solid var(--sr-border); border-radius: 14px; padding: 1rem 1.25rem; height: 100%; }
.stat .num { font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.stat .label { color: var(--sr-muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Tables */
.table-app { margin: 0; }
.table-app > :not(caption) > * > * { padding: .7rem .9rem; vertical-align: middle; border-color: var(--sr-border); }
.table-app thead th { background: var(--sr-soft); color: var(--sr-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; white-space: nowrap; }
.table-app tbody tr:hover { background: #f8fbff; }

/* Ranking */
.rank-badge { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; background: #e2e8f0; color: #334155; font-size: 1rem; }
.rank-1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.rank-2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.rank-3 { background: linear-gradient(135deg, #fed7aa, #c2742f); color: #431407; }
.score { font-weight: 800; font-size: 1.15rem; }
.score-bar { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; min-width: 90px; }
.score-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0b6fb8, #22c55e); }
.chip { display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 99px; padding: .15rem .55rem; margin: 0 .2rem .25rem 0; white-space: nowrap; }
.chip-good { background: #dcfce7; color: #166534; }
.chip-bad { background: #fef3c7; color: #92400e; }
.chip-missing { background: #f1f5f9; color: #64748b; border: 1px dashed #cbd5e1; }
.chip-flag { background: #fee2e2; color: #991b1b; }
.breakdown td, .breakdown th { font-size: .85rem; }
.mini-bar { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; width: 100px; display: inline-block; vertical-align: middle; }
.mini-bar span { display: block; height: 100%; background: var(--sr-primary); }
.completeness { font-size: .78rem; color: var(--sr-muted); }
.best-cell { background: #ecfdf5 !important; font-weight: 700; color: #166534; }

/* Entry form with the PDF alongside */
.pdf-pane { position: sticky; top: 1rem; height: calc(100vh - 2rem); border-radius: 14px; overflow: hidden; border: 1px solid var(--sr-border); background: #525659; }
.pdf-pane iframe { width: 100%; height: 100%; border: 0; }
.pdf-empty { height: 100%; display: grid; place-items: center; color: #cbd5e1; text-align: center; padding: 2rem; }
.form-section { background: #fff; border: 1px solid var(--sr-border); border-radius: 14px; margin-bottom: 1rem; }
.form-section h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sr-muted); font-weight: 700; padding: .85rem 1.1rem; border-bottom: 1px solid var(--sr-border); margin: 0; }
.form-section .body { padding: 1rem 1.1rem; }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.form-text { font-size: .76rem; }
.save-bar { position: sticky; bottom: 0; background: rgba(241,245,249,.95); backdrop-filter: blur(4px); padding: .75rem 0; border-top: 1px solid var(--sr-border); z-index: 5; }

/* Upload */
.dropzone { border: 2px dashed #cbd5e1; border-radius: 14px; background: #fff; padding: 2.5rem 1rem; text-align: center; transition: .15s; cursor: pointer; }
.dropzone.drag { border-color: var(--sr-primary); background: #eff6ff; }
.dropzone i { font-size: 2.5rem; color: var(--sr-primary); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 20%, #1e3a5f, #0f172a 60%); padding: 1rem; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 2rem; box-shadow: 0 25px 60px rgba(0,0,0,.35); }

/* Spec view */
.spec-table th { width: 50%; color: var(--sr-muted); font-weight: 600; font-size: .85rem; }
.spec-table td { font-weight: 600; }

/* Print / Save as PDF */
.print-header { display: none; }
@media print {
    @page { size: A4 landscape; margin: 12mm; }
    body { background: #fff; font-size: 10pt; }
    .no-print, .app-nav, .btn, .alert { display: none !important; }
    main { padding: 0 !important; }
    .panel { border: 0; }
    .print-header { display: block; margin-bottom: 8mm; }
    .collapse { display: table-row !important; }
    .table-app > :not(caption) > * > * { padding: .35rem .5rem; }
    tr { page-break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
}
