﻿/* =====================================================================================================
   RaBit Hub, Facturare pages: the billing add-on of the design (docs/hub-billing-design/src/billing-addon.css),
   on top of hub.css (variant E). Only what variant E has no class for. The Hub CSP allows no inline style,
   so the users bar widths are classes (hm-w-0 ... hm-w-100) instead of style="width".
   ===================================================================================================== */

:root { --hm-faint: #8a86a0; }
#hub .fa-credit-card::before { content: "\f09d"; }
#hub .fa-file-text-o::before { content: "\f0f6"; }
#hub .fa-bar-chart::before { content: "\f080"; }
#hub .fa-tags::before { content: "\f02c"; }
#hub .fa-download::before { content: "\f019"; }
#hub .fa-calendar::before { content: "\f073"; }
#hub .fa-envelope::before { content: "\f0e0"; }
#hub .fa-inbox::before { content: "\f01c"; }
#hub .fa-university::before { content: "\f19c"; }
#hub .fa-undo::before { content: "\f0e2"; }
#hub .fa-user-plus::before { content: "\f234"; }
#hub .fa-clock-o::before { content: "\f017"; }
#hub .fa-user-o::before { content: "\f2c0"; }

/* billing states */
#hub .hm-tag--b-active { --c: var(--hm-green); }
#hub .hm-tag--b-grace { --c: var(--hm-amber); }
#hub .hm-tag--b-locked { --c: var(--hm-red); background: var(--hm-red); color: #fff; }
#hub .hm-tag--b-locked::before { background: #fff; }
#hub .hm-tag--b-observe { --c: var(--hm-blue); }
#hub .hm-tag--b-new { --c: var(--hm-purple); }
#hub .hm-tag--i-pending { --c: var(--hm-grey); }
#hub .hm-tag--i-issued { --c: var(--hm-blue); }
#hub .hm-tag--i-late { --c: var(--hm-red); }
#hub .hm-tag--i-paid { --c: var(--hm-green); }
#hub .hm-tag--i-void { --c: #8a86a0; }
#hub .dh26-hero .hm-tag--b-locked { background: #be123c; }

#hub .hm-right { text-align: right; }
#hub .hm-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
#hub .hm-paymeth { display: inline-flex; align-items: center; gap: 6px; color: var(--hm-text); font-size: 13.5px; white-space: nowrap; }
#hub .hm-paymeth .fa { color: var(--hm-faint); }
#hub .hm-paymeth--bad { color: var(--hm-red); }
#hub .hm-paymeth--bad .fa { color: var(--hm-red); }
#hub .hm-users { display: grid; gap: 4px; min-width: 96px; font-size: 13px; color: var(--hm-text); font-variant-numeric: tabular-nums; }
#hub .hm-users__bar { height: 4px; border-radius: 2px; background: #eeedf3; overflow: hidden; }
#hub .hm-users__bar span { display: block; height: 100%; border-radius: 2px; background: var(--hm-purple); }
#hub .hm-users--over .hm-users__bar span { background: var(--hm-amber); }

/* the period bar: paid -> 7 days of grace -> locked */
#hub .hm-period { margin: 4px 0 2px; }
#hub .hm-period__track { position: relative; display: grid; grid-template-columns: var(--paid, 70fr) var(--grace, 20fr) var(--lock, 10fr); gap: 2px; height: 10px; }
#hub .hm-period__track > span { border-radius: 3px; }
#hub .hm-period__paid { background: var(--hm-green); }
#hub .hm-period__grace { background: repeating-linear-gradient(135deg, #f59e0b 0 5px, #fbbf24 5px 9px); }
#hub .hm-period__lock { background: #fecdd3; }
#hub .hm-period__today { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--hm-ink); }
#hub .hm-period__today::after { content: 'azi'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); color: var(--hm-ink); font-size: 11.5px; font-weight: 600; }
#hub .hm-period__labels { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; margin-top: 10px; color: var(--hm-muted); font-size: 12.5px; line-height: 1.3; }
#hub .hm-period__labels > span { display: flex; gap: 8px; align-items: baseline; }
#hub .hm-period__labels > span::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 3px; transform: translateY(1px); }
#hub .hm-period__labels > span:nth-child(1)::before { background: var(--hm-green); }
#hub .hm-period__labels > span:nth-child(2)::before { background: repeating-linear-gradient(135deg, #f59e0b 0 3px, #fbbf24 3px 5px); }
#hub .hm-period__labels > span:nth-child(3)::before { background: #fecdd3; }
#hub .hm-period__labels b { display: block; color: var(--hm-ink); font-weight: 600; font-size: 13px; }
#hub .hm-period-wrap { padding-top: 18px; }
#hub .hm-verdict--grace { background: #fffbeb; color: #92400e; }
#hub .hm-verdict--locked { background: #fff1f2; color: #9f1239; }
#hub .hm-verdict--observe { background: #eff6ff; color: #1e3a8a; }

/* lines table inside a card */
#hub .hm-blines { width: 100%; border-collapse: collapse; font-size: 14px; }
#hub .hm-blines th { padding: 0 0 8px; color: var(--hm-muted); font-weight: 500; font-size: 12.5px; text-align: left; border-bottom: 1px solid #eeedf3; }
#hub .hm-blines td { padding: 10px 0; border-bottom: 1px solid #f3f2f7; color: var(--hm-ink); vertical-align: top; }
#hub .hm-blines th:not(:first-child), #hub .hm-blines td:not(:first-child) { text-align: right; padding-left: 12px; font-variant-numeric: tabular-nums; }
#hub .hm-blines .hm-sub { display: block; }
#hub .hm-blines tfoot td { border-bottom: 0; padding: 6px 0; color: var(--hm-muted); }
#hub .hm-blines tfoot tr:last-child td { color: var(--hm-ink); font-weight: 700; font-size: 15px; padding-top: 10px; border-top: 1px solid #eeedf3; }
#hub .hm-blines .is-off td { color: var(--hm-faint); }
#hub .hm-cardacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
#hub .hm-history { margin: 14px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--hm-muted); }
#hub .hm-history li { padding: 6px 0; border-top: 1px dashed #e8e6ef; }
#hub .hm-history b { color: var(--hm-text); font-weight: 600; }

/* timeline */
#hub .hm-timeline { margin: 0; padding: 4px 0; list-style: none; }
#hub .hm-timeline li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 20px; border-top: 1px solid #f1f0f5; }
#hub .hm-timeline li:first-child { border-top: 0; }
#hub .hm-timeline__dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #f4f3f8; color: var(--hm-purple); }
#hub .hm-timeline__dot--ok { background: #ecfdf5; color: var(--hm-green); }
#hub .hm-timeline__dot--bad { background: #fff1f2; color: var(--hm-red); }
#hub .hm-timeline__dot--warn { background: #fffbeb; color: var(--hm-amber); }
#hub .hm-timeline b { display: block; color: var(--hm-ink); font-weight: 600; font-size: 14px; }
#hub .hm-timeline span { color: var(--hm-muted); font-size: 13px; }
#hub .hm-timeline time { color: var(--hm-faint); font-size: 12.5px; white-space: nowrap; }
#hub .hm-observe-mark { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #eff6ff; color: #1e40af; font-size: 11.5px; font-weight: 600; }

/* reports */
#hub .hm-chart { position: relative; }
#hub .hm-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
#hub .hm-chart .bar { fill: var(--hm-purple); }
#hub .hm-chart .bar--now { fill: #8b80a8; }
#hub .hm-chart .bar-hit { fill: transparent; cursor: default; }
#hub .hm-chart .bar-hit:hover + .bar, #hub .hm-chart g:focus-within .bar { fill: var(--hm-orange); }
#hub .hm-chart .grid { stroke: #eeedf3; stroke-width: 1; }
#hub .hm-chart .axis { fill: var(--hm-muted); font: 500 11.5px Roboto, sans-serif; }
#hub .hm-chart .val { fill: var(--hm-ink); font: 600 11.5px Roboto, sans-serif; }
#hub .hm-tip { position: absolute; z-index: 3; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--hm-ink); color: #fff; font-size: 12.5px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, -100%); }
#hub .hm-tip b { display: block; font-size: 13px; }
#hub .hm-tip[hidden] { display: none; }
#hub .hm-mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
#hub .hm-mini td, #hub .hm-mini th { padding: 8px 0; border-top: 1px solid #f1f0f5; }
#hub .hm-mini th { color: var(--hm-muted); font-weight: 500; font-size: 12.5px; text-align: left; border-top: 0; }
#hub .hm-mini td:not(:first-child), #hub .hm-mini th:not(:first-child) { text-align: right; padding-left: 10px; font-variant-numeric: tabular-nums; }
#hub .hm-mini a { color: var(--hm-purple); font-weight: 600; }
#hub details.hm-tableview { margin-top: 12px; font-size: 13px; }
#hub details.hm-tableview summary { cursor: pointer; color: var(--hm-purple); font-weight: 600; }

/* default prices */
#hub .hm-prices { width: 100%; border-collapse: collapse; }
#hub .hm-prices th { padding: 0 0 10px; color: var(--hm-muted); font-weight: 500; font-size: 12.5px; text-align: left; }
#hub .hm-prices td { padding: 10px 0; border-top: 1px solid #f1f0f5; vertical-align: middle; }
#hub .hm-prices td + td, #hub .hm-prices th + th { padding-left: 16px; }
#hub .hm-prices .form-control { max-width: 160px; text-align: right; font-variant-numeric: tabular-nums; }
#hub .hm-prices .hm-sub { display: block; }
#hub .hm-inputunit { display: flex; align-items: center; gap: 8px; color: var(--hm-muted); font-size: 13px; }

/* modal form bits */
#hub .hm-mform { display: grid; gap: 14px; }
#hub .hm-mform label { display: block; margin-bottom: 6px; color: var(--hm-text); font-weight: 600; font-size: 13.5px; }
#hub .hm-mform .hm-sub { display: block; margin-top: 4px; }
#hub .hm-mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#hub .hm-mform .hm-choice, #hub .hm-choice { display: flex; margin: 0; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--hm-line); border-radius: 12px; cursor: pointer; font-weight: 400 !important; }
#hub .hm-choice:has(input:checked) { border-color: var(--hm-purple); background: #f6f4fa; }
#hub .hm-choice input { margin-top: 3px; }
#hub .hm-choice b { display: block; color: var(--hm-ink); }
#hub .hm-choice span { color: var(--hm-muted); font-size: 13px; }
#hub .hm-sum { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #f6f5f9; font-size: 14px; }
#hub .hm-sum b { color: var(--hm-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
    #hub .hm-mgrid { grid-template-columns: 1fr; }
    #hub .hm-period__labels { font-size: 11.5px; }
}

/* Hub additions for the real pages */
#hub .al-status-pill-dot.d-purple { background: var(--hm-purple); }
#hub .hm-users__bar span.hm-w-0 { width: 0; }
#hub .hm-users__bar span.hm-w-10 { width: 10%; }
#hub .hm-users__bar span.hm-w-20 { width: 20%; }
#hub .hm-users__bar span.hm-w-30 { width: 30%; }
#hub .hm-users__bar span.hm-w-40 { width: 40%; }
#hub .hm-users__bar span.hm-w-50 { width: 50%; }
#hub .hm-users__bar span.hm-w-60 { width: 60%; }
#hub .hm-users__bar span.hm-w-70 { width: 70%; }
#hub .hm-users__bar span.hm-w-80 { width: 80%; }
#hub .hm-users__bar span.hm-w-90 { width: 90%; }
#hub .hm-users__bar span.hm-w-100 { width: 100%; }
#hub .hm-table td .hm-sub { display: block; }

/* client detail (Task 17): the design's inline styles as classes, a link-looking button, the "azi" marker only once hub.js placed it */
html:not(.js) #hub .hm-period__today { display: none; }
#hub .hm-facts--gap { margin-top: 18px; }
#hub .hm-sub--note { margin-top: 12px; }
#hub .hm-sub--inline { display: inline !important; }
#hub .hm-cardacts--pad { margin: 0; padding: 14px 20px 18px; border-top: 1px solid #f1f0f5; }
#hub .hm-linkbtn { padding: 0; border: 0; background: none; color: var(--hm-purple); font: inherit; font-weight: 600; cursor: pointer; }
#hub .hm-linkbtn:hover, #hub .hm-linkbtn:focus-visible { text-decoration: underline; }
#hub .hm-timeline li > form { margin: 0; }
#hub .hm-facts dd .hm-tag { margin-left: 4px; }

/* Facturi, Rapoarte, Prețuri implicite (Task 18) */
#hub .hm-note--slot { margin: 0; }
#hub .hm-note--slot:empty { display: none; }
#hub .hm-subhead { display: flex; gap: 8px; align-items: center; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid #eeedf3; color: var(--hm-ink); font-size: 15px; font-weight: 600; }
#hub .hm-subhead .fa { color: var(--hm-purple); }
#hub .vpe-card-header .contract-card__action-btn { margin-left: auto; }
#hub .hm-mini .hm-sub--inline { font-size: 12px; }
#hub input[type="month"].hm-select { min-width: 150px; }

/* Clienți › fără facturare: the period chosen when the Account is added */
#hub .hm-unbilled-period { display: inline-block; width: auto; height: 30px; padding: 2px 8px; margin-right: 6px; vertical-align: middle; }

/* the last error of an invoice whose issue failed for good */
#hub .hm-issue-error { color: #be123c; white-space: normal; }

/* Clienti: a billed Account with no invoice recipient (Task 10: no contact with Facturi, no billing e-mail) */
#hub .hm-noinvoice { display: inline-flex; margin-left: 6px; color: var(--hm-amber); font-size: 13px; vertical-align: 1px; text-decoration: none; }
#hub .hm-noinvoice:hover, #hub .hm-noinvoice:focus-visible { color: #b45309; }

/* Anunturi (Task 11): the target pickers of the draft form and the preview of the mail (an iframe of the exact HTML, sandboxed) */
#hub .hm-anbody { min-height: 220px; resize: vertical; font-family: inherit; line-height: 1.5; }
#hub .hm-picklabel { display: block; margin-bottom: 6px; color: var(--hm-ink); font-size: 13px; font-weight: 600; }
#hub .hm-pickq { margin-bottom: 8px; }
#hub .hm-pick { max-height: 280px; overflow-y: auto; padding: 4px 12px; border: 1px solid var(--hm-line); border-radius: 12px; background: #fff; }
#hub .hm-pick label { display: flex; gap: 10px; align-items: baseline; margin: 0; padding: 8px 0; font-weight: 400; cursor: pointer; }
#hub .hm-pick label + label { border-top: 1px solid var(--hm-line); }
#hub .hm-pick label[hidden] { display: none; }
#hub .hm-pick input { flex: 0 0 auto; }
#hub .hm-previewcard { margin: 0; }
#hub .hm-mailpreview { display: block; width: 100%; height: 560px; margin-top: 10px; border: 1px solid var(--hm-line); border-radius: 12px; background: #f4f4f8; }
