/* Ledgerlands — Shared Styles (extends gt-shared.css) */

/* Badges */
.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; }

/* KPI Cards */
.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; }

/* Profit Cards */
.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; }

/* Health Cards */
.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; }

/* Installment Items */
.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; }

/* Two Column Layout */
.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 Charts */
.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; }

/* Print Button — min 44px touch target */
.btn-print { background: white; color: #0d47a1; border: none; padding: 10px 16px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; min-height: 44px; }

/* Sortable Table Headers */
.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; }

/* LL Tablet (768px) */
@media (max-width: 768px) {
    .kpi-grid, .profit-box { grid-template-columns: repeat(2, 1fr); }
    .health-row, .highlight-row { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .kpi .val { font-size: 20px; }
    .profit-card .pc-val { font-size: 18px; }
    .inst-item { flex-wrap: wrap; }
}

/* LL Phone (480px) */
@media (max-width: 480px) {
    .kpi-grid, .profit-box { grid-template-columns: 1fr; }
    .kpi { padding: 10px; }
    .kpi .val { font-size: 18px; }
    .kpi .lbl { font-size: 10px; }
    .profit-card { padding: 10px; }
    .profit-card .pc-val { font-size: 16px; }
    .health-card { padding: 10px; }
    .badge { font-size: 10px; padding: 2px 6px; }
    .bar-chart { height: 70px; }
    .panel { padding: 10px; }
}

/* LL Small phone (360px) */
@media (max-width: 360px) {
    .kpi .val { font-size: 16px; }
    .profit-card .pc-val { font-size: 14px; }
    .inst-left .prop { font-size: 12px; }
    .inst-right .amt { font-size: 13px; }
}
