
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%); min-height: 100vh; padding: 15px; }
.container { max-width: 1100px; margin: 5px auto; background: white; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.header { background: linear-gradient(135deg, #0d47a1, #1565c0); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.header h2 { font-size: 18px; font-weight: 800; }
.header-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-back { background: rgba(255,255,255,0.2); color: white; border: 2px solid white; padding: 7px 13px; border-radius: 6px; font-weight: 600; font-size: 13px; text-decoration: none; }
.btn-print { background: white; color: #0d47a1; border: none; padding: 7px 13px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.content { padding: 15px 20px; }
.version { font-size: 10px; opacity: 0.5; text-align: right; padding: 4px 20px 8px; }
.loading { text-align: center; padding: 40px; color: #999; font-size: 14px; }
.hero-box { background: linear-gradient(135deg, #0d47a1, #1565c0); border-radius: 14px; padding: 20px; color: white; margin-bottom: 16px; }
.hero-main-lbl { font-size: 12px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; }
.hero-main-val { font-size: 36px; font-weight: 900; margin: 4px 0 16px; }
.hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hero-item { background: rgba(255,255,255,0.15); border-radius: 10px; padding: 12px; text-align: center; }
.hero-item .hl { font-size: 10px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.hero-item .hv { font-size: 17px; font-weight: 800; }
.hero-item .hs { font-size: 10px; opacity: 0.7; margin-top: 3px; }
.profit-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.profit-card { border-radius: 12px; padding: 14px; text-align: center; border: 2px solid transparent; }
.profit-card .pc-lbl { font-size: 10px; font-weight: 700; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.profit-card .pc-val { font-size: 22px; font-weight: 800; }
.profit-card .pc-sub { font-size: 11px; opacity: 0.7; margin-top: 4px; }
.pc-green  { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.pc-blue   { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.pc-purple { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.pc-orange { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { border-radius: 12px; padding: 14px; text-align: center; }
.kpi .lbl { font-size: 11px; font-weight: 700; opacity: 0.75; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi .val { font-size: 24px; font-weight: 800; }
.kpi .sub { font-size: 11px; opacity: 0.7; margin-top: 3px; }
.kpi-blue   { background: #e3f2fd; color: #1565c0; }
.kpi-green  { background: #e8f5e9; color: #2e7d32; }
.kpi-orange { background: #fff3e0; color: #e65100; }
.kpi-red    { background: #fdecea; color: #c62828; }
.health-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.health-card { border-radius: 12px; padding: 14px; border: 2px solid #e0e0e0; }
.health-card .hc-title { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.health-card .hc-val { font-size: 18px; font-weight: 800; color: #333; }
.health-card .hc-sub { font-size: 11px; color: #666; margin-top: 4px; }
.section-title { font-size: 12px; font-weight: 800; color: #555; text-transform: uppercase; letter-spacing: 0.5px; margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #e0e0e0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { border: 2px solid #e0e0e0; border-radius: 10px; padding: 14px; }
.panel h4 { font-size: 11px; font-weight: 800; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.bar-chart { display: flex; align-items: flex-end; gap: 5px; height: 100px; padding-bottom: 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bar-fill { width: 100%; background: linear-gradient(180deg, #1565c0, #42a5f5); border-radius: 4px 4px 0 0; min-height: 3px; }
.bar-fill.highlight { background: linear-gradient(180deg, #e65100, #ff7043); }
.bar-lbl { font-size: 9px; color: #888; font-weight: 600; }
.bar-val { font-size: 9px; color: #1565c0; font-weight: 700; }
.status-list { display: flex; flex-direction: column; gap: 10px; }
.status-row { display: flex; justify-content: space-between; align-items: center; }
.status-label { font-size: 13px; color: #444; display: flex; align-items: center; gap: 6px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-val { font-size: 14px; font-weight: 800; }
.status-bar-wrap { height: 6px; background: #f0f0f0; border-radius: 4px; margin-top: 3px; overflow: hidden; }
.status-bar-fill { height: 100%; border-radius: 4px; }
.highlight-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.hl-card { border-radius: 12px; padding: 14px; border: 2px solid #e0e0e0; }
.hl-card .hl-icon { font-size: 20px; margin-bottom: 6px; }
.hl-card .hl-lbl { font-size: 10px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.hl-card .hl-val { font-size: 16px; font-weight: 800; color: #333; }
.hl-card .hl-sub { font-size: 11px; color: #888; margin-top: 3px; }
.inst-list { display: flex; flex-direction: column; gap: 6px; }
.inst-item { background: #f9f9f9; border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-left: 3px solid #ddd; }
.inst-item.overdue { border-left-color: #e53935; background: #fff8f8; }
.inst-item.soon    { border-left-color: #ffa000; background: #fffde7; }
.inst-item.ok      { border-left-color: #43a047; background: #f9fbe7; }
.inst-left .prop   { font-size: 13px; font-weight: 800; color: #333; }
.inst-left .buyer  { font-size: 11px; color: #888; margin-top: 2px; }
.inst-right { text-align: right; flex-shrink: 0; }
.inst-right .amt { font-size: 15px; font-weight: 800; color: #333; }
.inst-right .due { font-size: 11px; color: #888; margin-top: 2px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: #f5f5f5; padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 800; color: #666; text-transform: uppercase; }
.tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl th.sortable:hover { background: #e8e8e8; color: #1565c0; }
.tbl th.sort-asc::after { content: ' ▲'; color: #1565c0; }
.tbl th.sort-desc::after { content: ' ▼'; color: #1565c0; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f9f9f9; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.badge-green  { background: #e8f5e9; color: #2e7d32; }
.badge-blue   { background: #e3f2fd; color: #1565c0; }
.badge-red    { background: #fdecea; color: #c62828; }
.badge-grey   { background: #f5f5f5; color: #555; }
.badge-orange { background: #fff3e0; color: #e65100; }
.never-paid-item { background: #fdecea; border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; border-left: 3px solid #c62828; margin-bottom: 6px; }
@media print {
    .no-print { display: none !important; }
    body { background: white !important; padding: 0 !important; }
    .container { box-shadow: none !important; }
}
@media (max-width: 600px) {
    .hero-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .profit-box { grid-template-columns: repeat(2, 1fr) !important; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .health-row { grid-template-columns: 1fr !important; }
    .two-col { grid-template-columns: 1fr !important; }
    .highlight-row { grid-template-columns: 1fr !important; }
}

